Link Component Attributes to IFC Text fields
-
I'm looking for a way to link the Component Attributes Text (that changes depending on the component behaviour in the model) to the IFC Text that is possible to fill from the Component Options Window. Is there any trick / code / snippet to make this work? or is this something really complex to achieve?
Thanks,
Stefano
-
The core code would look like this: Assume there is a single Component selected.
model = Sketchup.active_model instance = model.selection[0] attributes = instance.definition.attribute_dictionary("dynamic_attributes") name = attributes["name"] desc = attributes["description"] path = ["IFC 2x3", "IfcFurnishingElement", "Name", "IfcLabel"] success = instance.definition.set_classification_value(path, name) path = ["IFC 2x3", "IfcFurnishingElement", "Description", "IfcText"] success = instance.definition.set_classification_value(path, desc)
-
It's unclear to me how the plugin would know to use "IfcFurnishingElement" as the type in the path. There does not appear to be any way to retrieving this type using a plugin. So I'm stumped.
Advertisement