Listing IFC classification attributes of a component definition

Hi all,

ComponentDefinition objects have a method #get_classification_value. We pass a complete IFC path (a list of strings) as a key, and it returns either the value or nil. Is there a way to know which paths are defined for a given ComponentDefinition? I think there is no definitive list of all the possible paths that could be valid, because in addition to the many standard ones there are also user-defined ones like “pset_xxx”.

But there is no ComponentDefinition#list_classifications and using #get_classification_value with shorter paths does not give us the list of which subpaths are defined. I have not found the way, hence my question. The goal is to reproduce with Ruby code something similar to the Component Options dialog box, which lists these IFC values when they are some.

Armin Rigo

You would need to write code to walk the IFC attribute dictionary tree.

This will be an exercise in recursive collection handling. Ie, each dictionary at each level can have one or both of key/value pairs (attributes) and/or subdictionaries (in which case the name of the subdictionary is a member of the path and will precede any of it’s attribute names or child dictionary names, etc., etc.)

Thank you, i missed the nested dictionaries!