We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Identifying elements in ArchiCAD exported IFC file

Anonymous
Not applicable
Hi,

I have an add-on that forces ArchiCAD to export to an IFC file each time a new element is added to the project. The add-on then notifies another application called the IFC Viewer, which loads/reloads the IFC file and displays the contents in 3D. When I select an element in ArchiCAD, I want that element to be highlighted in the IFC Viewer. To achieve this I need to find some way of identifying the selected ArchiCAD element in the IFC file. Only problem is that the ArchiCAD IFC add-on strips down everything including the unique ID of elements and any custom information that I may have added.

Does anyone know how I can attach information to elements in ArchiCAD (e.g. my own unique ID for an element), so that the information will still be attached to the elements in the exported IFC file?

It would be really helpful if I could somehow modify the ArchiCAD IFC add-on, but I guess Graphisoft is unlikely to release the source code

Anyway any help would be greatly appreciated.
2 REPLIES 2
Anonymous
Not applicable
If that could be multiple criteria, you could check by:
-element type
-location in space
-attributes
If you will have 2 identical objects in project - most likely it means that you have an overlapping elements (error?)
Anonymous
Not applicable
Thank you. Identifying elements by comparing the geometric details is definitely an option, but it would be nice if there was an easier way.

Each element in ArchiCAD appears to have two unique IDs. The first is of type long integer, which is discarded in the exported IFC file. The second is a text string like “SLA – 001” for the first slab, or “SW – 004” for the forth wall. This text ID can be accessed and modified under the “Listing and Labeling” section, in the “<Element> Selection Settings” dialog (Right click on any element and select ”<element> Selection settings”). This text ID is also included in the exported IFC file.

So basically all I need to do now is access this text ID in the code. Unfortunately I have been unable to find it in the element header/memo structures. Again any help would be greatly appreciated.

Edit: Aright, I found it. Some structures in the API_Element union have a string called info. So if I selected a slab, I could access the info for that by elem.slab.info, which may give me “SLA – 001”.