Adding expressions to dimensions


#1

Is there a way to add expressions to dimensions? For instance if I would like to change the value of a dimensions so that it always shows the double of the value, is there a way to do this? I imagine it would be typing something on the right in the following example but I’m not sure if it exists and how to implement it.


#2

@siemen,

you could add a new dimension style based on your regular one and change Primary text “Length factor” to 2.0:

Does that help ?

c.


#3

Well… I guess that’s a way to do it. But I was more thinking of being able to do whatever you want with the dimensions: Divide by 3, always add 1, always subtract 2, …
I was thinking of it similar to the way the expression works in some grasshopper components:


You use x as the value it receives and you can do whatever you want with it.

I’m not saying this should be pushed to be implemented as it was just now the first time I had a need for this, but I was mainly wondering if something like that exists and I didn’t know about it.


#4

@siemen, no you’re not missing something. I thought first the <> could be used as a variable like in GH but found that the syntax for dimensional expressions is rather limited. Eg. in a dimension the first use of <> nominates the dimension value but every following occurance seems to be evaluated as text. In a linear dimension with a distance of 12 writing this: <><> is evaluated as: 12 <> and not as 12 12.

I think that the expression formulas aka “text fields” in the helpfile is more suited for use in real text fields created with _Text. Eg. if you create an empty text field and paste this:

Date = %<date("d")>%

the output is:

Date = 3/2/2017

but putting this

<> = %<date("d")>%

in a linear dimension with the length value 12 results in:

12 = %<date("d")>%

Why not, sounds like it can be very useful in some cases ? :wink:

c.


#5

This may be a failure of imagination on my part, but I was just curious how you would use this? The only thing that springs to mind is something like:

<> 3 EQ. SECTIONS, (<>*3) TOTAL

But wouldn’t you just dim the overall?

Sam