0

I am very new to mapbasic scripting. i am creating thematic map using mapbaic code. For that i am searching code for Page setup to set my map as landscape with A4 size. But i didn't found any code for it. does anyone knows it. if any link and resource material is there please reply me.

Thanks and Regards

2

Hello suyogpatwardhan,

Firstly, if you are new to MapBasic, I will suggest running MapInfo Professional and exposing the MapBasic script window under the options menu. Do some basic work within that session and it will write the MapBasic code that is being executed to that window, its amazing what you can learn and copy and paste directly into your script using this method.

As for your specific question - All windows in MapInfo you can use the SetWindow command to control it's properties. Including Layouts.

You will need to get the window ID first - this is important as window IDs are dynamic integers and do and will change, so if you want your script to be robust set a variable and populate it each time.

The syntax for SetWindow is as follows;

Set Window window_id 
[ Position ( x, y ) [ Units paper_units ] ] 
[ Width win_width [ Units paper_units ] ] 
[ Height win_height [ Units paper_units ] ] 
[ Font... ] 
[ Enhanced { On | Off } ] 
[ Smooth [ Vector { None | Antialias} ] [ Text { None | Antialias} ]  
    [ Image { None | Low | High } ] ] 
[ Min | Max | Restore ]
[ Front ]
[ Title { new_title | Default } ] 
[ Help [ { File help_file | File Default | Off } [ Permanent ] ] 
    [ Contents ] [ ID context_ID ] [ { Show | Hide } ] 
[ Printer { Default | Name printer_name }
    [ Orientation { Portrait | Landscape } ]
    [ Copies number ]
    [ Papersize number ]
    [ Border { On | Off } ]
    [ TrueColor { On | Off } ]
    [ Dither { Halftone | ErrorDiffusion } ]
    [ Method { Device | Emf | PrintOsbm} ]
    [ Transparency 
        [ Raster { Device | ROP } ]
        [ Vector { Device | ROP }] ]
        [ Margins 
            [ Left d1 ] [ Right d2 ] [ Top d3 ] [ Bottom d4 ]
                Units paper_units ] } ]
    [ Export { Default |
    [ Border { On | Off } ]
    [ TrueColor { On | Off } ]
    [ Dither { Halftone | ErrorDiffusion } ]
    [ Transparency 
        [ Raster { Device | ROP } ]
        [ Vector { Device | ROP }] ] 
    [ Scale Patterns { On | Off } ]
    [ Antialiasing { On | Off } ] 
    [ Threshold threshold_value ]
    [ MaskSize size_value ]
    [ Filter filter_value ]
]
[ ScrollBars { On | Off } ] 
[ Autoscroll { On | Off } ] 
[ Parent HWND ] 
[ ReadOnly | Default Access ] 
[ Table table_name Rec record_number ] 
[ Show | Hide ] 
[ Smart Pan { On | Off } ]
[ SysMenuClose { On | Off } ]
[ Snap [ Mode { On | Off } ] [ Threshold { pixel_tolerance | Default }]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.