The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

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

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

#289417
Hi, guys!

I have a working addon which reads a text file and adds new elements in AC: walls, roofs, etc. with some properties. When I import a wall, for example, a piece of the wall is immediately drawn and I can move and modify it. I can see its properties with right button -> Wall Selection Settings. But if I first choose from the top bar my new wall and then I draw it, the properties have no values, only names.
Is there a way to apply the properties so that they will be shown in the second case?
#289421
I'm not sure if it understood well but in the second case, I assume that you draw a new wall in AC and then activated addon.

In this case, if the addon is written just to read a text file and create new elements then probably no. You need to add functionality to attach properties to selected elements based on a sort of identification of existing element in files.

You see properties because they are classified for Wall. But you see their default value in this case probably empty value.
Try Propertie_test in examples there should be an example for this kind of functionality.
#289463
I open the file, read the attributes and properties in vectors, and then add them using these functions:

GSErrCode ACAPI_Attribute_Create()
GSErrCode ACAPI_Property_CreatePropertyDefinition()
GSErrCode = ACAPI_Element_SetProperties()

I am still not very confident of what every piece of code does (it is written by my previous colleague) and now I have to find a way to fix it only if it is possible.
#289512
I assume that whole thing was written just for importing purposes.

Element_SetProperties should work fine but It's probably taking newly created wall element from previous bits of code. Probably you need to make new command which takes existing wall elements and then does Element_SetProperties using theirs GUIDs.

This is only my assumption with your info provided. If you can be more specific or provide more code it will be easier to suggest something more helpfull.
#289562
I create a new property group and add properties in it - names and values and I can see them in the wall that is imported and drawn. This property group is applied globally in ArchiCAD because I can see it in every new wall that I draw manually - built-in type or my imported type. But the values of the newly drawn walls are always blank.
I hoped that I should have the values in the case when I draw another piece of the wall that I imported. But if it is not possible, I think this issue can become a "known limitation".