Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    Determining the working map width can be a bit tricky but sometimes it's needed for scaling purposes. The software does it by finding the innermost entities on the MAP BORDER layer (right?) but there seems to be no macro command to do this. Fortunately I found a workaround that works for me. GETSHEETX vMapWidth;BACKGROUND The "BACKGROUND" sheet typically has no entities that extend beyond the map's working area. The height of the map can (if needed) be similarly determined using the GETSHEETY command. I hope someone finds this useful.
    • CommentTimeMay 7th 2019 edited
    The general way in the software use to check the extent of the complete set of visible entities on all visible sheets/layers, it doesn't check a particular layer.

    This is basically why the GETSHEET(X/Y) commands came about, just to allow you to check on a more specific sheet, just for this purpose (avoiding things beyond the map border.)

    You also have the GETLAYERX/GETLAYERY commands for layers.

    There are more information about these here.
    I originally tried to use the GETLAYERX command with the MAP BORDER layer but unfortunately some templates use that layer for decorative borders outside the working area and even hiding the MAP BORDER sheet didn't stop the extent commands from picking them up. Which is why I'm lobbying for GETBORDER_ commands to get the internal dimensions of the map that the program uses sometimes to scale things. (Or maybe it doesn't and nobody has noticed? ;) )

    It occurred to me that knowing where the map boundaries are may be important to many macro writers so perhaps this code could be included in the OnOpenMacro note of new templates.

    getsheetl mapxy1;BACKGROUND
    getx mapx1 mapxy1
    gety mapy1 mapxy1
    getsheeth mapxy2;BACKGROUND
    getx mapx2 mapxy2
    gety mapy2 mapxy2
    getsheetx mapWidth;BACKGROUND
    getsheety mapHeight;BACKGROUND

    You may note I like using the OnOpenMacro note for a lot of preprocessing issues, not just setting up symbols and menus. (See my QUESTIONS: OnXxxxMacro Map Notes discussion for details.)