Assign an IFC classification to a layer with Grasshopper/script

Hi everyone,

Do you know if there is a possibility to assign an IFC classification to a layer with Grasshopper/script (rather than manually doing it from the ggRhinoIFCLayers panel) ?

Thanks for your answer,

Yohann

Hi Yohann,

If you have some knowledge of scripting, then you can set this using Python, C#, Vb.net or similar.
The classification is stored as UserText on the rhino layer, you can set using the key “IfcType”

Here’s a sample. You do need to refresh the ifc layer panel to see the changes, either by closing and opening the panel. Alternative save and reopen the rhino document (or trigger a layer change in rhino dialog).
220503 set layer ifc class.gh (11.3 KB)

Hope it helps,

Jon

Dear Jon,

Thank you for your fast answer ! Of course, it helped me a lot !

I didn’t know that classification was stored as UserText on the rhino layer, now it’s more clear…

What I also understood is that IFC properties, defined in a Property Template and visible in the ggIFCProperties panel (image below), aren’t stored as UserText on rhino object attributes.

imagejon

Now, if I want to compute and assign a value to “Property 1”, is it possible with a script ?

Sincerely,

Yohann

I’ve made a request to McNeel that Rhino has some user interface to inspect user text on layers (there is a youtrack number I can dig out). To my knowledge it’s only available via programming, so it’s not obvious to a user.

The properties are also stored as usertext. I need to dig out the key convention, but if you set a value on a form, then you should see the usertext and it can also be set from Grasshopper etc. Let me know if this doesn’t help.

Hi Jon,

Solved !

The reason why nothing appeared in the “Attribute User Text” panel is that I was using Rhino in French.

It was impossible to set any IFC property value in the ggIFCProperties panel (the value automatically disappeared). I changed Rhino language to english and now everything works, I can set values to my properties and they are now displayed in the “Attribute User Text” panel (Key = Property_set|Property_name, Value=Property_value).

Thank you again for your fast support, and congrats for the good tool you provide

Yohann

1 Like