- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this lisp that changes REVIT line types to CAD lines. But it only works with LAYERS that have those line type names (By Layer).
Most lines in the drawing are forced line types. Can this lisp be made to pick up those forced line types?
this is the lisp:
(vl-load-com)
(defun c:demoLN (/ put_linetype linetypes ltyp ltyps)
(or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
(setq linetypes (vla-get-linetypes adoc))
(vlax-for ltyp (vla-get-linetypes adoc)
(setq ltyps (cons (vla-get-name ltyp) ltyps))
)
(defun put_linetype (obj linetype linefile)
(if (vl-position linetype ltyps)
(vla-put-linetype obj linetype)
(progn
(vla-load linetypes linetype linefile)
(setq ltyps (cons linetype ltyps))
(vla-put-linetype lay linetype)
)
)
)
(vlax-for lay (vla-get-layers adoc)
(cond ((wcmatch (setq ltyp (vla-get-linetype lay)) "Hidden 1_8_,Hidden 1_8_,Overhead 1_16_")
(put_linetype lay "HIDDEN2" "acadiso.lin")
)
((wcmatch (setq ltyp (vla-get-linetype lay)) "Dash 1_16_,Dash Dot 3_16_,Long dash")
(put_linetype lay "HIDDEN" "acadiso.lin")
)
((wcmatch (setq ltyp (vla-get-linetype lay)) "IMPORT-CHAINTHIN0,Grid 1_2_,Grid Line 1_2_")
(put_linetype lay "Center2" "acadiso.lin")
)
)
)
(princ)
)
Solved! Go to Solution.