cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

Extract graphical data from various elements

Anonymous
Not applicable
Hi !

I've been recently tasked with the construction of a written report created programatically from data in the Archicad API.

As I've went through the doors and windows export, I've also been asked to export graphical data, such as what is available in here :
Ideally, if I could export them to a standard image format (jpg, png), that would solve my problem.

I've been digging around in the API_WindowType to see if I could find relevant data, but all I could find was some "pen data" in API_OpeningBase, that I don't know how to make use of.
I also digged around a bit in GDL documentation, but it looks like it is used to create new objects from scripting, not to export graphical data of already existing elements.

Can someone help me out on this ?
Thanks !
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
Hi again !

I experimented a bit around with ACAPI_Element_ShapePrims, but as noted in ACAPI_Librpart_shapeprims, the 2D data you receive using this is the floor, "view from above" representation of the element.

So I tinkered around, found ACAPI_Element_Get3D, and had other, more pressing work to do, so I couldn't really experiment too much and try to draw the 3D representation myself.

But, I got reaaally lucky while rummaging around in the DG_Test example : as I was experimenting around, I found ACAPI_​Element_​GetVisualOverriddenImage in the DG_Test example !

The representation given by this function is exactly what I needed, so i'll be attaching a picture of what an extracted image looks like for future reference.

Consider this solved !

View solution in original post

4 REPLIES 4
Ralph Wessel
Mentor
The 2D/3D rendering of GDL objects is dynamically generated on demand and varies according to parameter values and model view options etc. Therefore, there is no static image embedded in the object (apart from the object icon).

You can ask ARCHICAD to break down the illustration of an element into 2D primitives with ACAPI_Element_ShapePrims – that could be the basis for rendering an image to export.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Nice, I couldn't find this when I was searching, but after reading a bit about it, it looks like I can do something with it.
I'll come back to this thread once a huge problem arises / I've finished this, I'll probably make something to draw the primitives in a .png, so I probably will dump it here once it is done

Thanks for your help !
Solution
Anonymous
Not applicable
Hi again !

I experimented a bit around with ACAPI_Element_ShapePrims, but as noted in ACAPI_Librpart_shapeprims, the 2D data you receive using this is the floor, "view from above" representation of the element.

So I tinkered around, found ACAPI_Element_Get3D, and had other, more pressing work to do, so I couldn't really experiment too much and try to draw the 3D representation myself.

But, I got reaaally lucky while rummaging around in the DG_Test example : as I was experimenting around, I found ACAPI_​Element_​GetVisualOverriddenImage in the DG_Test example !

The representation given by this function is exactly what I needed, so i'll be attaching a picture of what an extracted image looks like for future reference.

Consider this solved !
Akos Somorjai
Graphisoft
Graphisoft
Yes, that's exactly the function I would recommend; it saves your from all the hassle

Best, Akos