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
Solved! Go to Solution.
Solved by _Tharwat. Go to Solution.
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)))))))) ) )
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.
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)))))))) ) ) ) )
@Anonymous wrote:Thanks a million. Worked great.
Regards,
Ozitag
You're welcome anytime .