Skip to main content

I want to write an ifc file where all objects get a guid from the source.

In my source dataset (rooms) there is already a primary key (in guid format). I want to keep this key in the exported objects (IfcSpace). I have tried to set different attributes with this value (ifc_id, ifc_unique_id, GlobalId), but the ifc writer always generates a new guid for each object.

How can I arrive to export an already existing guid for each object?

Hi @aristotls,

Have you tried writing your guid attribute out as part of a property set? Perhaps you could make the guid attribute into a geometry trait, then add it onto an existing property set definition, or create a new definition. It won't exactly replace the GlobalId attribute, but you'll have written out your original primary key values. Here is the article that I'm thinking of: AutoCAD to IFC Conversion Example. Hope that generates some ideas!


Thanks for this solution. But I need to write the IfcRoot.GlobalId value. Is there no way to give this value to the ifc writer?


Reply