Unit less Parameter string length of value

Unit less Parameter string length of value

condrovic1980
Contributor Contributor
376 Views
2 Replies
Message 1 of 3

Unit less Parameter string length of value

condrovic1980
Contributor
Contributor

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
Accepted solutions (1)
377 Views
2 Replies
Replies (2)
Message 2 of 3

g-andresen
Consultant
Consultant
Accepted solution

Hi,

might help

 

if statemant_myvar.png

 

günther

0 Likes
Message 3 of 3

condrovic1980
Contributor
Contributor

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