How to create linetype in CAD (self-create linetype as electricity, water…)

How to create linetype in CAD: self-create file linetypes. Instruction for self-creating linetypes as electricity, water,…

1. Concept and sort of linetype

AutoCAD supplies many existing linetypes. These can be dashed line, line, or center line,…. These linetypes are supplied in file .LIN. We can self-create thesse files and save them as format Text with ending .LIN.
AutoCAD supplies existing linetypes in file CAD.LIN, ACADISO.LIN .
The linetypes are simply created from the points (dot), straight line segments (dash), and space which are drawn again many times.

For example:

How to create linetype in CAD
How to create linetype in CAD
  • Long dash 0.5 unit of drawing
  • Space 0.25 unit of drawing
  • Long dash 0.5 unit of drawing
  • Space 0.25 unit of drawing
  • A point of image (Long dash 0 unit of drawing)
  • Space 0.25 unit of drawing

We divide linetype into 2 types: simple linetype and complex linetype.

  • Simple linetype is the linetype with straight line segments, space and dots.
  • Complex linetype is the linetype with not only straight line segments, space and dots but also with other objects such as character font or Shape.

2. Create the simple linetypes.

There are 2 ways to create the simple linetype

  • Using creat in command -linetype
  • Create file describing code form ACII with extension .LIN.

2.1. Using creat in command -linetype.
Current line type: “ByLayer”
Enter an option [?/Create/Load/Set]: C : Create

  • Enter name of linetype to create: name :the name of linetype
  • Wait, checking if linetype already defined…
  • (Dialog box Creat and Append linetype file appears below). Choose name of file to create or open existing file .LIN to specify this line.
  • Descriptive text: Center line – Name of line will appear in box linetype manager
  • Enter linetype pattern (on next line): Enter bytes describing linetype
  • A,0.5,0.5,-0.25,0,-0.25
How to create linetype in CAD
How to create linetype in CAD
How to create linetype in CAD
How to create linetype in CAD

Convention for describing linetype in linetype.

  • Linetype start by character A. This A defines to finish the object by dashed line.
  • Positive value defines the length of dash
  • Minus value defines the length of space
  • Number 0 defines straight line segment with length of 0 or (dot).

Therefore, the linetype described in the above file sample1.lin gets the below shape:

How to create linetype in CAD
How to create linetype in CAD

Note: Code A (alignment) defines the way to draw linetypes at the end points of drawing object. Code Alignment is automatically put in definition file .LIN.

How to create linetype in CAD
How to create linetype in CAD

2.2. Create linetype by directly editing in .LIN

Each linetype in file .LIN is described in 2 lines:
*linetype_name,description
A,descriptor1,descriptor2, … ​

Mark * is compulsorily put before name of linetype
Linetypename : Name of linetype will appear in linetype manager.
Description : Series of description is optional (yes or no) and not longer than 47 characters.
Descriptor 1,2,.. : Byte describing linetype (as above)

3. Complex linetype with shape object

The way to describe dashed lines, space and dot is similar to in the file of simple linetype. Description syntax of a linetype is similar to simple linetype. With linetype with shape object, we just need to add in description of linetype a shape description syntax as below:
[shapename,shxfilename] or [shapename,shxfilename,transform]​

Shape name : Name of shape drawing object. If name of object is not in file shape, AutoCAD will define that there is no description about shape object in linetype.
Shxfilename : Name of file .shx with shape object to insert into linetype. You need to specify name, path. If not AutoCAD will find in default section with file .SHX :C:\Users\[User name]\AppData\Roaming\Autodesk\AutoCAD 2007\R17.0\enu\Support.
Transform : It is optional section, including parameters corresponding to transformation when inserting shape object and linetype. Value of transform is described as below board, each parameter is separate by comma.

Value of transform parameter.

R=## Relative rotation: Relative rotation angle of shape in comparison with drawn straight line.

A=## Absolute rotation: Absolute rotation angle in comparison with OX axis of WCS coordinates.

S=## Scale: Ratio factor of shape (inserted with shape described in shape file)

X=## X offset: Displacement following direction of straight line (X unit)

Y=## Y offset: Displacement following perpendicular direction to straight line (Y unit). (X, Y can be minus)

For example:

Using load command to download file ltypeshx.shx into drawing, then type Shape command to insert shape with name bat and drawing. Image of bat appears as below:

How to create linetype in CAD
How to create linetype in CAD

Open file LT_Sample.LIN and type 3 below linetypes:
*BAT1LINE, — [BAT1] — [BAT1] — [BAT1]
A,38.1,-38.1,[BAT,ltypeshp.shx,S=5],-12.7
*BAT2LINE, — [BAT2] — [BAT2] — [BAT2]
A,38.1,-38.1,[BAT,ltypeshp.shx,S=5,R=0,X=-20.0],-12.7
*BAT3LiNE, — [BAT3] — [BAT3] — [BAT3]
A,38.1,-38.1,[BAT,”C:\sample\ltypeshp.shx”,S=5,y=-6.0,r=90,X=-6],-12.7

Shape of above linetypes appears in below order:

How to create linetype in CAD
How to create linetype in CAD

4. Complex linetype with character object.

Description syntax of character object in complex linetype as below:
[“text”,textstylename,scale,rotation,xoffset,yoffset]​

  • Text : series of inserted characters.
  • Style : Name of character that AutoCAD will define to fix format for text.
  • Scale,rotation,xoffset,yoffset : Similar to transform parameter

For example:
*HOT_WATER_SUPPLY1,—- HW —- HW —- HW —- HW —- HW —-
A,.5,-.2,[“HW”,STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2

We get the result of the below linetype:

How to create linetype in CAD
How to create linetype in CAD

Note: If s=0, text will be defined following font and character size (height) equal 1.

Good luck!

Thanks for reading!!!

You can see more useful writings about CAD… here

You might also like
Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More