summaryrefslogtreecommitdiff
path: root/app/lib/demos/dmgroup.xtr
blob: efc883d86396ba201466bad250865b696ffdcaf0 (plain)
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# XTrkCad Version: 3.0.1, Date: Wed Sep 20 22:05:35 2000

VERSION 10
DEMOINIT
PARAMETER display labelenable 1
ORIG 2.000 0.000 0.000
TURNOUT  6 0 0 0 0 DEMO 2 2.125000 2.281250 0 0.000000 "Peco-55	Medium Right	SL-E395F"
	E 2.125000 2.281250 270.000000
	E 7.530000 2.281250 90.000000
	E 7.495000 1.759250 99.686000
	D -0.108750 -0.832750
	P "Normal" 1 2
	P "Reverse" 1 3 4
	S 0 0.000000 0.000000 0.000000 0.353000 0.000000
	S 0 0.000000 0.353000 0.000000 5.405000 0.000000
	C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
	S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
	END
REDRAW
RESET
MESSAGE
The <Group> and <Ungroup> commands (on the Tools menu) are a powerful way to manipulate Turnout and Structure definitions.

We'll start with a simple turnout and add a switch machine.
END
STEP
COMMAND DrawLine
PARAMETER draw linewidth 0
PARAMETER draw linecolor 0
PARAMETER GROUP draw
PARAMETER draw linewidth 4
MOUSE 2 2.500 3.000
MOUSE 4 2.500 1.500
MOUSE 2 3.200 3.000
MOUSE 4 3.200 1.500
RESET
COMMAND DrawFilledBox
PARAMETER draw linecolor 0
PARAMETER GROUP draw
MOUSE 2 2.600 3.000
MOUSE 4 3.100 2.500
MOUSE 2 2.600 2.000
MOUSE 4 3.100 1.500
RESET
MESSAGE
_________________________________________

Now that we have drawn a rough outline of a switch machine we will group it with the turnout definition.

First we Select the objects in the new definition.
END
STEP
COMMAND Select
MOUSE 2 0.781 3.375
MOUSE 4 8.312 1.312
MESSAGE
_________________________________________

Now do the <Group> command.
END
STEP
PARAMETER misc cmdGroup
MESSAGE
_________________________________________

The <Group> command dialog shows the Title (Manufacturer, Description and Part Number) of the new definition.  This information is taken from the Selected objects you are grouping.
END
STEP
MESSAGE
_________________________________________

The 'Replace with new group?' toggle will replace the Selected objects with the new definition.
END
STEP
PARAMETER group replace 1
MESSAGE
_________________________________________

If we don't change the Title then the new definition will replace the existing definition.

We'll give this definition a new Description.
END
STEP
PARAMETER group desc M Medium Right
PARAMETER group desc Modi Medium Right
PARAMETER group desc Modified Medium Right
MESSAGE
_________________________________________

We're done with this definition.  Press Ok.
END
STEP
PARAMETER group ok
MESSAGE
_________________________________________

You will see the updated image on the HotBar.
END
STEP
CLEAR
MESSAGE
The <Ungroup> command replaces any Selected turnouts or structures with their parts.

Structures and non-track segements of turnouts are composed of Lines, Circles and other shapes.  In this turnout these are the two lines and the two squares.

We will Ungroup this turnout and see how the individual parts can be changed.

First Select the turnout and then Ungroup it.

END
STEP
MOUSE 2 7.156 2.094
MOUSE 4 7.156 2.094
PARAMETER misc cmdUngroup
MESSAGE
_________________________________________

Notice that the Title now indicates the turnout is Ungrouped.

Hit Escape to deselect everything.
END
STEP
MOUSE 6920 4.094 5.188
RESET
MESSAGE
_________________________________________

Now Select the lines and squares.
END
STEP
MOUSE 2 2.469 2.812
MOUSE 4 2.469 2.812
MOUSE 2 2.688 2.875
MOUSE 4 2.688 2.875
MOUSE 2 3.188 2.844
MOUSE 4 3.188 2.844
MOUSE 2 2.812 1.656
MOUSE 4 2.812 1.656
MESSAGE
_________________________________________

We could modify these object or add new ones.  For now we'll just delete them.
END
STEP
PARAMETER misc cmdDelete
MESSAGE
_________________________________________

And move the Label out of the way.
END
STEP
COMMAND MoveLabel
MOUSE 2 4.281 2.031
MOUSE 4 4.594 0.844
ORIG 3.000 0.000 0.000
ORIG 1.000 2.000 1.000
MESSAGE
_________________________________________

Notice that the turnout has been broken into three parts.
END
STEP
COMMAND Describe
MOUSE 2 4.531 2.219
MOUSE 4 4.531 2.219
BIGPAUSE
MOUSE 2 6.984 1.812
MOUSE 4 6.984 1.812
BIGPAUSE
MOUSE 2 2.359 2.266
MOUSE 4 2.359 2.266
BIGPAUSE
#DESCRIBE OK
PARAMETER describe ok
RESET
MESSAGE
_________________________________________

Two ends of the turnout, from the frog to the end of the diverging leg and from the points to the left, are now straight track sections.

The a turnout is made of a number of individual straight and curved track segements.  This turnout had four segments:
   1 a short straight segment to the left of the points
   2 a long straight segment to the right of the points
   3 a curved segment from the points to the frog
   4 a straight segment from the frog to the end of the diverging leg.
The first and last segments have be converted to straight tracks.
The second and third segments form the the body of the turnout and can not be ungrouped further.

You can later Group this turnout with the straight segments to recreate the turnout definition.  You can also add other track segments to turnout definitions.

END
STEP
KEYSTATE 2
MOUSE 2 4.625 1.969
KEYSTATE 2
MOUSE 4 4.625 1.969
PARAMETER misc cmdDelete
ORIG 3.000 0.000 0.000
CLEAR
MESSAGE
Now, create a track and place the new turnout on it.
END
STEP
COMMAND Straight
MOUSE 2 0.281 0.688
MOUSE 4 11.156 4.281
BIGPAUSE
COMMAND TurnoutHotBar
#PARAMETER turnout list 0 
PARAMETER GROUP turnout
HOTBARSELECT Peco-55	Modified Medium Right	SL-E395F
MOUSE 4 4.750 1.906
MOUSE 8200 4.750 1.906
MESSAGE
_________________________________________

Now suppose we want to replace the black squares with green circles.

First we Select the turnout.
END
STEP
COMMAND Select
MOUSE 2 6.062 2.906
MOUSE 4 6.062 2.906
MESSAGE
And now Ungroup it (from the Tools Menu)
END
STEP
PARAMETER misc cmdUngroup
MESSAGE
_________________________________________

Notice that the name has changed to indicate the turnout was Ungrouped.
END
STEP
MESSAGE
_________________________________________

Now, hit escape to deselect everything and then Select the 2 squares and delete them.
END
STEP
MOUSE 6920 6.062 2.906
RESET
BIGPAUSE
MOUSE 2 5.219 2.938
MOUSE 4 5.219 2.938
MOUSE 2 5.531 1.844
MOUSE 4 5.531 1.844
PARAMETER misc cmdDelete
MESSAGE
_________________________________________

Now draw the green circles...
END
STEP
ORIG 1.000 2.000 1.000
COMMAND DrawFilledCircleCenter
PARAMETER draw linecolor 0
PARAMETER GROUP draw
PARAMETER draw linecolor 65280
MOUSE 2 5.203 2.812
MOUSE 4 5.359 2.609
PARAMETER GROUP draw
MOUSE 2 5.516 1.891
MOUSE 4 5.672 1.719
PARAMETER GROUP draw
MESSAGE
and Group the new definition.
END
STEP
ORIG 2.000 0.000 0.000
RESET
COMMAND Select
MOUSE 2 3.719 4.156
MOUSE 4 10.531 0.969
BIGPAUSE
PARAMETER misc cmdGroup
PARAMETER group replace 1
BIGPAUSE
PARAMETER group ok
MESSAGE
_________________________________________

Notice that the turnout in the HotBar is angled the same as the turnout on the layout.  Make sure your new definition is rotated the way you want it.
END
STEP
KEYSTATE 2
MOUSE 2 5.000 2.188
KEYSTATE 2
MOUSE 4 5.000 2.188
PARAMETER misc cmdDelete
CLEAR
RESET
MESSAGE
We can also create turnouts from simple straight and curved tracks.

We'll create two tracks that have a common End-Point.
END
STEP
COMMAND Straight
MOUSE 2 2.000 2.000
MOUSE 4 10.000 2.000
COMMAND CurveEndPt
MOUSE 2 2.000 2.000
MOUSE 4 9.000 2.000
MOUSE 2 9.000 2.000
MOUSE 4 8.875 3.062
MESSAGE
_________________________________________

At this point we can modify the tracks if necessary.

We will use the <Describe> command to change the tracks.
END
STEP
COMMAND Describe
MOUSE 2 9.438 2.000
MOUSE 4 9.438 2.000
MESSAGE
_________________________________________

We'll make the Length 7.5".

If we change the Length, each End-Point will be moved to shorten the track.  We want to just move the Right End-Point.  To control this, change the Pivot to First which means the Left End-Point will be unchanged when we change the length (or angle) of the track.
END
STEP
#DESCRIBE Pivot	0
PARAMETER describe P1 0
MESSAGE
_________________________________________

Now when change the Length only the Right End-Point will move.
END
STEP
#DESCRIBE Length	7.500
PARAMETER describe F7 7.500
#DESCRIBE OK
PARAMETER describe ok
RESET
MESSAGE
_________________________________________

Now let's look at the curved track.
END
STEP
COMMAND Describe
MOUSE 2 7.688 2.625
MOUSE 4 7.688 2.625
MESSAGE
_________________________________________

Here the Left End-Point (which we don't want to move) is the Second End-Point, so we'll make that the Pivot.
END
STEP
#DESCRIBE Pivot	2
PARAMETER describe P1 2
MESSAGE
_________________________________________

We want the curve to have a radius of 20" and an angle of 17.5°.
First change the Radius...
END
STEP
#DESCRIBE Radius	20.000
PARAMETER describe F9 20.000000
MESSAGE
and the the Angular Length.
END
STEP
PARAMETER describe F11 17.5
BIGPAUSE
#DESCRIBE OK
PARAMETER describe ok
MESSAGE
_________________________________________

Now Select both tracks...
END
STEP
COMMAND Select
MOUSE 2 7.500 2.750
MOUSE 4 7.500 2.750
MOUSE 2 8.000 2.000
MOUSE 4 8.000 2.000
MESSAGE
and Group them.
END
PARAMETER group manuf 
PARAMETER group desc 
PARAMETER group partno 
STEP
PARAMETER misc cmdGroup
PARAMETER group manuf Custom
PARAMETER group desc Left
PARAMETER group partno 99-L
MESSAGE
_________________________________________

If the two tracks have a common End-Point then they will form a Turnout and can be switched with the <Train> command.  Otherwise they will just be two track segments grouped together.
END
STEP
PARAMETER group ok
MESSAGE
_________________________________________

We have created a left hand turnout and we also want a right hand version.

We'll use the <Flip> command.
END
STEP
COMMAND Select
MOUSE 2 7.812 2.250
MOUSE 4 7.812 2.250
COMMAND Flip
MESSAGE
_________________________________________

Drag a horizontal line that will be the mirror for the <Flip> command.
END
STEP
MOUSE 2 1.438 1.938
MOUSE 4 11.625 1.938
MESSAGE
_________________________________________

Notice the title has changed to Flipped Left.

Now Group the turnout.
END
STEP
PARAMETER misc cmdGroup
MESSAGE
_________________________________________

We'll change the Title and Part No for the new defintion.
END
STEP
PARAMETER group desc Right
PARAMETER group partno 99-
PARAMETER group partno 99-R
PARAMETER group replace 1
PARAMETER group ok
STEP
CLEAR
MESSAGE
To Remove the definitions, use the Custom Management dialog on the Tools menu.
END
STEP
PARAMETER misc cmdCustmgm
MESSAGE
_________________________________________

Select the definitions you added and Delete them.
END
STEP
PARAMETER custmgm inx 0 	Peco-55	DEMO	SL-E395F	Modified Medium Right
PARAMETER custmgm delete
PARAMETER custmgm inx 0 	Custom	DEMO	99-L	Left
PARAMETER custmgm delete
PARAMETER custmgm inx 0 	Custom	DEMO	99-R	Right
PARAMETER custmgm delete
PARAMETER custmgm ok
MESSAGE
=========================================
END
STEP
CLEAR