BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

How to get drawings from layout / How to change drawings size

ARN
Newcomer
Hi,

Does anybody know how to get drawings from layout and how to change drawings size?

Here's my code:

API_DatabaseUnId *dbases = NULL;
API_DatabaseInfo dbLayoutBook;
OSErr err;
Int32 nDbases = 0;

if(ACAPI_database(APIDb_GetLayoutDatabasesID, &dbases, NULL) == noErr)
{
nDbases = BMpGetSize(reinterpret_cast<GSPtr>(dbases))/sizeof(API_DatabaseUnId);
for(Int32 ii = 0; ii < Dbases; ++ii)
{
BnZeroMemory(&dbLayoutBook, sizeof(API_DatabaseInfo));
dbLayoutBook.typeID = APIWind_LayoutID;
dbLayoutBook.databaseUnId = dbases[ii];
if(ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &dbLayoutBook, NULL) == noErr)
// FIRST PART: NOW HOW TO GET DRAWINGS THAT BELONGS THIS LAYOUT?

// SECOND PART: HOW TO CHANGE IT'S DRAWING(S) (Layout is now in 'hand' (dbases), includind it's size etc.). I mean drawing's size and origo should now set to fit in layout
??
}
}
if(dbases != NULL)
BMpFree(reinterpret_cast<GSPtr>(dbases));
}

The problem is that drawing is bigger than layout and the drawing should fix to the right size (and also position relative to layout)

What I miss now??

BR
Ari
2 REPLIES 2
Anonymous
Not applicable
Hey

Check this thread:
https://archicad-talk.graphisoft.com/viewtopic.php?f=23&t=62853&hilit=Navigator+items+especially+lay...

I can tell you that you need to change element.drawing.ratio but the bounds won’t change to fit the new size and you’ll have to click “update” to update the drawing’s bounds to its new size.
I am also looking for a solution for a way to change the bounds and not just the ratio.
ARN
Newcomer
Thank for your answer. I got the same result. Let's be in contact in future. BR Ari Räsänen
Learn and get certified!

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!