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

drawing scale [SOLVED]

ReignBough
Enthusiast
I am trying to add drawing using the API. I am able to do so but the scale of the drawing done with the API is not the same as manually doing it (drag-drop). (See attached image file.)

The first image (above) is done manually while the second image (below) is done using ACAPI_Element_Create() function.

I have already tried modifying the ratio value of the drawing element but it just zoomed the second image instead.

Capture.PNG
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
3 REPLIES 3
ReignBough
Enthusiast
It seems like the API-generated drawing's scale is based on the original floor plan scale.

The attached picture is a screenshot of the lower-right of the floor plan and the same API-generated drawing. They are of the same scale.

Now, how to set this API-generated drawing to the same scale as the first post (the detail's scale) is still unknown [to me, at least].

EDIT
Is there a way to set the API_DrawingType.drawingScale (Drawing Scale in Properties) and/or API_DrawingType.parentOriginalScale (Original Scale in Properties) before creating the drawing element (ACAPI_Element_Create())?
Capture.PNG
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ReignBough
Enthusiast
I figured it out.

What I initially have done was create a drawing element using an item's GUID from Project Map (API_ProjectMap).

It is supposed to be from View Map (API_PublicViewMap).
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Laszlo Nagy
Community Admin
Community Admin
I don't know the API, I am not a programmer, but the View Map makes sense as it stores the scale, while the Project Map always works with the currently active scale, which can give unintended results.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28