Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Unit less Parameter string length of value

condrovic1980
Explorer

Unit less Parameter string length of value

condrovic1980
Explorer
Explorer

I am trying to build a parametric model as a template. I am trying to determine the length of a variable which is unit less. I am not trying to find the actual physical length but more the variable's character length, much like you would do using the len(string) function is say python. Ex: myVarOne = 123, len = 3, myVarOne = 1234, len = 4 etc. So based on that I am trying to set another variable which has a unit. But currently it doesn't seem like there is a way to have a string and get the length.

Example would be something like this

myVarOne = 123

myVarTwo =
if len(myVarOne) <=3 then 70

if (len(myVarOne) > 4 then 40

if(len(myVarOne) = 4 then 55

0 Likes
Reply
Accepted solutions (1)
211 Views
2 Replies
Replies (2)

g-andresen
Consultant
Consultant
Accepted solution

Hi,

might help

 

if statemant_myvar.png

 

günther

0 Likes

condrovic1980
Explorer
Explorer

thanks for the reply I managed to work something out for what I was doing using the following logic

( if(myVar1 <= 999; 70; if(myVar1 > 9999; 40; if(myVar1 >= 1000; 55; 0))) ) * 1 mm

Cheers

0 Likes