HOME  CDS Tutorial Manual
                        Defining line types within CDS
 
CDS comes with a number of predefined linetypes. To view the linetypes available run CDS and open a job. Pretend you are entering a new string. Under strings menu click Strings Add. On the dialog displayed click on the linetype button. The line types available will be shown.
The line types that CDS can display are all defined in an ascii file. This file can be modified with a text editor. Notepad is recommended. The file "ltype" can be found in the Variable directory. If CDS was installed in the default directory you will find it at "c:/Program Files/Foresoft/CDS/Variable/ltype".
   
Definition of CDS linetypes
 
You may use the following documentation to define your own line types to be used by CDS. CDS allows you to define upto 250 individual linetypes. Linetype 1 is always a continuous line. Linetypes numbered from 2 up may de defined by you to suit a variety of needs.
You may use any text editor in non-document mode to modify this file accordinging to the following rules. The first line starts with a '*', and should be followed by the number of the linetype in brackets. Follow this by a space and then the name of the linetype.
    e.g. for linetype 3, you would have *(3) Dashed
You then define the line segments that make up the line as pairs of distance and offset coordinates relative to the start, which is always 0,0.
The dimensions are always in millimeters on the plan.
Say, for example that you wished to draw line type 2 as a simple dashed line with each dash being 2 millimeters long, with a 2 millimeter gap between dashes. First you would enter the number as outlined above, together with the name "Dashed 2mm". You would have the following line:
    *(2) Dashed 2mm
Next you need to describe the segments which make up the line, and in this case there is only one which starts at 0,0 and is 2 millimeters long 'x' direction with no variation in the 'y' direction. The definition is now;
    *(2) Dashed 2mm    
     0,0,2,0
The next step is to specify where the segment is to next start. in this case we want a gap of 2mm, so the next segment should start 2 millimeters further on in the x direction. We need to add in a line of 4,0. The completed linetype would be
    *(2) Dashed 2mm
 
    0,0,2,0
 
    4,0
This has now finished the definition of linetype2, since the program will now use the two items over and over to give a line like that seen below.
        __  __  __  __  __  __
From this basis we can work to more complex examples. For line type 3, we want a line made up of a long dash of 2mm, a gap of 1mm,a short dash of 0.5mm and a gap of 1mm.  This linetype will therefore consist of two segments, and we describe each segment on a different line. The first line would define the linetype as 3 and describe it as Dashed3. The first line would define the linetype as 3 and describe it: *(3) Dashed3. On the next line we describe our first segment as follows 0,0,2,0 Next we describe the next segment which is 3,0,3.5,0.
We have now described the two segments which make up the linetype, and now need to specify where the segments are to start drawing next. In this case it will be obtained by adding 1mm to the last specified 'x' coordinate,thus we have the final line below 4.5,0. In summary then Linetype 3 would be:
    *(3) Dashed3
 
    0,0,2,0
 
    3,0,3.5,0
 
    4.5,0
 
 
 
The line would appear as seen below
 
 
 
    __  _  __  _  __  _
 
 
 
From the above examples, you have the basis of constructing any linetype which may take your fancy, and you may have up to 50 individual segments in any one linetype. The one thing which we havn't covered yet is the use of the 'y' or offset part of the coordinates, and the traditional fence line is the classical example of the need for this facility.
 
 
 
In the case of the fence line, we would have a dash of around 2mm, a gap of 1mm, and then a sloping dash which slopes from top left to bottom right across the primary line. In this routine we define anything to the left of the main line as a negative 'y', so conversely, anything to the right must be considered positive.
 
 
 
In the case of our sloping dash, let us consider that we want it to start 1mm to the left of the main line, finish 1mm to the right of the main line, and travel a total horizontal length of 1 mm. By now you should be familiar with the specification of the linetype number, and the construction of a dash 2mm long. The first specification would be 0,0,2,0 We also need a gap of 1mm, so the next 'x' coordinate will be 3. The line is said to start 1mm to the left, so the y coordinate will be -1. The line travels 1mm in the x direction, so the x coordinate of the end must be 4. The line ends1mm to the right, so the y coordinate will be 1. From this we get the line 3,-1,4,1. All that is left is to specify where the segments should start drawing again. in this case we want a gap of 1mm, and we want it to start back on the main line, so we have coordinates of 5,0. The full description of this linetype is as follows;
 
 
 
    *(4) Fence1
 
    0,0,2,0
 
    3,-1,4,1
 
    5,0
 
 
 
and the line will appear as below.
 
 
 
    -- \ -- \ -- \
 
 
 
The only extra is where you need to have text drawn in the middle of the line. The text is specified as follows. You specify the coordinates to start the text, the required text surrounded by inverted commas, and a number specifying the text height in millimeters. For example assume that we require a dash of 2mm, a gap of 1mm, the word gas to be written 1.5mm high, and a gap of 1mm. The linetype is specified as below:
 
 
 
    *(5) Gas
 
    0,0,2,0
 
    3,0,"GAS",1.5
 
    7,0
 
 
 
    -- GAS -- GAS -- GAS