Converting Linetypes

Converting Linetypes

drew_dewit
Advocate Advocate
1,016 Views
2 Replies
Message 1 of 3

Converting Linetypes

drew_dewit
Advocate
Advocate

I am creating a LISP routine that processes imported cad data. One of the things I would like to do is convert linetypes. I want to convert a linetype that is solid to CONTINUOUS and one that is dashed to HIDDEN. For example I have files with the linetype SLD-SOLID which is a solid line and is identical to CONTINUOUS. Is there a way I can analyze a linetype and convert it to an existing linetype? I was thinking about possibly dumping them out to a LIN file and building a list from that file. Thoughts?

 

Thanks!

0 Likes
1,017 Views
2 Replies
Replies (2)
Message 2 of 3

ronjonp
Mentor
Mentor

Quick check and your 'solid' ltype will be missing the 49 codes. You won't be able to convert it to an existing linetype per se but you can modify the objects that reference this other linetype then purge out the old.

image.png

0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

This is a part of code that is similar but does lots more it removes the link to a shx file for the non Autocad linetypes. It does use the object bylayer to work.

 

[code]

(setq layer (vla-get-layers doc))
(vlax-for each layer
  (setq ltype (vla-get-linetype each))
  (If (or (= Ltype  "solid" )(= ltype "SOLID"))
    (vla-put-linetype each "Continuous")
  )
  (If (= Ltype  "dash" )
    (vla-put-linetype each "DASHED")
  )
  (If (= Ltype  "903" )
    (vla-put-linetype each "FENCE")
  )
  (If (= Ltype  "VEGETATION" )
    (vla-put-linetype each "TREE")
  )
) ; end for
[/code]
0 Likes