2022-11-03 08:27 PM - edited 2022-11-03 08:28 PM
Is there any way to manipulate the values of the property "Elevation of Linked Story Value"?
I want to do a calculation with it and another property and then display the result, but data types stops me cold.
2022-11-07 08:11 PM - edited 2022-11-07 08:12 PM
The Data Type of the "Elevation of Linked Story Value" parameter is "Length". So, if you want to manipulate it, you may want to convert it to the "String" Data Type first using the "STRCALCUNIT" function, or even further convert it from "String" to "Number" using the "STRTONUM" function.
A bit more info of exactly what you are trying to achieve would be helpful, maybe with a few screenshots.
2022-11-08 03:26 PM
Thanks Laszlo - let me run a few tests and then I will get back to you. Is there a list of all built-in parameters that tells their data types?
2022-11-09 11:08 PM
Ok - I have worked out a way to get the value I want, but I am sure there is a more clean way to do this without using all of the custom properties. The basic premise here is that I have made about 30 different types of outlets and switches that have there zero point at the bottom of the objects. There is nothing smart about these objects, but they look correct in elevation and 3D. I have calculated the value of the center point above the elevation of project zero by using an offset value... I am sure there is a better way to combine all of the expressions into one property, but I am struggling to figure out how to accomplish this... Any help pointing me in the right direction would be appreciated.
2022-11-11 04:27 AM
It looks OK to me considering that you cannot use Library Part parameters in Property Expressions so you have to create these calculations to arrive at the final value.
Actually, you could unify those 4 Property Expression into a single expression and then you would have to introduce 2 new Properties: Offset, and the final value.
About Parameter Data Types: when you open the "Parameters & Properties" list, in front of each parameter, you will see and icon, which indicates its Data Type: Length, Area, Volume, Integer, Angle, etc.
2022-11-13 02:34 PM
After attempting to rationalize the individual expressions into a single expression - I stumbled on a way to remove the units from a Library Part Unit Property. Instead of converting to a string and, counting the characters, and splitting off the units - All you have to do is convert to a string and then convert to a number.
STRTONUM ( STRCALCUNIT ( {Unit Property} ) )
now you have a clean number to work with.
So then I can do this ....
(STRTONUM ( STRCALCUNIT ( {Unit Property} ))) + Offset)
ohhhh my!
Thanks Laszlo for helping me take off the blinders!
2022-11-13 02:44 PM
Which then lets me do this...
STRTONUM ( STRCALCUNIT ( {Elev Unit Property} ) ) + (STRTONUM ( STRCALCUNIT ( {Height Unit Property} ) ) / 2 )
2022-11-13 08:42 PM - edited 2022-11-15 03:20 AM
You are welcome.
There is another trick for converting "Length" to "Number" that comes to my mind (sorry, I did not remember it in my first anwer):
Simply divide the parameter with the unit of measurement of the Data Type, which in the case of Length is 1 m (in Metric).
So
{Elev Unit Property} / 1 m
should also convert it to a Number for you.
2022-11-14 02:40 PM
Is there an ultimate guide to Expression Coding?