modifying line types in autocad - acad

Upload: jefe7yu

Post on 07-Jul-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 Modifying Line Types in Autocad - ACAD

    1/3

    ifying line types in Autocad

    5/15/2011 8:0//www.foresoft.com/Tutorials/linetypeautocad.htm

    Modifyingline types in Autocad

    ine types in Autocad can be modified with a text processor. Notepad is recommended. Each linetype is defined on two lines in a LIN file. The first liefines the linetype nameand provides for an optional description.

    inetype-name [, description]

    his line must beginwith an asterisk and must be immediatelyfollowed by the linetype name. If the description is provided, it must be separated fromame by a comma and no longer than 47 characters. Thedescriptionis not used by AutoCAD; it is intended to help you visualize the appearanceof

    netype.he second line is the code that describes the actual pattern.

    lignment,patdesc-1,patdesc-2, ...

    his line begins with the alignment code (currentlyonly A is allowed), followedby a comma-delimitedlist of pattern descriptors(no spacesare alloweWhen you create a linetype, it is not loaded into your drawing automatically. Use the Load option of the LINETYPEcommandThe following simple

    netype, DD1, is an example of a repeatingpattern:

    Dash, 0.5 drawing units long

    pace, 0.25 drawing units longDot

    pace, 0.25 drawing units long

    he 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 cas

    escription is a simple representationof the dash-dot pattern.he description is optional and can be a sequence of dots, spaces, and dashes, or a comment such as "Use this linetypefor hidden lines." If you omescription, do not put a comma after the linetype name. If you includea description, it should be no longer than 47 characters long.

    he alignment field specifiesthe action for pattern alignment at the ends of individuallines, circles, and arcs. Currently, AutoCADsupports only onelignment action. You specify it by enteringA in the field. The alignment action is entered into the definitionautomaticallywhen you use the LINETYP

    Create option. However, if you create the linetype definitionusing a text editor, you need to includethe A yourself. AutoCAD rejects any other charac

    he alignment field.

    ach 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 lenenotes a pen-up (blank) segment. A dash length of 0 draws a dot. You can enter up to 12 dash-length specificationsper linetype, provided they fit o

    ne 80-characterline.

    With A-type alignment, AutoCADguaranteesthat the endpoints of lines and arcs start and end with a dash. For example, suppose you create a linetalled CENTRAL that displays the repeating dash-dot sequencecommonlyused as a centerline. AutoCAD adjuststhe dash-dot sequenceon an

    ndividual line basis so that dashes and line endpointscoincide. The patternfits the line so that at least half of the first dash specificationbegins andhe line. If necessary, the first and last dashes are lengthened. If a line is too short to hold even one dash-dot sequence, AutoCADdraws a continuoune between the endpoints. For arcs, the patternis also adjusted so that dashes are drawn at the endpoints. Circles do not have endpoints, but Autodjuststhe dash-dot sequence to provide reasonabledisplays.

    he A-type alignment requiresthat the first dash length be 0 or greater(a dot or pen-down segment). The second dash length should be less than0 en-up segment). You must have at least two dash specificationsfor this alignment. Betweenthe start and end dashes, the pattern dash specificatio

    re drawn sequentially, beginning with the second dashspecificationand restarting the patternwith the first dashspecificationwhen required.

    Complexlinetype descriptionsare placed in LIN files along with simple linetypes. A complex linetype specifies a single, possiblybroken, line interspewith symbols. This linetype can denote utilities, boundaries, contours, and so on. As with simple linetypes, complex lines are dynamicallydrawn as th

    serspecifiesvertices. Shapesand text objectsembedded in lines are alwaysdisplayedcompletely; they are never trimmed.he syntaxfor complexlinetypes is similar to that of simple linetypesin that it is a comma-delimitedlist of patterndescriptors. Complex linetypes can

    ncludeshape and text objectsas pattern descriptors, as well as the dash-dot descriptorsof simple linetypes.

    he syntaxfor bothshape and text object descriptorsin a linetypedescription is as follows:

    hape

    shapename,shxfilename] orshapename,shxfilename,transform]

    ext

    string",stylename] or

    string",stylename,transform]

    where transformis optional and can be any series of the following(each precededby a comma):

  • 8/19/2019 Modifying Line Types in Autocad - ACAD

    2/3

    ifying line types in Autocad

    5/15/2011 8:0//www.foresoft.com/Tutorials/linetypeautocad.htm

    R=## RelativerotationA=## Absolute rotation

    =## Scale

    X=## X offsetY=## Y offsetn this syntax, ## is a signed decimalnumber (1, –17, 0.01, and so on), the rotation is in degrees, and the remaining options are in linetype-scaled

    rawing units. The preceding transform letters, if they are used, must be followedby an equal sign and a number.

    Shapes in Complex Linetypes

    he following linetype definitiondefines a linetype named CON1LINE that is composed of a repeating pattern of a line segment, a space, and thembeddedshape CON1 from the es.shxle. (Note that the es.shx file must be in the support path for the followingexample to work properly.)

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

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

    xcept for the code enclosedin squarebrackets, everythingis consistentwith thedefinition of a simple linetype. This exampleshows the minimal linefinition that embeds a shape in a linetype.

    As previouslydescribed, 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;ext four are optional and can be orderedarbitrarily. The following two examples demonstrate various shape definitionfield entries.

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

    his 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 10egrees in a counterclockwisedirection, 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]

    his codedraws 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 offsne drawing unit above the linetype with a scale equal to the unit scale of the linetype and 0 rotation.he followingsyntaxdefines a shape as part of a complexlinetype.

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

    he definitionsof the fields in the syntaxfollow.

    hapename

    he name of the shape to be drawn. This field must be included. If it is omitted, linetypedefinition fails. If shapenamedoes not exist in the specifiedhape file, continue with linetype drawing withoutthe embedded shape.

    hapefilename

    he name of a compiledshape definition file (SHX). If it is omitted, linetypedefinition fails. If shapefilenameis unqualified( that is, no path is specifieearch the library path for the file. If shapefilenameis fully qualifiedand not found at that location, remove the prefix and search the library path for thit is not found, continue with linetype elaborationwithoutthe embeddedshape.

    cale

    =value. The scale of the shape is used as a scale factorby which the shape's internallydefined scale is multiplied. If the shape's internallydefined

    s 0, the S=valuealone is used as the scale.

    otate

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

    offset

    X=value. This field specifies the shift of the shape in the X axis of the linetype computed from the end of the linetype definitionvertex. If xoffset is omr is 0, the shape is elaboratedwith no offset. Include this field if you want a continuous line with shapes. This value is not scaledby the scale factorefined by S=.

    offset

    Y=value. This field specifies the shift of the shape in the Y axis of the linetype computed from the end of the linetype definitionvertex. If yoffset is om

    r 0, the shape is elaboratedwith no offset. This value is not scaledby the scale factor defined by S=.

  • 8/19/2019 Modifying Line Types in Autocad - ACAD

    3/3

    ifying line types in Autocad

    5/15/2011 8:0//www foresoft com/Tutorials/linetypeautocad htm

    Text in Complex Linetypes

    Complexlinetypeswith text are used primarily for incorporating text as theshape to be elaborated. The primarydifference between the use of shapes

    he use of text is that text is associated with a text style in the drawing while shapes are associateddirectlywith a shape file. The styleassociatedwitnetype must be loaded into thedrawing prior to loading the linetype.he following is an example of a complexlinetypedefinitionthat 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 nameof the linetype, and "--- MC --- MC --- MC" is the ASCII description. The syntaxof the second line of the linetype definitionis asollows:

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

    he definitionsof the fields in the syntaxfollow.

    tring

    he text to be used in the complexlinetype.

    tyle

    he name of the text styleto be elaborated. The specified text stylemust be included. If it is omitted, use the currently defined style.

    cale

    =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=valuealone is used acale.ecausethe final height of the text is definedby both the S=valueand the height assigned to the text style, you will achievemore predictableresults b

    etting the text styleheight to 0. Additionally, it is recommended that you create separatetext stylesfor text in complexlinetypesto avoid conflicts witther text in your drawing.

    otate

    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 respo the origin; all text has thesame rotation regardlessof its relative position to the line. The value can be appended with a d for degrees( if omitted,

    egree is thedefault), r for radians, or g for grads. If rotation is omitted, 0 relative rotation is used.

    Rotation is centeredbetween the baselineand the nominal cap heights box.

    offset

    X=value. This field specifies the shift of the text in the X axis of the linetype computed from the end of the linetype definitionvertex. If xoffset is omittes 0, the text is elaboratedby using the lower-left corner of the text as the offset. Include this field if youwant a continuous line with text. This value is

    caled by the scale factor that is definedby S=.

    offset

    Y=value. This field specifies the shift of the text in the Y axis of the linetype computed from the end of the linetype definitionvertex. If yoffset is omittes 0, the text is elaboratedby using the lower-left corner of the text as the offset. This value is not scaledby the scale factor that is defined by S=.