The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: ejrolon, Barry Kelly, Karl Ottenstein, LaszloNagy, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy, rmasaki

User avatar
By Ralph Wessel
Is the data for use only by the add-on? Or does the library part need to share it?

If the former, use ACAPI_Element_SetUserData.

Otherwise (if the object needs to 'see' the data) you probably need to write the data to object parameters.
By Martin Walter
I'm creating a library part with some user data in the parameter section and putting it as element into a wall.

Later the user selects an element and the addon should get the library part from it and read the user data from the parameter section.

The first part seems to be working using ACAPI_LibPart_GetSect_ParamDef.

But how do I get the library part from a selected element?
User avatar
By Ralph Wessel
Is the library part a door/window or an ordinary object?

If it's a door/window, the wall contains links to the embedded objects in its memo structure. You can obtain this with ACAPI_Element_GetMemo.

If it's an ordinary object, you will need to establish a link between the wall and object using ACAPI_Element_Link. You can later retrieve linked objects from the wall using ACAPI_Element_GetLinks.
By Martin Walter
When the element was created I filled the memo with ACAPI_Element_GetDefaults(&element, &memo);

But calling ACAPI_Element_GetMemo now, the wallWindows pointer in API_ElementMemo is empty.
By Martin Walter
In the API file APIdefs_Elements.h
where the API_ElementMemo structure is defined there is the line:

API_Guid *wallWindows; // output only (obsolete, use ACAPI_Element_GetConnectedElements instead)

so maybe this part should not be used any more?