Using a custom sheet field in a diesel expression.

Using a custom sheet field in a diesel expression.

Anonymous
Not applicable
2,500 Views
4 Replies
Message 1 of 5

Using a custom sheet field in a diesel expression.

Anonymous
Not applicable

I am trying to add text that changes based on a custom field.   I have been trying to do this by adding a field in mtext and then using a diesel expression to make an if statement. 

I am able to pull a system variable using $(getvar, ) but I can not get diesel to pull custom props.  Is diesel the wrong tool?  is there a better way?

 

Ex. If oranges (custom field) = 0, I would like the text to say "There are no oranges" if oranges = 1 to 5 I want it to say "There are some oranges"  If oranges > 5 I want it to say "That is too many oranges."  

 

I am using Autocad LT, it seems like the full version could do this using Rtext, but this may be a limitation on LT.

Any help is appreciated.  Thank you in advance!

 

0 Likes
Accepted solutions (1)
2,501 Views
4 Replies
Replies (4)
Message 2 of 5

steven-g
Mentor
Mentor

We would need to see a drawing file with examples of these 'oranges' but it does sound to be beyond the capabilities of LT and Diesel. The "IF" function in a Diesel expression is really only for simple yes/no types of testing not for the more complex 'IF CONDITION' then do this or do that. LT isn't designed for this type of 'programming'.

Yes you can get quite complex with Diesel but not easily, it is more for simple toggle switches in a macro.

0 Likes
Message 3 of 5

Anonymous
Not applicable

"oranges" is a sheet set custom property. 

Could you use diesel to say "there are oranges"  or "there are no oranges"?

Really my question is, can I call on Sheet Set Custom Properties using diesel?

Once I have the data I can code what I need from there, I am just having problems getting the values from my sheet set properties into diesel.  

I have tried using the Field expression as a variable "%<\AcSm SheetSet.Oranges>%" but this will not call on the value for oranges more than once, then the code breaks.  Any other ideas?

 

0 Likes
Message 4 of 5

pendean
Community Legend
Community Legend
Show us the RTEXT code that could do this, it should work in LT too.

0 Likes
Message 5 of 5

steven-g
Mentor
Mentor
Accepted solution

I don't think so, you can read the values into a field (which can be used in text) but Diesel can only read variables using getvar and getenv, it cannot read field values or drawing properties, it can also work with strings but only those supplied directly in the code, not with AutoCAD text or mtext strings

0 Likes