Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Getting value of built-in properties by their GUID

Sam Karli
Enthusiast

Elements have, like, Renovation Status that can be accessed as built in properties. In many cases these properties have GUIDs as values. Is it possible to get some more info from these values?

Like "57E66097-9C38-8012-D9C7-0CA01AA5EB1E" as a string: "To Be Demolished"?

 

Thanks in advance

GDL/Python/C++ dev
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft

Check out the possibleEnumValues field of API_PropertyDefinition. It contains exactly what you are looking for.

View solution in original post

5 REPLIES 5

Hi Sam,


The renovation status specifically can be obtained from every element from there head (See API_ElemHead).

Also for reference there's a whole module to handle Renovation Filters.

 

Also if you have the GUID of the built-in property it might also be able to obtain the values via the properties api calls.

 

Hope that helps,

Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

On selected object's Settings/Classification/Properties I see the, like, renovation status and the Properties/Classifications besides each other and I'm about to kind of recreate this UI stuff. This is the reason I want to reach Renovation status etc. through Properties and not via ElemHead.

On the other hand, in ElemHead there is a renovationStatus field that is of API_RenovationStatusType that tells me that there is only four (4) types including the Undefined one, so it is safe to set up a GS::HashTable to map GUIDs to GS::UniStrings. Not elegant, but works.

Note that there are some other fields that I can reach the same way through as a GUID property, and can convert into displayable strings (Position and Structural Function, currently), and it would be another burden to get them but it is more straightforward to use a built in mapping.

Not elegant, I understand.

GDL/Python/C++ dev
Solution
Viktor Kovacs
Graphisoft
Graphisoft

Check out the possibleEnumValues field of API_PropertyDefinition. It contains exactly what you are looking for.

FYI: If you are just interested in the values of BuiltIn properties, check out the Dev. Kit Example Property_Test, specifically the Function: SavePropertyValuesOf Element( ). It returns all the property values and Definitions. i use this function to return all the built in values in one single command to a Python script. It is extremely fast

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Indeed, this is the stuff I searched for.

Many thanks.

GDL/Python/C++ dev