That said, I am trying to open a layout window, create a frame of a specific size, then call a map window that I rename higher in the code.
This script is generic so can be used with any maps with a grid layer; they are not always the same layer names or number of layers. I tried to do the process manually to get the code, but in layout designer, when I select "Add new map" and then choose the named map window, it looks like it recreates the map.
Is there a way to code MB to add the named window rather than have it do all the layers like a workspace file?
I'd like to do this.
Layout Designer
Set Coordsys Layout Units "in" Create Frame (0.184,0.1882) (16.8319,10.7396) Name "MapLayout"
Set Designer Frame Id 1 From Window 3174 Legends On
Map From GRID,GRID,GRID,RT_RG,MULTI
,SINGLE,USZIP,BGDEMOPD,BingHybrid,BingRoads
Width 7.875 Units "in" Height 9.22917 Units "in" Floating
Pen (1,2,0) Into Window 3200 Id 1
Set Window WindowID(0) Front
Set Window FrontWindow() ScrollBars Off Autoscroll On Enhanced On Smooth Text Antialias Image High Vector None
Set Map Redraw Off
Set Map
CoordSys Earth Projection 10, 157, "m", 0
Center (-13663649.24,4646610.635)
Zoom 1.159692678 Units "mi"
Preserve Zoom Display Zoom
Distance Units "mi" Area Units "sq mi" XY Units "degree"
Set Map
Layer 1
Display Off
Global Pen (2,2,255) Brush (1,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line None Position Center Font ("Arial",1,8,0,16776960) Pen (1,2,0)
With MAP
Parallel On Auto On Overlap On Duplicates On PartialSegments On Offset 0
Visibility On
Layer 2
Display Global
Global Pen (2,2,255) Brush (1,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line None Position Center Font ("Arial",1,8,0,16776960) Pen (1,2,0)
With MAP
Parallel On Auto On Overlap On Duplicates On PartialSegments On Offset 0
Visibility On
Layer 3
Display Global
Global Pen (2,2,255) Brush (1,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line None Position Below Font ("Arial",1,8,16777215,16711680) Pen (1,2,0)
With QTY
Parallel On Auto On Overlap On Duplicates On PartialSegments On Offset 6
Visibility On
Layer 4
Display Global
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (34,65280,5) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line Arrow Position Right Font ("Arial",0,9,0) Pen (1,2,0)
With ADDRESS_ID
Parallel On Auto Off Overlap Off Duplicates On Offset 2
Visibility On
Layer 5
Display Global
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (31,16711680,7) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line Arrow Position Right Auto Retry On Font ("Arial",257,7,16711680,16777215) Pen (1,2,0)
With LABEL
Parallel On Auto On Overlap Off Duplicates On PartialSegments On Offset 2
Visibility Zoom (0, 10) Units "mi"
Layer 6
Display Off
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (32,255,7) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
Label Line Arrow Position Right Auto Retry On Font ("Arial",257,7,255,16777215) Pen (1,2,0)
With LABEL
Parallel On Auto On Overlap Off Duplicates On PartialSegments On Offset 2
Visibility Zoom (0, 10) Units "mi"
Layer 7
Display Off
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Label Line None Position Center Font ("Arial",0,9,0) Pen (1,2,0)
With CODE
Parallel On Auto Off Overlap Off Duplicates On Offset 2
Visibility On
Layer 8
Display Off
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Label Line None Position Center Font ("Arial",0,9,0) Pen (1,2,0)
With CODE
Parallel On Auto Off Overlap Off Duplicates On Offset 2
Visibility On
Layer 9
Display Global
Global Pen (1,2,16711935) Brush (15,13672703) Symbol (59,255,10) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
contrast 40
brightness 60
alpha 255
transparency off
color 0
grayscale on
Layer 10
Display Off
Global Pen (1,2,0) Brush (2,16777215,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
Selectable Off
contrast 50
brightness 50
alpha 255
transparency off
color 0
grayscale on
Set Map Layer 0 Editable
Set Map Redraw On
Set Window FrontWindow() Title "FullMap"
Set Window FrontWindow() Printer
Name "\\dc01\RicohC5200S" Orientation Landscape Copies 1
Papersize 17