If I manually load each line of code from VLisp, it works. But if I load the whole routine, and call from command line in Autocad, it fails. Any ideas?
(defun c:foo (/LayerFrozen)
(vl-load-com)
(setq
acadObject (vlax-get-acad-object)
acadActiveDoc (vla-get-ActiveDocument acadObject)
)
(setq acadLayers (vla-get-Layers acadActiveDoc))
(vlax-for eachLayer acadLayers
(if
(= (vla-get-Freeze eachLayer) :vlax-true)
(vla-put-Freeze eachLayer :vlax-false)
)
)
)