diskoalnis Posted November 5, 2021 Share Posted November 5, 2021 Hello! As described in the topic I want to make an if function between two custom fields. I did a google search on this topic and I assume the diesel expression should be something like this but so far I can't get it to work. $(if,$(eq,$(getenv,CustomDP.Name),Text_1),"New_Text_1",$(if,$(eq,$(getenv,CustomDP.Name),Text_2),"New_Text_2")) What I want to achieve is when the specific field contains specific text in this example "Text_1" the other field should display "New_text_1" and so on. CustomDP.Name = name of the custom field as displayed in field expression.. And thanks to anyone for spending his time on reading this, probably simple question.. Quote Link to comment Share on other sites More sharing options...
tombu Posted November 7, 2021 Share Posted November 7, 2021 I don't think you can access Custom Drawing properties with DIESEL expressions. Here's a lisp example: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-fill-var-witch-lisp/td-p/9280352 Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 8, 2021 Share Posted November 8, 2021 I do not believe the IF expression will work like that in DIESEL. AFAIK it is just a Yes/No deal. Your best bet is to use a LISP as mentioned. Quote Link to comment Share on other sites More sharing options...
steven-g Posted November 8, 2021 Share Posted November 8, 2021 So long as you use SETENV to give a custom environmental variable a value and do not use dwgprops. you can use a field containing a diesel expression to read that variable $(getenv,test) And then in a second field you can use the diesel expression below to compare it $(if,$(eq,$(getenv,test),string_to_test),yes same,no different) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.