Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DXF Codes for linetypes

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
630 Views, 5 Replies

DXF Codes for linetypes

Hi,

Has someone any idea how I can get the linetype dxf codes of a line that I select. I have tried a few different things and all I can get is the linetype name. I'm trying to write a Lisp program that draws a "template" and sets up the line types and layers etc. But I need to get this info from a current drawing so that I can put it into the program. So far the program works well, but if I take a new drawing and run the program, the line types will need to be set up and the colours on the layers. I don't think I'll have a problem with the colours as they are standard to Autocad, but the linetype used in the current drawing is "homemade".

Any ideas?

Regards,

Ozitag

5 REPLIES 5
Message 2 of 6
_Tharwat
in reply to: Anonymous

Check this out ....

 

(if (setq s (car (entsel "\n Select object :")))
  (if (not (cdr (assoc 6 (entget s))))
    (print (cdr (assoc 6 (entget (tblobjname "LAYER" (cdr (assoc 8 (entget s))))))))
  )
)

 

Message 3 of 6
Anonymous
in reply to: _Tharwat

Thanks for that.

That works well for getting the name of the linetype, but I was wanting all the dxf codes for it so that I can rebuild it.

How do I go the next step into it?

Ozitag.

Message 4 of 6
_Tharwat
in reply to: Anonymous

You can retreive the DXF codes for LTYPE from its table as shown in the following example .

 

(if (setq s (car (entsel "\n Select object :")))
  (if (not (cdr (assoc 6 (entget s))))
    (print
      (entget
        (tblobjname "LTYPE" (cdr (assoc 6 (entget (tblobjname "LAYER" (cdr (assoc 8 (entget s))))))))
      )
    )
  )
)

 

Message 5 of 6
Anonymous
in reply to: _Tharwat

Thanks a million. Worked great.

Regards,

Ozitag

Message 6 of 6
_Tharwat
in reply to: Anonymous


@Anonymous wrote:

Thanks a million. Worked great.

Regards,

Ozitag


You're welcome anytime .

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost