Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Request the model coordinates of the bouniding box of a View

ispyridis
Newcomer
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.
Archicad 12-21 win10 64 Intel 3.00 ghz 16gb
1 REPLY 1

Erenford
Newcomer
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 3002 INT FULL
Archicad 24 6004 INT FULL
Visual Studio Professional 2019
Win 10 Pro 64-bit (10.0 build 19043)
Intel Core i7-4790 CPU @3.60GHz

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!