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.

How to set a material on an object.

itono
Contributor

hi,

 

I am a c++ beginner investigating Archicad APIs.

 

Is it possible to use Archicad's API to reflect materials on objects (walls and doors) displayed in the project?

If possible, are functions or sample code available in the development kit?

 

itono,

1 REPLY 1

Hi Itono,

 

Yes you can read and set the building material of elements with the API. The API DevKit includes and example directory. Check the example "Element_Test" for changing/reading/creation of elements. Specifically in "Element_Test\Src\Element_Modify_ChangeParameters.cpp" there are a few lines where the buildingMaterial of a hatch is changed.

For walls it's very similar to that example. For details check the documentation of the wall element type here: https://archicadapi.Graphisoft.com/documentation/api_walltype.

For doors/windows it's a bit more difficult, since you need to change the corresponding GDL parameters. For an intro to that, check out the example "LibPart_Test".

Hope that gives you a first starting point to look into!

Best,
Bernd