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.

Objects Tree View

Toshik
Participant

Hi, I'm developing an add-on for archicad and I'm having a problem. I need to get a tree of all objects in the drawing, for example, how it looks in the ifc project manager.

 

I do the following:123.png


1) 

API_IFCTranslatorIdentifier ifcTranslator = helperFunction::GetExportTranslator();


2) 

if (ifcTranslator.innerReference != nullptr)
    ACAPI_Goodies(APIAny_GetIFCRelationshipDataID, &ifcTranslator, &ifcRelationshipData);


3)

 I build a tree of objects from ifcRelationshipData.containmentTable

 

This works correctly, but when I try to get the object name by guid from ifcRelationshipData.containmentTable - in most cases I don’t receive an answer, and in the case of getting ifc properties by the same guid - I never receive an answer at all, please tell me how can I do it?

2 REPLIES 2
Toshik
Participant

w

Toshik
Participant

ifcRelationshipData.containmentTable allows me to get the GUID of all elements, just like in the ifc manager. However, if you look at the ifc object properties in the ifc manager, you can see that there is no Tag field. I think that is why the api functions ACAPI_Element_GetIFCAttributes and ACAPI_Element_GetIFCType return an error BAD_ID for objects that do not have a tag field in ifc attributes.

 

IFC attributes of the wall(have a Tag field):

Toshik_0-1692162969577.png

 

IFC attributes of the project(does`n t have a tag field):

Toshik_2-1692163041307.png

 

Objects of type ifcBuilding , ifcSite, ifcProject in ifc manager have only archicad ifc id - is this a bug? Or is there a way to contact them? As far as I know - archicad ifc id navigation is not possible