Documentation
About Archicad's documenting tools, views, model filtering, layouts, publishing, etc.

Data Types and expressions

gdford
Advisor

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.

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000
8 REPLIES 8
Laszlo Nagy
Community Admin
Community Admin

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.

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

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?

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000

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.

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000
Laszlo Nagy
Community Admin
Community Admin

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.

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

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!

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000

Which then lets me do this...
STRTONUM ( STRCALCUNIT ( {Elev Unit Property} ) ) + (STRTONUM ( STRCALCUNIT ( {Height Unit Property} ) ) / 2 )

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000
Laszlo Nagy
Community Admin
Community Admin

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.

PropertyExpression-ĹengthToNumber.png

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

Is there an ultimate guide to Expression Coding?

Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000