forked from thermburglar/mapbasic-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWSpace v3.mb
452 lines (403 loc) · 11 KB
/
WSpace v3.mb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
'*******************************************************************************************************************************
'* Program: WSpace.mb
'* Purpose:
'* Changes made March 20, 2007 (Erin Comparri)
'* Changed "In/Out" Value to "Non-Sacred Store"
'* Added category for "Approved Store" in Final Plan Map
'* Altered symbols for market points to increase readability in b/w
'*******************************************************************************************************************************
Declare Sub WkSpace
Declare Sub CloseMultipleWindows
Global MapID as Integer
Global str_type as String
Global str_user,str_Market as String
Global LegendID,LayoutPortraitID,LayoutLandscapeID,LogoID as Integer
Global i_Layer as SmallInt
'*******************************************************************************************************************************
'* Sub: WkSpace
'* Purpose: Open hard-coded workspace.
'* Changed 29 March 2007 to utilize premade basemaps so cosmetic changes can be made more easily.
'*******************************************************************************************************************************
Sub WkSpace
'Set Event Processing Off
If i_Layer = 1 Then
Run Application "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Code\MSA_Basemap.WOR"
ElseIf i_Layer = 2 Then
Open Table "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\USA\Region\2004\2004 USA MSA.TAB" As CBSA Interactive
Else
Open Table "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\USA\Region\2004\2004 USA STATES.tab" As CBSA Interactive
End if
MapID = WindowID(FrontWindow())
Open Table "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Data\Points\" + str_user + " " + str_Market + ".TAB" As MarketPlan Interactive
If str_type = "Final" Then
Select * From MarketPlan Where MarketPlan.Type = "Final" Into MarketPlanPoints
Commit Table MarketPlanPoints As "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Data\Points\" + str_user + " Final " + str_Market + ".TAB"
Close table MarketPlanPoints
Open Table "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Data\Points\" + str_user + " Final " + str_Market + ".TAB" as MarketPlanPoints Interactive
add map window mapID layer MarketPlanPoints
set map window mapID
layer MarketPlanPoints
Display Graphic
Global Symbol (35,0,12)
Zoom (0, 500) Units "mi"
Label Line None Position Right Font ("Arial",769,12,255,16777215) Pen (1,2,0)
With Name
Parallel On Auto On Overlap On Duplicates On Offset 10
Visibility On
shade 1 with Classification values
"" Symbol (34,16711680,12) ,
"Closed Store" Symbol (114,16711680,22,"Webdings",16,0) ,
"Future Opportunity" Symbol (59,24576,24) ,
"Open Store" Symbol (34,12583008,22) ,
"Open Void" Symbol (35,16776960,30) ,
"Approved Store" Symbol (36,255,22)
default Symbol (40,0,12) '# color 1 #
ElseIf str_type = "Draft" Then
Select * From MarketPlan Where MarketPlan.Type = "Draft" Into MarketPlanPoints
Commit Table MarketPlanPoints As "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Data\Points\" + str_user + " Draft " + str_Market + ".TAB"
Close table MarketPlanPoints
Open Table "G:\REMap\GIS Users\GIS Tool Development\GIS Data Dictionary\Workspaces\Market Plan\Data\Points\" + str_user + " Draft " + str_Market + ".TAB" as MarketPlanPoints Interactive
add map window mapID layer MarketPlanPoints
set map window mapID
layer MarketPlanPoints
Display Graphic
Global Symbol (35,0,12)
Zoom (0, 500) Units "mi"
Label Line None Position Right Font ("Arial",769,12,255,16777215) Pen (1,2,0)
With Name
Parallel On Auto On Overlap On Duplicates On Offset 10
Visibility On
shade 1 with Classification values
"" Symbol (34,16711680,12),
"Approved Store" Symbol (36,255,22) ,
"Hit List Void" Symbol (35,32768,30) ,
"Non-Sacred Store" Symbol (50,16760832,20,"MapInfo Transportation",16,0) ,
"Opt Void" Symbol (34,9474303,20) ,
"Sacred Cow" Symbol (60,16711680,22,"MapInfo Cartographic",16,0)
default Symbol (40,0,12) '# color 1 #
End if
set legend
layer 1
display on
shades off
symbols on
lines off
count off
title "Final Classification" Font ("Arial",1,9,0)
subtitle auto Font ("Arial",0,8,0)
ascending on
ranges Font ("Arial",0,8,0)
auto display off ,
auto display off ,
auto display on ,
auto display on ,
auto display on ,
auto display on
Dim WorkspaceMaximizedWindow As Integer
WorkspaceMaximizedWindow = Frontwindow()
Create Cartographic Legend
Position (7.58333,0.208333) Units "in"
Width 2.27083 Units "in" Height 2.30208 Units "in"
Window Title "Market Plan Legend"
Custom
Frame From Layer 1
Position (29.8229,270.334) Units "in"
Border Pen (0,1,0)
Set Window FrontWindow() Min
Set Window FrontWindow() Title "Market Plan Legend"
Map From store_logo
Position (0.46875,0.53125) Units "in"
Width 5.29167 Units "in" Height 3.10417 Units "in" Min
Set Window FrontWindow() ScrollBars Off Autoscroll On
Set Map
CoordSys NonEarth Units "ft"
Center (277.5,-94.5)
Zoom 555 Units "ft"
Preserve Zoom Display Zoom
Distance Units "ft" Area Units "sq ft" XY Units "ft"
Distance Type Cartesian
Set Map
Layer 1
Display Graphic
Global Symbol (35,0,12)
Selectable Off
Zoom (25, 10000) Units "ft"
contrast 50
brightness 50
alpha 255
transparency on
color 0
grayscale off
Set Window FrontWindow() Min
Set Window FrontWindow() Title "Logo"
'Set Window WorkspaceMaximizedWindow Max
'Set Window FrontWindow() Printer
' Name "\\sbp02w\SBC054" Orientation Portrait Copies 1
' Papersize 1
Layout
Position (3.69792,0.677083) Units "in"
Width 6.44792 Units "in" Height 4.84375 Units "in" Min
Set CoordSys Layout Units "in"
Create Frame (0.3792,0.6403) (8.1208,10.3972)
Pen (3,2,0)
Brush (2,16777215,16777215)
Title "Banana Republic Market Plan"
FillFrame On
Create Frame (6.4639,-0.0201) (8.084,0.6771)
Pen (1,1,0)
Brush (1,16777215,16777215)
Title "Logo"
FillFrame On
Create Text
"Title Goes Here"
(0.3417,0.2639) (2.3778,0.5833)
Font ("Arial",1,20,0)
Create Frame (0.3806,8.4354) (2.1694,10.3944)
Pen (3,2,0)
Brush (2,16777215,16777215)
Title "Market Plan Legend"
FillFrame Off
Create Region 5
4
(7.8549,10.0875)
(7.8083,10.1257)
(8.091,10.1257)
(7.8549,10.0875)
4
(7.5257,10.1257)
(7.7618,10.1639)
(7.8083,10.1257)
(7.5257,10.1257)
4
(7.8549,10.1639)
(7.8083,10.1257)
(7.8083,10.3576)
(7.8549,10.1639)
4
(7.7618,10.0875)
(7.8083,10.1257)
(7.8083,9.8938)
(7.7618,10.0875)
42
(7.7549,9.8701)
(7.7931,9.8701)
(7.7931,9.8681)
(7.7882,9.8681)
(7.7847,9.8674)
(7.7813,9.866)
(7.7792,9.8639)
(7.7771,9.8604)
(7.7764,9.8576)
(7.7764,9.7986)
(7.8479,9.8715)
(7.8507,9.8715)
(7.8507,9.7951)
(7.8514,9.7903)
(7.8535,9.7882)
(7.8549,9.7868)
(7.859,9.7847)
(7.8646,9.7847)
(7.8646,9.7826)
(7.8299,9.7826)
(7.8299,9.7847)
(7.8368,9.7847)
(7.8403,9.7868)
(7.8424,9.7882)
(7.8444,9.7917)
(7.8451,9.7958)
(7.8451,9.8368)
(7.7924,9.7826)
(7.7549,9.7826)
(7.7549,9.7847)
(7.759,9.7847)
(7.7632,9.7861)
(7.7667,9.7889)
(7.7708,9.7931)
(7.7708,9.8576)
(7.7701,9.8611)
(7.7681,9.8639)
(7.766,9.866)
(7.7625,9.8674)
(7.7576,9.8681)
(7.7549,9.8681)
(7.7549,9.8701)
Pen (1,2,0)
Brush (2,0,16777215)
Center (7.9493,10.1062)
Create Collection 2
Region 4
4
(8.091,10.1257)
(7.8083,10.1257)
(7.8549,10.1639)
(8.091,10.1257)
4
(7.5257,10.1257)
(7.8083,10.1257)
(7.7618,10.0875)
(7.5257,10.1257)
4
(7.8083,10.1257)
(7.7618,10.1639)
(7.8083,10.3576)
(7.8083,10.1257)
4
(7.8083,9.8938)
(7.8083,10.1257)
(7.8549,10.0875)
(7.8083,9.8938)
Pen (1,2,0)
Brush (2,16777215,16777215)
Center (7.9493,10.1444)
Pline 42
(7.7549,9.8701)
(7.7931,9.8701)
(7.7931,9.8681)
(7.7882,9.8681)
(7.7847,9.8674)
(7.7813,9.866)
(7.7792,9.8639)
(7.7771,9.8604)
(7.7764,9.8576)
(7.7764,9.7986)
(7.8479,9.8715)
(7.8507,9.8715)
(7.8507,9.7951)
(7.8514,9.7903)
(7.8535,9.7882)
(7.8549,9.7868)
(7.859,9.7847)
(7.8646,9.7847)
(7.8646,9.7826)
(7.8299,9.7826)
(7.8299,9.7847)
(7.8368,9.7847)
(7.8403,9.7868)
(7.8424,9.7882)
(7.8444,9.7917)
(7.8451,9.7958)
(7.8451,9.8368)
(7.7924,9.7826)
(7.7549,9.7826)
(7.7549,9.7847)
(7.759,9.7847)
(7.7632,9.7861)
(7.7667,9.7889)
(7.7708,9.7931)
(7.7708,9.8576)
(7.7701,9.8611)
(7.7681,9.8639)
(7.766,9.866)
(7.7625,9.8674)
(7.7576,9.8681)
(7.7549,9.8681)
(7.7549,9.8701)
Pen (1,2,0)
Set Layout Ruler On Pagebreaks On Frame Contents Active
Zoom 110.606 Center (4.6387,2.62991) Extents To Fit
Set Window FrontWindow() Autoscroll On
Set CoordSys Earth
Set Window FrontWindow() Title "Print Portrait"
Set Window FrontWindow() Min
'Set Window WorkspaceMaximizedWindow Max
'Set Window FrontWindow() Printer
' Name "Adobe PDF" Orientation Portrait Copies 1
' Papersize 1
Layout
Position (4.25,1.33333) Units "in"
Width 6.07292 Units "in" Height 4.375 Units "in" Min
Set CoordSys Layout Units "in"
Create Frame (0.4938,0.8486) (10.5062,7.9271)
Pen (3,2,0)
Brush (2,16777215,16777215)
Title "Old Navy Market Plan"
FillFrame On
Create Frame (8.9583,0.1271) (10.484,0.975)
Pen (1,1,0)
Brush (1,16777215,16777215)
Title "Logo"
FillFrame On
Create Text
"Title Goes Here"
(0.4847,0.4361) (2.5208,0.7556)
Font ("Arial",1,20,0)
Create Frame (0.4958,5.9743) (2.2847,7.9333)
Pen (3,2,0)
Brush (2,16777215,16777215)
Title "Market Plan Legend"
FillFrame Off
Create Region 5
4
(9.8118,7.616)
(10.0729,7.659)
(10.1243,7.616)
(9.8118,7.616)
4
(10.0722,7.5736)
(10.1243,7.616)
(10.1243,7.3576)
(10.0722,7.5736)
4
(10.1757,7.659)
(10.1243,7.616)
(10.1243,7.875)
(10.1757,7.659)
4
(10.1757,7.5736)
(10.1243,7.616)
(10.4368,7.616)
(10.1757,7.5736)
42
(10.0639,7.3292)
(10.1062,7.3292)
(10.1062,7.3271)
(10.1014,7.3271)
(10.0972,7.3264)
(10.0931,7.3243)
(10.091,7.3222)
(10.0882,7.3187)
(10.0875,7.3153)
(10.0875,7.2493)
(10.1674,7.3313)
(10.1701,7.3313)
(10.1701,7.2451)
(10.1715,7.2396)
(10.1729,7.2375)
(10.175,7.2354)
(10.1799,7.234)
(10.1854,7.2333)
(10.1854,7.2313)
(10.1465,7.2313)
(10.1465,7.2333)
(10.1542,7.234)
(10.1583,7.2361)
(10.1611,7.2375)
(10.1625,7.2417)
(10.1639,7.2458)
(10.1639,7.2917)
(10.1056,7.2313)
(10.0639,7.2313)
(10.0639,7.2333)
(10.0687,7.234)
(10.0729,7.2347)
(10.0771,7.2382)
(10.0813,7.2431)
(10.0813,7.3153)
(10.0806,7.3194)
(10.0785,7.3229)
(10.0764,7.3243)
(10.0722,7.3264)
(10.0667,7.3271)
(10.0639,7.3271)
(10.0639,7.3292)
Pen (1,2,0)
Brush (2,0,16777215)
Center (9.9681,7.6375)
Set Layout Ruler On Pagebreaks On Frame Contents Active
Zoom 110 Center (4.66004,2.64299) Extents To Fit
Set Window FrontWindow() Autoscroll On
Set CoordSys Earth
Set Window FrontWindow() Title "Print Landscape"
Set Window FrontWindow() Min
Set Window WorkspaceMaximizedWindow Max
End Sub