# Listing IFC classification attributes of a component definition

**URL:** <https://forums.sketchup.com/t/listing-ifc-classification-attributes-of-a-component-definition/199652>\
**Category:** Ruby API\
**Tags:** ifc\
**Created:** [May 27, 2022, 12:03pm UTC](https://forums.sketchup.com/t/listing-ifc-classification-attributes-of-a-component-definition/199652 "2022-05-27T12:03:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![armin.rigo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/armin.rigo/32/52126_2.png) [@armin.rigo](https://forums.sketchup.com/u/armin.rigo)\
**Post date:** [May 27, 2022, 12:03pm UTC](https://forums.sketchup.com/t/listing-ifc-classification-attributes-of-a-component-definition/199652/1 "2022-05-27T12:03:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [May 27, 2022, 6:36pm UTC](https://forums.sketchup.com/t/listing-ifc-classification-attributes-of-a-component-definition/199652/2 "2022-05-27T18:36:56Z")

</div>

> [@armin.rigo](#):
>
> Is there a way to know _which_ paths are defined for a given ComponentDefinition?

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.)

---

<div class="post-metadata">

**Author:** ![armin.rigo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/armin.rigo/32/52126_2.png) [@armin.rigo](https://forums.sketchup.com/u/armin.rigo)\
**Post date:** [May 27, 2022, 8:36pm UTC](https://forums.sketchup.com/t/listing-ifc-classification-attributes-of-a-component-definition/199652/3 "2022-05-27T20:36:11Z")

</div>

Thank you, i missed the nested dictionaries!
