Page 1 of 1

Additional Linetypes

Posted: Thu Nov 27, 2014 10:14 am
by andrew
Linetypes for electrical, water, power lines, ...

The attached file contains additional line type definitions for metric drawings:

Electical ---- E ---- E ---- E ----
Communication ---- BT ---- BT ---- BT ----
Water ---- W ---- W ---- W ----
Foul ---- FW ---- FW ---- FW ----
Surface ---- SW ---- SW ---- SW ----
High Voltage ---- HV ---- HV ---- HV ----
Low Voltage ---- LV ---- LV ---- LV ----
Overhead power ---- OHV ---- OHV ---- OHV ----
Foul Water Rising ---- FWRM ---- FWRM ---- FWRM ----

To install the new linetypes, simply save the attached file into your QCAD folder into the subfolder "linetypes/metric". Then restart QCAD and you will have those new types available.

You can also find plenty of other linetype definitions online. Keep in mind that some of them are referring to shape files (shx) which needs some porting to work with QCAD.

Re: Additional Linetypes

Posted: Sat Nov 29, 2014 5:15 pm
by andrew
Here's an updated version with direction arrows for:

Foul ->- FW ->- FW ->- FW ->-
Surface ->- SW ->- SW ->- SW ->-
Foul Water Rising ->- FWRM ->- FWRM ->- FWRM ->-
electrical_water.lin
(1.14 KiB) Downloaded 1114 times
Save this file into linetypes/metric of your QCAD installation and those linetypes will be available for all new drawings.

If you need to update linetypes in existing drawing files, please proceed as follows:
1. make sure that you are using the latest version of QCAD (3.7.4 at the time of writing)
2. save the attached file into your QCAD installation directory under linetypes/metric
3. start QCAD 3.7.4 (or later)
4. load the existing drawing
5. choose Misc > Modify > Reload Linetype Definitions

The .lin files contain linetype definitions and are relatively easy to understand and edit with any regular plain text editor (note pad, TextEdit, ...).

For example the foul water line (->- FW ->- FW ->- FW ->-) definition is:
*FOUL,Foul ->- FW ->- FW ->- FW ->-
A,6.35,[RIGHT_ARROW,qcadshp.shx,S=2.54,R=180],3.81,-5.08,["FW",STANDARD,S=2.54,R=0.0,X=-2.54,Y=-1.27],-5.08
The first line contains the name of the linetype lead by a *, then a comma and a description of the linetype (currently not used by QCAD).
The second line is the crucial part.
- The first part is always 'A,'
- Any positive number is a dash of that length (e.g. a dash of 6.35 units)
- Any negative number is a gap between dashes
- Shapes or texts are defined in square brakes [] where the first part is the shape name (RIGHT_ARROW) or text ("FW") followed by the file name of the file containing the shape definition (qcadshp.shx) or the font name in case of texts (STANDARD). The other parameters are scale (S) rotation (R) and offset (X,Y).

To add another linetype like the FOUL type but with a text "XY" instead, simply add the two following lines to electrical_water.lin or another, new .lin file in linetypes/metric:
*MYTYPE,My Linetype ->- XY ->- XY ->- XY ->-
A,6.35,[RIGHT_ARROW,qcadshp.shx,S=2.54,R=180],3.81,-5.08,["XY",STANDARD,S=2.54,R=0.0,X=-2.54,Y=-1.27],-5.08
Note that qcadshp.shx really uses the font file fonts/qcadshp.cxf in QCAD since .shx files are not currently supported by QCAD to define shapes.