Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

New linetype 1

Status
Not open for further replies.

DWren

Industrial
Jul 26, 2001
4
How can I create a new linetype? I am using ACAD LT 2000i on WIN 98. I searched the directory and found a "hot water" line type that is a dashed line with "HW" between the dashes. I would like to make similar line types with different variables like "T" for telephone, "C" for cable, "W" for water, or anything else I might need.
Thanks,
David
 
Replies continue below

Recommended for you

the easiest way would be use the full version of acad2k with the express tools 1-9 but you dont even have the full version so you would have to do it by hand look in the help under customization it should be if not here is what i have in those regards


The following simple linetype, DD1, is an example of a repeating pattern:

Dash, 0.5 drawing units long
Space, 0.25 drawing units long
Dot
Space, 0.25 drawing units long

The linetype would be defined as

*DD1,____ . ____ . ____ . ____ .

A,.5,–.25,0,–.25

DD1 is the linetype name, and the description field is the description of the linetype displayed by the LAYER Ltype ? command sequence. In this case, the description is a simple representation of the dash-dot pattern.
The description is optional and can be a sequence of dots, spaces, and dashes, or a comment such as "Use this linetype for hidden lines." If you omit the description, do not put a comma after the linetype name. If you include a description, it should be no longer than 47 characters long.

The alignment field specifies the action for pattern alignment at the ends of individual lines, circles, and arcs. Currently, AutoCAD supports only one alignment action. You specify it by entering A in the field. The alignment action is entered into the definition automatically when you use the LINETYPE Create option. However, if you create the linetype definition using a text editor, you need to include the A yourself. AutoCAD rejects any other character in the alignment field.

Each pat-n field specifies the length of a segment making up the linetype. If the length is positive, a pen-down segment will be drawn. A negative length denotes a pen-up (blank) segment. A dash length of 0 draws a dot. You can enter up to 12 dash-length specifications per linetype, provided they fit on one 80-character line.
With A-type alignment, AutoCAD guarantees that the endpoints of lines and arcs start and end with a dash. For example, suppose you create a linetype called CENTRAL that displays the repeating dash-dot sequence commonly used as a centerline. AutoCAD adjusts the dash-dot sequence on an individual line basis so that dashes and line endpoints coincide. The pattern fits the line so that at least half of the first dash specification begins and ends the line. If necessary, the first and last dashes are lengthened. If a line is too short to hold even one dash-dot sequence, AutoCAD draws a continuous line between the endpoints. For arcs, the pattern is also adjusted so that dashes are drawn at the endpoints. Circles do not have endpoints, but AutoCAD adjusts the dash-dot sequence to provide reasonable displays.

The A-type alignment requires that the first dash length be 0 or greater (a dot or pen-down segment). The second dash length should be less than 0 (a pen-up segment). You must have at least two dash specifications for this alignment. Between the start and end dashes, the pattern dash specifications are drawn sequentially, beginning with the second dash specification and restarting the pattern with the first dash specification when required.


Complex linetype descriptions are placed in LIN files along with simple linetypes. A complex linetype specifies a single, possibly broken, line interspersed with symbols. This linetype can denote utilities, boundaries, contours, and so on. As with simple linetypes, complex lines are dynamically drawn as the user specifies vertices. Shapes and text objects embedded in lines are always displayed completely; they are never trimmed.
The syntax for complex linetypes is similar to that of simple linetypes in that it is a comma-delimited list of pattern descriptors. Complex linetypes can include shape and text objects as pattern descriptors, as well as the dash-dot descriptors of simple linetypes.

The syntax for both shape and text object descriptors in a linetype description is as follows:

shape

[shapename,shxfilename] or
[shapename,shxfilename,transform]

text

["string",stylename] or
["string",stylename,transform]

where transform is optional and can be any series of the following (each preceded by a comma):
R=## Relative rotation
A=## Absolute rotation
S=## Scale
X=## X offset
Y=## Y offset
In this syntax, ## is a signed decimal number (1, –17, 0.01, and so on), the rotation is in degrees, and the remaining options are in linetype-scaled drawing units. The preceding transform letters, if they are used, must be followed by an equal sign and a number.

Complex linetypes with text are used primarily for incorporating text as the shape to be elaborated. The primary difference between the use of shapes and the use of text is that text is associated with a text style in the drawing while shapes are associated directly with a shape file. The style associated with the linetype must be loaded into the drawing prior to loading the linetype.
The following is an example of a complex linetype definition that includes a text style.

*MCline, --- MC --- MC --- MC

A,1.0,-0.25,["MC",mystyle,S=1,R=0,X=0,Y=-0.25],-1.25

MCline is the name of the linetype, and "--- MC --- MC --- MC" is the ASCII description. The syntax of the second line of the linetype definition is as follows:

["string",style,S=scale,R=rotate,X=xoffset,Y=yoffset]

The definitions of the fields in the syntax follow.

string

The text to be used in the complex linetype.

style

The name of the text style to be elaborated. The specified text style must be included. If it is omitted, use the currently defined style.

scale

S=value. The scale of the style is used as a scale factor by which the style's height is multiplied. If the style's height is 0, the S=value alone is used as the scale.
Because the final height of the text is defined by both the S=value and the height assigned to the text style, you will achieve more predictable results by setting the text style height to 0. Additionally, it is recommended that you create separate text styles for text in complex linetypes to avoid conflicts with other text in your drawing.

rotate

R=value or A=value. R= signifies relative or tangential rotation with respect to the lines elaboration. A= signifies absolute rotation of the text with respect to the origin; all text has the same rotation regardless of its relative position to the line. The value can be appended with a d for degrees (if omitted, degree is the default), r for radians, or g for grads. If rotation is omitted, 0 relative rotation is used.

Rotation is centered between the baseline and the nominal cap heights box.

xoffset

X=value. This field specifies the shift of the text in the X axis of the linetype computed from the end of the linetype definition vertex. If xoffset is omitted or is 0, the text is elaborated by using the lower-left corner of the text as the offset. Include this field if you want a continuous line with text. This value is not scaled by the scale factor that is defined by S=.

yoffset

Y=value. This field specifies the shift of the text in the Y axis of the linetype computed from the end of the linetype definition vertex. If yoffset is omitted or is 0, the text is elaborated by using the lower-left corner of the text as the offset. This value is not scaled by the scale factor that is defined by S=.

The following linetype definition defines a linetype named CON1LINE that is composed of a repeating pattern of a line segment, a space, and the embedded shape CON1 from the es.shx file. (Note that the es.shx file must be in the support path for the following example to work properly.)

*CON1LINE, --- [CON1] --- [CON1] --- [CON1]

A,1.0,-0.25,[CON1,es.shx],-1.0

Except for the code enclosed in square brackets, everything is consistent with the definition of a simple linetype. This example shows the minimal linetype definition that embeds a shape in a linetype.
As previously described, a total of six fields can be used to define a shape as part of a linetype. The first two are mandatory and position-dependent; the next four are optional and can be ordered arbitrarily. The following two examples demonstrate various shape definition field entries.

[CAP,es.shx,S=2,R=10,X=0.5]

This code draws the CAP shape defined in the es.shx shape file with a scale of two times the unit scale of the linetype, a tangential rotation of 10 degrees in a counterclockwise direction, and an X offset of 0.5 drawing units before shape elaboration takes place.

[DIP8,pc.shx,X=0.5,Y=1,R=0,S=1]

This code draws the DIP8 shape defined in the pc.shx shape file with an X offset of 0.5 drawing units before shape drawing takes place, and a Y offset of one drawing unit above the linetype with a scale equal to the unit scale of the linetype and 0 rotation.
The following syntax defines a shape as part of a complex linetype.

[shapename,shapefilename,scale,rotate,xoffset,yoffset]

The definitions of the fields in the syntax follow.

shapename

The name of the shape to be drawn. This field must be included. If it is omitted, linetype definition fails. If shapename does not exist in the specified shape file, continue with linetype drawing without the embedded shape.

shapefilename

The name of a compiled shape definition file (SHX). If it is omitted, linetype definition fails. If shapefilename is unqualified (that is, no path is specified), search the library path for the file. If shapefilename is fully qualified and not found at that location, remove the prefix and search the library path for the file. If it is not found, continue with linetype elaboration without the embedded shape.

scale

S=value. The scale of the shape is used as a scale factor by which the shape's internally defined scale is multiplied. If the shape's internally defined scale is 0, the S=value alone is used as the scale.

rotate

R=value or A=value. R= signifies relative or tangential rotation with respect to the lines elaboration. A= signifies absolute rotation of the shape with respect to the origin; all shapes have the same rotation regardless of their relative position to the line. The value can be appended with a d for degrees (if omitted, degree is the default), r for radians, or g for grads. If rotation is omitted, 0 relative rotation is used.

xoffset

X=value. This field specifies the shift of the shape in the X axis of the linetype computed from the end of the linetype definition vertex. If xoffset is omitted or is 0, the shape is elaborated with no offset. Include this field if you want a continuous line with shapes. This value is not scaled by the scale factor defined by S=.

yoffset

Y=value. This field specifies the shift of the shape in the Y axis of the linetype computed from the end of the linetype definition vertex. If yoffset is omitted or 0, the shape is elaborated with no offset. This value is not scaled by the scale factor defined by S=. if everyone helps everybody the world will be a better place
 
Well I've never done it, but I know it can be done. Do a search in your AutoCAD help for linetypes and complex linetypes (which is what you need). You'll have to do some digging and searching, but I think you can find what you need. I found some info, but instead of posting it here, it's probably just easier for you to find it.
Although, somebody else may come along and easily explain it. :)

 
Why thank you CDH. Great advice - funny neither me nor DWREN thought of it all by ourselves.


Acad/support/Acad.lin
is an ascii file to open and edit in notepad etc.
Definitions of lines can simply added to it.
It already has all those known line type definitions, which serves as tutorial.

*ZICKZACK,Zickzack /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
A,.0001,-.2,[ZIG,ltypeshp.shx,x=-.2,s=.2],-.4,[ZIG,ltypeshp.shx,r=180,x=.2,s=.2],-.2

Hope this is useful.
 
tigrek has it in one for a simple and easy way for the line types to be created. Edit your .lin file using cut and paste to help, you will probably need to change the text start points to make the line look ok. You can also change the dash length and insert an extra dash without text for greater variation.

regards
sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor