(vl-load-com)

(defun c:VXF () (c:VPFreezeXref))
(defun c:VPFreezeXref (/ ss oBlock blockName)
(if
(and
(setq ss (ssget ":S:E" '((0 . "INSERT"))))
(setq oBlock (vlax-ename->vla-object (ssname ss 0)))
(= :vlax-true
(vla-get-isxref
(vla-item (vla-get-blocks
(vla-get-activedocument (vlax-get-acad-object))
)
(setq blockName (vla-get-effectivename oBlock))
)
)
)
)
(command "vpLAYER"
"freeze"
(strcat (vl-filename-base blockName) "|*")
"" ""
)
(prompt "\n** Must select an external reference ** ")
)
(princ)
)
(c:vxf)

Advertisements