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

3d Model dump example?

Anonymous
Not applicable
I am trying to learn the basics of the API.
I usually learn simply by example. Its easier for me.

I would like to ask if there is somewhere an example of a model dump.
I mean loop through all elements
and for each element output geometry materials and so on in a simple text file.

In the documentation its says about a plan dump but there is no link for the example.

Thx in advance
5 REPLIES 5
Karl Ottenstein
Moderator
Did you try the example folder called "Plan_Dump"? 😉 (Ignore the comment at the top of Plan_Dump.cpp which suggests that the source file does something else.)

Karl
One of the forum moderators
AC 27 USA and earlier   •   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
stefan
Expert
I have a non-optimised, badly structured but working add-on, based on the API-examples, which "dumps" the geometry of the ArchiCAD scene into ascii-files. I export to the radiance format, but I'm hoping to generalise it to other formats as well...

I don't handle texture mapping (yet?) and also ignore smoothing/normals, so it's in no way a releasable addon.

I've had quite some input from other developers on this forum, so in that spirit I can share what I have.
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad27/Revit2023/Rhino8/Unity/Solibri/Zoom
MBP2023:14"M2MAX/Sonoma+Win11
Archicad-user since 1998
my Archicad Book
Anonymous
Not applicable
stefan wrote:
I have a non-optimised, badly structured but working add-on, based on the API-examples, which "dumps" the geometry of the ArchiCAD scene into ascii-files. I export to the radiance format, but I'm hoping to generalise it to other formats as well...

I don't handle texture mapping (yet?) and also ignore smoothing/normals, so it's in no way a releasable addon.

I've had quite some input from other developers on this forum, so in that spirit I can share what I have.
Im a noob to ArchiCad as well, and would really really really like to iterate thru a model and get the coordinates of all elememts and their x,y,z coordinates ~ Im specifically interested in 'Zones' and Objects like chairs, tables etc etc.

Cheers,
Kon.
KonMan
Anonymous
Not applicable
Program Files\Graphisoft\API Development Kit 6.1\Examples\Plan_Dump\

This is a basic example, just printing parts of the API_Element structure. If you need more detailed information about how the objects look you should look at the function ACAPI_LibPart_ShapePrims
Anonymous
Not applicable
Thanks Adam - I will dive in and check it out.

Regards,
Kon.