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

Can’t change the size of the drawing..

Anonymous
Not applicable
Hello,

I am trying to change the size of my drawing. I am accessing the element’s bounds, (element.drawing.bounds) changing it and it doesn’t work..

I can change the name or position but bounds changes nothing..

Thanks in advance
4 REPLIES 4
Ralph Wessel
Mentor
Tomer1 wrote:
I am trying to change the size of my drawing. I am accessing the element’s bounds, (element.drawing.bounds) changing it and it doesn’t work..
Do you want to crop the drawing to a specified bounding box or change the sizing ratio of the drawing?
Ralph Wessel BArch
Anonymous
Not applicable
I want to change the ratio, not to crop.. I guess that i miss some more properties that needs to be changed in order for this to work
Erenford
Booster
Tomer1 wrote:
I want to change the ratio, not to crop.. I guess that i miss some more properties that needs to be changed in order for this to work
If you want to change the scale, change API_DrawingType::ratio (Magnification on Dialog). Note that the value is based on API_DrawingType::drawingScale (Original Scale on Dialog).
[API_DrawingType::ratio] = [API_DrawingType::drawingScale] / [your new Drawing Scale];
Ex.
If you want to change your 1:100 drawing to 1:200, you set ratio = 0.50. (50% on Dialog) // ratio = 100 / 200
For 1:100 -> 1:50, ratio = 2.0. (200% on Dialog) // ratio = 100 / 50
Archicad 25 5010 INT FULL
Archicad 26 5002 INT FULL
Visual Studio Professional 2019
Win 10 Pro 64-bit
Anonymous
Not applicable
Thanks!
So I am able to change the ratio, but I want it to change to fit the grid cell. Do I need to change the bounds parameter?

Edit:
It seems that what I need to change is the bounds, but I can’t get it to be done in the actual drawing, just the variable. I am applying the changes with acapi_element_change (using a mask and memo) and the bounds aren’t changing on the drawing itself.. Thanks in advance.

Edit 2:
I have noticed that after changing the ratio the layout is “dead”. It doesn’t update anymore (even if I set manualupdate to false on the code and even if switching back to manual update and then again to auto).
It also doesn’t fit frame to drawing until I change it to manual resize and back to auto fit.
This is all in addition to my problem in edit 1, where the bounds aren’t changed on the actual draw.

I’m using ARCHICAD 21 update 7000..

Thanks

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!