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.

Request the model coordinates of the bouniding box of a View

Anonymous
Not applicable
Hi I'm trying to make a drawing title that is used for the grid of a map. I wonder if I can get the world coordinates of the bounding box of the view of the drawing in layout. I'm trying to use AC_DrawingRect but I don't know if it will give me the desired results.
1 REPLY 1
Erenford
Booster
IIRC the 'AC_DrawingRect' refers to the drawing's size (or box or location) in the layout, not the view shown in the drawing.

You need to get the drawing's linked view in the View Map (as API_NavigatorItem). Once you got it use:
    GSErrCode ACAPI_Environment (
        APIEnv_GetNavigatorViewID,
        API_NavigatorItem*     navigatorItem,
        API_NavigatorView*     navigatorView
    );
The var 'zoom' in the 'API_NavigatorView' holds the box/coordinates in model space.

As for getting the drawing's linked view... Well I haven't tried getting it but I'm guessing it's in the 'linkGuid' of 'API_DrawingLinkInfo'
    GSErrCode ACAPI_Database (
        APIDb_GetDrawingLinkID,
        const API_Guid*          guid,
        API_DrawingLinkInfo*     drawingLinkInfo
    );
Pass the Guid in the function APIEnv_GetNavigatorItemID then perform the first code above.
Archicad 25 5010 INT FULL
Archicad 26 5002 INT FULL
Visual Studio Professional 2019
Win 10 Pro 64-bit
Learn and get certified!