Notes


This definition of file contents was updated to the V5 Beta level.

Scale Definition


All scale definitions are listed in the file xtrkcad.xtq. This file can be found in /usr/local/lib/xtrkcad on a LINUX system and
in the XTrkCad installation directory on Windows.

The SCALE definition looks like:
SCALE O, 48.0, 1.1770
	  1536,24,960
	  2016,30,1200
	  2592,36,1440

O
is the name of the scale,
48.0
is the ratio and
1.1770
is the track gauge in inches.
Easement
The next 3 line define the R, X, and L values for Sharp, Normal and Broad easement curves. These figures are listed in prototype inches. You can copy these from another scale which close to the desired scale. The exact values are not critical.

Layout file Header

These lines start a Layout file (*.xtc)

#XTrackCAD<sp>Version:<sp>Version-Number<sp>Date:<sp>Time-and-Date
VERSION<sp>Parameter-Version<sp>Paramversionversion
These are set by Cmake when XtrkCAD is being built
TITLE1<sp>TitleText
TITLE2<sp>TitleText2
MAPSCALE<sp>map-scale
ROOMSIZE<sp>width<sp>x<sp>depth
SCALE<sp>scale-name

LAYERS<sp>Layer-num<sp>visible<sp>0<sp>unlocked<sp>"Layer-Name"
Note - This is repeated for each defined layer
LAYERS<sp>CURRENT<sp>layer-number

For example
#XTrackCAD Version: 4.2.4a, Date: Sat Apr 22 17:11:15 2017

VERSION 10 3.0.0
TITLE1 Scarborough Model Railroad
TITLE2 N Layout
MAPSCALE 102
ROOMSIZE 420.000000 x 408.000000
SCALE N
LAYERS 0 1 0 1 255 0 0 0 0 "Table Edge"
LAYERS 1 1 0 1 32768 0 0 0 0 "Main Staging"
LAYERS 2 1 0 1 8388608 0 0 0 0 "Lower"
LAYERS 3 1 0 1 0 0 0 0 0 "Upper"
LAYERS 4 1 0 1 16711680 0 0 0 0 "Branch"
LAYERS 5 1 0 1 0 0 0 0 0 "free"
LAYERS 6 1 0 1 8388608 0 0 0 0 "Orange"
LAYERS 7 1 0 1 8388736 0 0 0 0 "Mountain"
LAYERS 8 1 0 1 8421376 0 0 0 0 "Feeders"
LAYERS 9 1 0 1 16384 0 0 0 0 ""
LAYERS 11 0 0 1 128 0 0 0 0 ""
LAYERS 12 0 0 1 32768 0 0 0 0 ""
LAYERS 13 0 0 1 16776960 0 0 0 0 ""
LAYERS 14 0 0 1 65280 0 0 0 0 ""
LAYERS 15 0 0 1 65535 0 0 0 0 ""
LAYERS 16 0 0 1 8388608 0 0 0 0 ""
LAYERS 17 0 0 1 8388736 0 0 0 0 ""
LAYERS CURRENT 8


Graphic Elements


There are element definitions (subject to change):

STRAIGHTis a straight track segment
CURVEis a curved track segment
BEZIERis a curved track segment that is described by a Bezier function
BZRLINis a line defined by a Bezier function
JOINTis a join element between two tracks
CORNUis a join element between tracks that uses a Cornu curve
NOTEis a Note Text String
BLOCKa track block
CONTROLa control element
SENSORa sensor element
SIGNALa signal element
SWITCHMOTORA motor that controls a turnout
TURNTABLEa turntable

There are elements that are attached to these track elements

Eare the elements unconnected End-Points
Tare the elements connected End-Points
Ddescription

There are also compound objects as follows

DRAWis a drawing element (lines, etc)
TURNOUTA set of track segments that describe a turnout
STRUCTUREA group of line segments that define a structure


There are segment definitions that appear inside other elements (subject to change):

SStraight track segment
CCurved Track segment
LStraight line segment
ACurved line segment
JJoint track segment
GFilled circle segment
YPoly segment
FFilled poly segment
ZText Segment
Uthis is the information entered on the turnout designer dialog for this definition
Pdefine the Paths through the turnout, the numbers specify the track segments, numbered from 1
Xspecial segment
Qdefines a table-edge line
Bdefines a benchwork line
Mdefines a dimensions line
Wdefines a Bezier Track Segment
Hdefines a Bezier Line segment


Track and Line Objects Details


Common Definitions
Let's get some basics out of the way.


Because curves are always described with clockwise angles, if a curve is needed inside a compound shape that is counter-clockwise the radius will be negative. Note that compound shapes are usually defined left to right and top to bottom and can be offset and rotated as a unit. This reduces the need for counter clockwise elements. This means that negative radii are very useful in Bezier segments.

Track and other Objects

STRAIGHT<sp>index<sp>layer<sp>line-width<sp>0<sp>0<sp>scale<sp>visibility
Then two end points (E or T)
END

The straight track parameter for track objects only. Defines a straight segment of track. Generally for track objects the color and line width are defaulted to 0 for color and 0 for line width. Visibility is the second bit - so hidden = 0, visible = 2.
After this definition there are two end points defined either as E (unconnected) or T (connected).

Note line-width is from 0-255.

For an example: a line define from left to right for 6" starting at 0,0 and connected at 6,0 to Track 2 with no elevation definitions would be as shown below.
	STRAIGHT 1 1 0 0 0 OO 2 0.000000 0.000000 
		E4 0.00000 0.000000 90.000000
		T4 2 6.000000 0.000000 270.000000

CURVE<sp>index<sp>layer<sp>line-width<sp>0<sp>0<sp>scale<sp>visibility<sp>center-X<sp>center-Y<sp>0<sp>radius<sp>helix-turns<sp>desc-X<sp>desc-Y
Then two end points (E or T)
END

The curve track parameter for track objects only. Defines a curved segment of track. X,Y define the center point of the radius, Generally for track object the color and line width are defaulted to 0 for color and 0 for line width.

This is then followed by two end-points which are either E (unconnected) or T (connected).

Note line-width is from 0-127. If the field is 128 or larger, the track label is shown for a normal curve. For a helix, conversely, the label will be shown if <128 and not shown if greater.

For an example:
a curve define from left to right starting at 6,0 and swing up clock-wise by 90 degrees for 12" radius with no elevation definitions would be as shown below.
	CURVE 2 1 0 0 0 OO 2 0.000000 12.000000 0 12.000000 0 0.000000 0.000000
		E4 18.000000 12.000000 0.000000
		T4 1 6.000000 0.000000 90.000000


JOINT<sp>index<sp>layer<sp>width<sp>0<sp>0
<sp>scale<sp>visible<sp>l0<sp>l1<sp>R<sp>L
<sp>flip<sp>negate<sp>S-curve<sp>x<sp>y<sp>0<sp>angle

Two end points (Both Ts as a JOINT must be connected)
END


NOTE<sp>index<sp>layer<sp>0<sp>0<sp>start-x<sp>start-y<sp>length
Text Line
...
<sp><sp><sp><sp>END

The Note is formatted as it is seen on the screen, with included line feeds and tabs. It is terminated by a line containing 4 blanks and "END"

BLOCK<sp>index<sp>name<sp>script
TRK<sp>include-trackindex
...
END

A block defines a set of XTrackCAD tracks that an external program (such as JMRI) will consider to be a single named unit. It also includes a script which normally refers to a sensor that will be triggered when the block is occupied.

CONTROL<sp>index<sp>layer<sp>scale<sp>visible<sp>start-x<sp>start-y<sp>name<sp>on-script<sp>off-script<sp>

A control defines an object that JMRI can control, its location and some arbitrary scripts that normally define how to turn it on and off

SENSOR<sp>index<sp>layer<sp>scale<sp>visible<sp>start-x<sp>start-y<sp>name

A sensor is something that an external program (such as JMRI) can know the state of. It has a position and a name.

SIGNAL<sp>index<sp>layer<sp>scale<sp>visible<sp>start-x<sp>start-y<sp>angle<sp>num-heads<sp>name
ASPECT<sp>aspect-name<sp>aspect-script
..
END

A signal defines a signal mast/post understood by JMRI. It may have a number heads and have multiple aspects. A head is an indicator (light, LED or semaphore) And aspect is a combined set of these set to indicate something to the driver. Each aspect can have an arbitrary script understood by JMRI.

SWITCHMOTOR<sp>index<sp>turnout-index<sp>normal<sp>reverse<sp>pointsense

A Switch motor defines a motor that can control a point. The fields normal, reverse and pointsense are arbitrary strings in XtrkackCAD but are expected to contain an address understood by JMRI of the motor(s) that move the point and an optional sensor.

TURNTABLE<sp>index<sp>layer<sp>0<sp>0<sp>0<sp>scale<sp>visible<sp>x<sp>y<sp>0<sp>radius<sp>current-ep
And then a set of E or T records
END


Additional Detail Definitions


The E and T (and E4 and T4) records share a set of definitions for elevation-type, visible and gap options



elev-type valuesMeaning
0None
1Defined
2Computed
3Grade
4Ignored (not used in computation)
5Station (a name)

The visible option is a binary value, if set to 0 the value is hidden.

the gap-option is a binary value for T records. Each end that is 1 establishes a gap for one rail (the LH rail when facing the gap), so if both are set both rails are gapped.

These three values are put into one field as shown below. The visible option is added as 8 or 0, the gap-option is added as 256 or 0. In the E4 and T4 records they are also recorded broken out as three seperate fields after the defined-elevation field.

As an example, a T or T4 defined elevation record which is visible with a gap would be 8+1+256 = 264 in the elev-option+visible*8+gap-option*256 field.


E4<sp>X-position<sp>Y-position<sp>Angle<sp>elev-option+visible*8+gap-option*256<sp>desc-x<sp>desc-y<sp>elevation-or-station-name<sp>defined-elevation<sp>visible<sp>evel-option<sp>gap-option<sp>computed-evel
The V4 Track End-point parameter for unconnected tracks. Defines the unconnected end-points of an object for each end-point there needs to be a entry.

All fields are always present - if the station name is not set and the elevation is undefined the elevation-or-station-name field reads as 0.0
STRAIGHT 5 0 0 0 0 HO 2
	E4 68.000000 24.000000 76.200515 10 0.000000 0.000000 0.0 0.0 1 2 0 0.000000 
	T4 6 60.345537 22.119956 256.200515 1 0.000000 0.000000 0.000000 0.000000 0 1 0 0.000000 
	END

In this case, the track is only connected at one end. That end will show a computed elevation label - no gaps are defined. The other connected end has no elevation type or gaps defined.

T4<sp>track-index<sp>X-position<sp>Y-position<sp>Angle<sp>elev-option+visible*8+gap-option*256<sp>desc-x<sp>desc-y<sp>elevation-or-name<sp>defined-elevation<sp>visible<sp>evel-option<sp>gap-option<sp>computed-evel

The V4 Track End-point parameter for joined track objects only. Defines the connected end-points of a track object, for each end-point there needs to be a entry.

All fields are always present - if the station name is not set and the elevation is undefined the elevation-or-station-name field reads as 0.0
STRAIGHT 4 0 0 0 0 HO 2
	T4 3 39.119448 16.906531 256.200515 269 -2.869448 -2.781531 "Jim and Fred" 0.0 1 5 1 0.403469 
	T4 1 50.453266 19.690276 76.200515 11 1.171734 -1.815276 0.0 0.0 1 3 0 0.403469 
	END

In this case, the connected track at both ends has a station definition at one end (called "Jim and Fred") which is offset as a description. It also has at least one block gap. At the other end there is a visible grade label displayed at the join. The track is flat because both ends have an identical computed elevation.

E4<sp>X-position<sp>Y-position<sp>Angle<sp>elev-option+visible*8+gap-option*256<sp>desc-x<sp>desc-y<sp>elevation-or-station-name
The Track End-point parameter for unconnected tracks. Defines the unconnected end-points of an object for each end-point there needs to be a entry.

The desc-x and -y fields and elevation-or-station-name fields are only present if there is a non-zero value for the elevation option (see below).
The elevation-or-name fields are only present if the elevation is defined as a value (1) or as a station name (5)

T4<sp>track-index<sp>X-position<sp>Y-position<sp>Angle<sp>elev-option+visible*8+gap-option*256<sp>desc-x<sp>desc-y<sp>elevation-or-name
The Track End-point parameter for joined track objects only. Defines the connected end-points of a track object, for each end-point there needs to be a entry.

The desc-x and -y fields and elevation-or-station-name fields are only present if the elev-option has a non-zero value.
The elevation-or-name field is only present if the elevation is defined as a value or as a station name (9,1 or 5 or 265, 257, or 260).
0None
1Defined and hidden (if shown will be 9, if hidden a 1)
2Computed and hidden (if shown will be 10, if hidden a 2)
3Grade (also computed) (if shown will be 11, if hidden a 3)
4Ignored (not used in computation) (if shown will be 12, if hidden 4)
5Station (a name) (if shown will be a 13, if hidden 5)
9Defined and shown
10Computed and shown
11Grade and shown
12Ignored and shown
13Station and shown


For a T record only, if there is a Block Gap type defined between this track and the next, 256 is added to the elev-option.The gap type (top, bottom, both) is defined by the presence of one or two of the connected T records for the joined track having a 256 set.

Elevation-or-name field - If the elev-option is Station, the elevation-or-name will be set to a name, if it is Defined, the elevation will be a number

Note - There is no prefered order to defining the end-points - because they are written out in the order that the track was defined starting with the first point added. This will correspond to the direction of the track (first to second) except for compounds which can be rotated and flipped and so are originally defined left to right.

D<sp>x<sp>y
The offset of the description for track

Compound Object Definitions


BEZIER<sp>index<sp>layer<sp>track-width<sp>color<sp>0.000000
<sp>scale<sp>visible<sp>X1<sp>Y1<sp>X2<sp>Y2
<sp>X3<sp>Y3<sp>X4<sp>Y4<sp>0<sp>desc-X<sp>desc-Y


Then two end points (E or T)

Then Inside the Bezier are a set of Curve Segment definitions

track-width is an integer from 0 is thin, 1 is medium, 2 is thick. This affects how the track is drawn. It is added to by the track label field, If the field is 128 or larger, the track label is shown..

BEZIER 6 0 0 0 0.000000 HO 2 42.000000 18.000000 48.750000 20.125000 59.375000 15.875000 66.000000 17.000000 0 0.000000 0.000000 
	E 42.000000 18.000000 252.525226
	E 66.000000 17.000000 80.362462
	C3 16711680 0.000000 16.835800 46.528590 1.784697 344.396080 19.477771
	C3 0 0.000000 65.722927 43.727987 -47.022809 3.435143 6.314718
	C3 0 0.000000 -101.781263 71.554878 118.153232 186.074628 3.367245
	C3 0 0.000000 -20.562674 63.171002 37.367138 172.092205 14.573946
	END

BZRLIN<sp>index<sp>layer<sp>0<sp>0<sp>line-width
<sp>scale<sp>visible<sp>X1<sp>Y1<sp>X2<sp>Y2
<sp>X3<sp>Y3<sp>X4<sp>Y4<sp>0<sp>desc-X<sp>desc-Y


Inside the BZRLIN are a set of A curved line segment records
BZRLIN 2 0 0 0 0.000000 HO 2 7.000000 11.000000 25.625000 17.875000 35.375000 16.875000 33.000000 13.000000 0 0.000000 0.000000 
	A3 0 0.000000 104.148703 43.604058 -86.504335 0 339.423385 7.055613
	A3 0 0.000000 42.504723 29.655774 -26.454475 0 345.834557 12.852734
	A3 0 0.000000 9.941335 28.926786 6.100771 0 358.589229 19.703146
	A3 0 0.000000 2.010337 31.469831 13.614051 0 16.685477 47.099725
	A3 0 0.000000 1.718451 31.621998 14.026734 0 73.941420 52.747979
	END


CORNU<sp>index<sp>layer<sp>width<sp>0<sp>0<sp>scale<sp>visible<sp>
pos1x<sp>pos1y<sp>angle1<sp>radius1<sp>center1x<sp>center1y<sp>
pos2x<sp>pos2y<sp>angle2<sp>radius2<sp>center2x<sp>center2y

Two end points

Note line-width is from 0-127.It is added to by the label field, if the field is 128 or larger, the track label is shown.
The a set of Bezier Track segments, each of which has a section starting SUBSEGS, 1 or more straight or curve segments, and ending SUBSEND

CORNU 28 0 0 0 0 OO 2 146.000000 58.000000 270.000000 0.000000 0.000000 0.000000 196.894263 34.350590 93.144957 0.000000 0.000000 0.000000 
	T 29 146.000000 58.000000 270.000000
	E 196.894263 34.350590 93.144957
	W3 0 0.000000 146.000000 58.000000 148.424081 58.000000 150.857211 57.973162 153.254630 57.614622
	SUBSEGS
	C3 0 0.000000 49.010944 147.034591 8.999977 358.790432 8.500708
	SUBSEND
	W3 0 0.000000 153.254630 57.614622 155.652049 57.256083 158.002995 56.570252 160.198336 55.542320
	SUBSEGS
	C3 0 0.000000 25.163319 149.605287 32.717335 8.338802 16.557159
	SUBSEND
	W3 0 0.000000 160.198336 55.542320 164.589019 53.486456 168.183655 50.084658 171.593567 46.638330
	SUBSEGS
	C3 0 0.000000 28.983672 147.591955 29.443806 25.781965 14.325058
	C3 0 0.000000 70.800370 120.689955 -2.570560 40.067839 5.901981
	SUBSEND
	W3 0 0.000000 171.593567 46.638330 175.003478 43.192002 178.513299 39.721681 182.823293 37.501630
	SUBSEGS
	C3 0 0.000000 -87.944840 234.845476 107.740628 221.240049 4.750279
	C3 0 0.000000 -31.190382 197.445339 65.052232 207.956421 13.316043
	SUBSEND
	W3 0 0.000000 182.823293 37.501630 187.133286 35.281578 192.053403 34.616571 196.894263 34.350590
	SUBSEGS
	C3 0 0.000000 -26.037017 194.490495 60.778284 190.692357 15.929527
	C3 0 0.000000 -51.011591 199.164279 85.311648 182.550505 8.187707
	SUBSEND
	END


END

DRAW<sp>index<sp>layer<sp>0<sp>0<sp>0<sp>start-x<sp>start-y<sp>start angle
A set of line segments
END


JOINT<sp>index<sp>layer<sp>width<sp>0<sp>0<sp>scale<sp>visible<sp>L0<sp>L1<sp>R<sp>L<sp>flip<sp>negate<sp>Scurve<sp>x<sp>y<sp>0<sp>angle
Two end points (Both Ts as a JOINT must be connected)
END


TURNOUT<sp>index<sp>layer<sp>options<sp>position<sp>0<sp>scale<sp>visible<sp>x<sp>y<sp>angle<sp>name
A set of E or T endpoints

Options is a set of values that are added together.

options valuesMeaning
0-7Width
8Handlaid
16Flipped
32Ungrouped
64Split
128Label Hidden

ADJUSTABLE<sp>Min<sp>Max - optional
PIER<sp>height<sp>name - optional
A D Description record
A set of P Path records
A set of track segments
A set of line segments (if any)
END


STRUCTURE<sp>index<sp>layer<sp>options<sp>position<sp>0<sp>scale<sp>visible<sp>x<sp>y<sp>angle<sp>name
A set of E or T endpoints

Options is a set of values that are added together. Note - not all of these may apply to a structure.

options valuesMeaning
0-7Width
16Flipped
32Ungrouped
64Split
128Label Hidden

ADJUSTABLE<sp>Min<sp>Max - optional
PIER<sp>height<sp>name - optional
A D record
A set of line segments
END


Segment Detailed Definitions


S<sp>color<sp>width<sp>x1<sp>y1<sp>x2<sp>y2
A straight track segment from X1,Y1 to X2,Y2

L3<sp>color<sp>width<sp>x1<sp>y1<sp>0<sp>x2<sp>y2<sp>0
A straight line segment from X1,Y1 to X2,Y

Q3<sp>color<sp>width<sp>x1<sp>y1<sp>0<sp>x2<sp>y2<sp>0
A segment of benchwork X1,Y1 to X2,Y2

M3<sp>color<sp>width<sp>x1<sp>y1<sp>0<sp>x2<sp>y2<sp>options
A segment of dimension line

J<sp>color<sp>width<sp>start-x<sp>start-y<sp>angle<sp>L0<sp>L1<sp>R<sp>L
A Joint segment

U<sp>"textfield1"<sp>"textfield2"<sp>"textfield3"<sp>dimfield1<sp>dimfield2<sp>dimfield3
This is an information only parameter. I have found it only exist in parameter files, if an track object is created with the Turnout Designer. The text fields are delimited by quotes and dimensional fields are delimited by a single space. All text fields are listed first then dimensional fields. Since this parameter is informational only it is not a required parameter.

P<sp>"textfield"<sp>1<sp>2<sp>3 .... etc.
The Path parameter for track objects only. Defines the path or multiple paths thru an track object. This is determine by the number of track segments define by parameters S and C an their order in the track object definition. Let see if I can explain this, here is a sample of an wye turnout definition.
	S 0 0.000000 0.000000 0.000000 0.353100 0.000000
	C3 0 0.000000 25.305227 0.353134 25.305227 171.786706 8.213370
	S 0 0.000000 3.968199 0.259557 6.500000 0.625000
	C3 0 0.000000 25.305227 0.352999 -25.305227 0.000076 8.213370
	S 0 0.000000 3.968199 -0.259557 6.500000 -0.625000

Shown are five track segment definitions, they are number starting with 1 in the order they are defined top down, so for a left-hand path through the turnout is 1 2 3 for a right-hand the path is 1 4 5. It is important that the order of segment definition and path definition match if not an error will display upon loading the parameter file. So if you to re-order the above definition as follow the path for a left-hand path through the turnout is 1 4 2 for a right-hand the path is 1 5 3.
	P "Normal" 1 4 5
	P "Reverse" 1 2 3

The textfield of the parameter string is just a label. I have yet to determine any purpose other than to indicate the path purpose. For turnouts with multiple paths (ie, dbl crossovers, dbl slips), the path are define in the following format 1 2 3 0 7 8 9 for the first pair, the zero is the delimiter for the second match path.

A3<sp>color<sp>line-width<sp>radius<sp>center-X<sp>center-Y<sp>angle<sp>degrees of swing.

The arc line segment for structure objects. Defines a arc/curved line. X,Y define the center point of the radius, the start angle defines the start point of the arc swing (clock-wise), the degrees of swing defines the travel of the arc in degrees.
As an example:
An arc/curve define from left to right starting at 0,0 and swing down clock-wise for 12" radius and 30 degree swing would be as shown below.

A3 0 0.000000 12.000000 0.000000 -12.000000 0.000000 30.000000

To define the same arc as above but with a up swing as follow

A3 0 0.000000 12.000000 0.000000 12.000000 150.000000 30.000000

to define a 12 radius circle at 0,0 see the below example.

A3 0 0.000000 12.000000 0.000000 0.000000 0.000000 360.000000

C3<sp>color<sp>line-width<sp>radius<sp>center-X<sp>center-Y<sp>angle<sp>degrees of swing.

The curved track definition for a segment for compound and turnout objects. The other comments are as for A3 except that for curved track, the radius can be negative which means that the track is used backwards from its usual (clockwise) direction


F3<sp>color<sp>width<sp>#end-points
<tab> X1 <sp> Y1 <sp> 0
<tab> X2 <sp> Y2 <sp> 0
<tab> X3 <sp> Y3 <sp> 0

The filled polyline parameter for structure and track objects. Defines a filled polyline object such as triangle, box, or irregular shapes. A minimum of 3 end-points must exist (ie., triangle or such). X1,Y1 define the start point and X2,Y2 define the next point and so forth. There is no need for a closing point, the last point will close/connect back to the starting point. For an example: a filled polyline for a 2" width by 1" height rectangle/box starting at 0,0 with a filled color of black would be as shown below.

F3 0 0.000000 4
0.000000 0.000000 0
2.000000 0.000000 0
2.000000 1.000000 0
0.000000 1.000000 0

Line width for this object is not needed, so can be left at 0.000000 width. If the total number of end-points do not match the number of end-points definitions an error will occur. The trailing zero does not mean anything.

F4<sp>color<sp>width<sp>#end-points<sp>polygon-type
<tab> X1 <sp> Y1 <sp> 0
<tab> X2 <sp> Y2 <sp> 0
<tab> X3 <sp> Y3 <sp> 0

The V5 filled polyline parameter for structure and track objects. Defines a filled polyline object such as triangle, box, or irregular shapes if the polygon-type is 0. A minimum of 3 end-points must exist (ie., triangle or such). X1,Y1 define the start point and X2,Y2 define the next point and so forth. There is no need for a closing point, the last point will close/connect back to the starting point. If the polygon-type is set to 1, the filled polygon is a regular rectangle aka "filled box". For an example: a filled polyline for a 2" width by 1" height rectangle/box starting at 0,0 with a filled color of black would be as shown below.

F4 0 0.000000 4 1
0.000000 0.000000 0
2.000000 0.000000 0
2.000000 1.000000 0
0.000000 1.000000 0

Line width for this object is not needed, so can be left at 0.000000 width. If the total number of end-points do not match the number of end-points definitions an error will occur. The trailing zero is intended for an elevation - but is always 0.

Y3<sp>color<sp>width<sp>end-points
<tab> X1 <sp> Y1 <sp> 0
<tab> X2 <sp> Y2 <sp> 0
<tab> X3 <sp> Y3 <sp> 0

The non-filled polyline parameter for structure and track objects. Defines a non-fill polyline object such as triangle, box, or irregular shapes. A minimum of 3 end-points must exist (ie., triangle or such). X1,Y1 define the start point and X2,Y2 define the next point and so forth. There is no need for a closing point, the last point will close/connect back to the starting point. For an example: a non-filled polyline for a 2" width by 1" height rectangular box starting at 0,0 with a line color of black would be as shown below.

Y3 0 0.000000 4
0.000000 0.000000 0
2.000000 0.000000 0
2.000000 1.000000 0
2.000000 1.000000 0

If the total number of end-points do not match the number of end-points definitions an error will occur. The trailing zero is intended for an elevation - but is always 0.

Y4<sp>color<sp>width<sp>end-points<sp>polygon-type
<tab> X1 <sp> Y1 <sp> 0
<tab> X2 <sp> Y2 <sp> 0
<tab> X3 <sp> Y3 <sp> 0

The V5 non-filled polyline parameter for structure and track objects that has includes a type. Defines a non-fill polyline object such as triangle, box, or irregular shapes if the polygon-type =0. A minimum of 3 end-points must exist (ie., triangle or such). X1,Y1 define the start point and X2,Y2 define the next point and so forth. There is no need for a closing point, the last point will close/connect back to the starting point. If the polygon-type is 1, the shape is a regular rectangle (aka "Box"). For an example: a non-filled polyline for a 2" width by 1" height rectangular box starting at 0,0 with a line color of black would be as shown below.

Y4 0 0.000000 4 1
0.000000 0.000000 0
2.000000 0.000000 0
2.000000 1.000000 0
2.000000 1.000000 0

If the total number of end-points do not match the number of end-points definitions an error will occur. The trailing zero is intended for an elevation - but is always 0.

G3<sp>color<sp>width<sp>radius<sp>center-X<sp>center-Y<sp>0

The filled circle parameter for structure and track objects. Defines a filled circle. X,Y define the center point of the radius. For an example: a filled circle defined starting at 0,0 and a 1" radius and filled color of black would be as shown below.

G3 0 0.000000 1.000000 0.000000 0.000000 0

Line width for this object is not needed, so can be left at 0.000000 width. The trailing zero does not mean anything.

B3<sp>color<sp>unknown<sp>startX<sp>startY<sp>0<sp>endX<sp>endY<sp>0<sp>umbersize

Benchwork

B3 16760832 0.041667 0.000000 0.375000 0 14.000000 0.375000 0 131585

lumbersize

131584 (0010 0000 0010 0000 0000)=1x1 on edge
131585 (0010 0000 0010 0000 0001)=1x1 flat
132096 (0010 0000 0100 0000 0000)=1x2 on edge
132097 (0010 0000 0100 0000 0001)=1x2 flat
132608 (0010 0000 0110 0000 0000)=1x3 on edge
132609 (0010 0000 0110 0000 0001)=1x3 flat
133120 (0010 0000 1000 0000 0000)=1x4 on edge
133121 (0010 0000 1000 0000 0001)=1x4 flat
133632 (0010 0000 1010 0000 0000)=1x5 on edge
133633 (0010 0000 1010 0000 0001)=1x5 flat
134144 (0010 0000 1100 0000 0000)=1x6 on edge
134145 (0010 0000 1100 0000 0001)=1x6 flat

263168 (0100 0000 0100 0000 0000)=2x2 on edge
263169 (0100 0000 0100 0000 0001)=2x2 flat
263680 (0100 0000 0110 0000 0000)=2x3 on edge
263681 (0100 0000 0110 0000 0001)=2x3 flat
264192 (0100 0000 1000 0000 0000)=2x4 on edge
264193 (0100 0000 1000 0000 0001)=2x4 flat
265216 (0100 0000 1100 0000 0000)=2x6 on edge
265217 (0100 0000 1100 0000 0001)=2x6 flat
266240 (0100 0000 0000 0000 0000)=2x8 on edge
266241 (0100 0000 0000 0000 0001)=2x8 flat

526337 (1000 0000 1000 0000 0001)=4x4 flat

M3<sp>color<sp>unknown<sp>startX<sp>startY<sp>0<sp>endX<sp>endY<sp>0<sp>typesize

Dimension Line

Typesize 0=Tiny, 1=Small, 2=Medium, 3=Large

Q3<sp>0<sp>0.187500<sp>startX<sp>startY<sp>0<sp>endX<sp>endY<sp>0

Table Edge

Q 0 0.187500 12.000000 36.000000 0 48.000000 36.000000 0

W3<sp>color<sp>width<sp>X1<sp>Y1<sp>X2<sp>Y2<sp>X3<sp>Y3<sp>X4<sp>Y4

Bezier Track - defined by its control points and with the approximating Curve and straight track segments

W3 0 0.000000 98.375000 37.625000 95.895254 37.138775 93.395484 36.719241 90.870970 36.607959
SUBSEGS
A set of C and S records
SUBSEND

H3<sp>color<sp>width<sp>X1<sp>Y1<sp>X2<sp>Y2<sp>X3<sp>Y3<sp>X4<sp>Y4

Bezier Line - defined by its control points and with the approximating set of curve and straight line segments

H3 0 0.000000 98.375000 37.625000 95.895254 37.138775 93.395484 36.719241 90.870970 36.607959
SUBSEGS
A set of A and L records
SUBSEND

Z<sp>color<sp>X-Offset<sp>Y-Offset<sp>angle<sp>0<sp>height<sp>"Text"

Text - Note the text can contain escaped characters \n (linefeed) \t (tab) \\ (backslash) and (a singular double quote)
Z 0 0.000000 0.000000 0.000000 0 18.000000 "ABCD\nEFGH\t\\Quoted"" "

Parameter Files


There are three file structure header parameters of an parameter file as follows:

CONTENTS file title

Required as the first line of the parameter file.
Followed with an title of the parameter file purpose which is also required.
This title description displays in the content navigation menu upon right
clicking the object bar, only if there are no SUBCONTENTS headings.

SUBCONTENTS Subcontents title

Not required but gives parameter file good organization structure and
allows for users to navigate the object bar easier.
Followed with an title of the subcontents. This title description displays
in the content navigation menu upon right clicking the object bar.

# comment description

Can be used anywhere in the parameter file for commenting purposes.

There are three object parameters used to define Track objects, Structures/Misc objects and Rolling Stock/Motive Power as follows:

TURNOUT Defines all Track objects (ie, Turnouts, cross, bridges, straight sectional track, curve sectional track, etc).
STRUCTURE Defines all objects not Track or Rolling Stock/Motive Power (ie, buildings, trees, etc).
CARPART Defines all Rolling Stock and Motive Power.

The object parameters TURNOUT, STRUCTURE and CARPART must have a closing parameter
of END to indicate the end of the object definition.

XTP files define each object to be inserted or used in a layout file (XTC) have a format which is (for a turnout):

TURNOUT .... header line
P ... paths
E ... endpoints
S ... straight track segments
C ... curved track segments
L ... straight line segments
A ... curved (arc) line segments

Graphic objects that are draw first (top down) are the lowest object when insert into a layout, so the order in which objects are draw will determine the outcome of how your turnout or structure will display..

Structures are similar but with only L and A lines and no path or endpoint requirements.


TURNOUT <sp> scale <sp> "textfield1 <tab> textfield2 <tab> textfield3"

The TURNOUT parameter has two basic parameters scale and a quote delimited text field

scale - is the scale the object is being created for (ie, N, HO, O, etc).

quote delimited text field - is created from 3 text boxes from the Turnout designer dialog
mfg. box, L or R description box and L or R part no. box, if this is other than a std. LH/RH
turnout then it is only mfg. box, description box and part no. box. These 3 text fields are
delimited inside the quotes by tab spaces only.

STRUCTURE <sp> scale <sp> "textfield1 <tab> textfield2 <tab> textfield3"

The STRUCTURE parameter has two basic parameters scale and a quote delimited text field

scale - is the scale the object is being created for (ie, N, HO, O, etc). For STRUCTURE
parameter, an non-scale specific parameter file can be created by using an * this allows
the parameter file to be used with any scale (ie., tree parameter file), if something is define
as 1" long it is 1" long for all scales.

quoted delimited text field - is created from 3 text boxes from the group command dialog
mfg. box, description box and part no. box. These 3 text fields are
delimited inside the quotes by tab spaces only.

The following is the info used to define rolling stock and motive power parameter files.

Use the following format for a non-scale or Prototype specific parameter file. All dims(in inches) should be in prototype lengths.

CARPART <sp> "Description" <sp> 0 <sp> Type <sp> Car Length <sp> Car Width <sp> 0 <sp> 0 <sp> Truck Center <sp> Overall Coupler Length

These are the Type codes:

10101(Diesel), 10201(Steam), 10301(Electric), 30100(Freight), 50100(Passenger), 70100(M-O-W) or 90100(Other)

The option before the Type code defines either 0 for square or 2 for angle lead end of stock. There are two 0 options between the Car width and Truck center dims which the use of these options have yet to be determine.

A parameter file created using the following example format can be used with any scale.

CARPART "Box, 40'" 0 30100 486.500 126.000 0 0 368.000 518.500
F 255 0.000000 4
0.000000 0.000000 0
486.500000 0.000000 0
486.500000 126.000000 0
0.000000 126.000000 0
L 128 0.013333 40.541667 117.600000 0 40.541667 8.400000 0
L 128 0.013333 81.083333 117.600000 0 81.083333 8.400000 0
L 128 0.013333 121.625000 117.600000 0 121.625000 8.400000 0
L 128 0.013333 162.166667 117.600000 0 162.166667 8.400000 0
L 128 0.013333 202.708333 117.600000 0 202.708333 8.400000 0
L 128 0.013333 244.023048 117.600000 0 244.023048 8.400000 0
L 128 0.013333 283.791667 117.600000 0 283.791667 8.400000 0
L 128 0.013333 324.333333 117.599832 0 324.333333 8.400000 0
L 128 0.013333 364.875000 117.547752 0 364.875000 8.347752 0
L 128 0.013333 405.416667 117.547752 0 405.416667 8.347752 0
L 128 0.013333 445.958333 117.547584 0 445.958333 8.347584 0
END

Any of the following parameter objects can be use to draw body and details for your rolling stock or Motive power (see structure section for usage)

L Defines a straight line.
A Defines a arc or circle.
F Defines a filled polyline.
Y Defines a non-filled polyline.
G Defines a filled circle.

For a Scale specific parameter file. All dims(in inches) should be in scale lengths.

CARPART <sp> Scale <sp> "Description" <sp> 0 <sp> Type <sp> Car Length <sp> Car Width <sp> 0 <sp> 0 <sp> Truck Center <sp> Overall Coupler Length <sp> Color

The description field has a unique format for Scale Specific parameter files, as follows:

"Manufacturer <tab> X1 <comma> <sp> X2 <comma> <sp> X3 <sp> X4 <tab> X5 <tab> X6 <tab> X7 <tab> X8 <tab> x9"

Some usage I have determine for the following fields:

X1 Car type (ie, Hopper)
X2 Car Desription field 1 (ie, Centerflow)
X3 Car Desription field 2 (ie, 50' ACF 3-Bay)
X4 Car Desription field 3 (any info)
X5 Car Desription field 4 (any info)
X6 Car Desription field 5 (ie, mfg part number)
X7 Full Road Name
X8 Report Markings
X9 Car number

These field show up in the Car Inventory Edit/Add dialog screens in the following format

Car Prototype field X1, X2, X3 X4
Part & Description field X6 X5 X8 X9
Full Road Name field X7
Report Markings field X8
Car Number field X9

All fields need to be fill in or data will shift between fields. Review some of the existing
rolling stock parameter files to get a better understanding of the proper format.


Thanks to Dwayne Ward for much of the information in this document.

CategoryDevel

There are no comments on this page. [Add comment]

Download XTrkCAD Model RR Track Planner
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki