GDL
About building parametric objects with GDL.

How to request values of custom properties in gdl?

talmacsi_petrolterv
Contributor

I can request the list of all custom properties:

n = REQUEST ("PROPERTIES_OF_PARENT", "", parentProperties)
This gives the guid, GroupName, PropertyName. So I know the basic info about the required property.
 
But the value request requires "id", here:
mm = REQUEST("PROPERTY_VALUE_OF_PARENT","id",4,0,0,kod)
If I put the guid there, it shows an error message.
 
I cannot find any other approach.
 
 
Or maybe the "PROPERTY_VALUES_OF_PARENT" would be good, but that uses DICT dictionaries - and in the gdl reference guide you can't find proper examples of how to use those dictionaries.

 

 

And actually, the opposite direction would be good also: to get the gdl parameters in custom properties.
13 REPLIES 13
vlahtinen
Advocate

Just checking, are you creating a custom label or requesting the object's own properties?

Yes, it's some kinda label, but an archicad object (not label-tool).

I can retrieve the gdl (standard / global) variables, but I just want to get the custom properties, too.

Sorry, the answer above/below was also by me. (just missed the right browser)

runxel
Hero

If its not a Label it can not access custom properties.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
vlahtinen
Advocate

As @runxel wrote, objects can’t access custom properties. The workaround is to create a custom IFC translator which maps the properties to IFC properties and these can then be queried with APPLICATION_QUERY command. I think the translator has to be set as preview translator. 

Thanks.

The only way is to go around purely in GDL is: with save to txt the property (eg in ui script) and then load it in parameters script, but needs to be triggered.

Managed to implement your suggestion. Thanks! It works just fine.

Almost. Because you have to refresh the object to update properties (in some cases).

I can refresh them by selecting all the occurencies of the element on the active view, open & close the settings of the objects.

Do you know any other way to automatically refresh the objects?

'Rebuild & Regenerate' (CTRL + ALT + SHIFT + R on windows) is the most powerful rebuild command.

Not sure if that will update the properties or if you still need to open the object settings.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11