TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Marc'Antonio Alessi on May 25, 2023, 11:53:25 AM

Title: Formula in field to show values rounded up
Post by: Marc'Antonio Alessi on May 25, 2023, 11:53:25 AM

Code: [Select]
I have a field in attrib linked with a parameter of a dynamic block, the parameter can be 0.01 to 2000:

%<\AcObjProp.16.2 Object(?BlockRefId).Parameter(8).UpdatedDistance \f "%lu6%zs8">%

How can I get this kind of result based on parameter value?

from 0.01 to 1000 > 1000
>     1000 to 1500 > 1500
from 1500 to 2000 > 2000
Title: Re: Formula in field to show values rounded up
Post by: ribarm on May 26, 2023, 01:06:49 AM
Can you extract "measurement" parameter from UpdatedDistance with vla-get-measurement...
If your answer is yes, then simply (cond) would do rounding up like you described...
Title: Re: Formula in field to show values rounded up
Post by: Marc'Antonio Alessi on May 26, 2023, 06:39:13 AM
Can you extract "measurement" parameter from UpdatedDistance with vla-get-measurement...
If your answer is yes, then simply (cond) would do rounding up like you described...
Thanks Marko, I will take a look.