Question 1.
I wrote this function a to thaw,on and unlock. However, whenever the layer is a current layer, it gives me an "Automation Error. Invalid layer". Any remedy to the problem is much appreciated.
;; ========================================================
;; wg:activate-layer
;; function to turn on, thaw and unlock if layers exist.
;;
(defun WG:activate-layer (lan1 objLayers / layer)
(cond ((not (vl-catch-all-error-p (setq layer (vl-catch-all-apply 'vla-item (list objLayers lan1)))))
(vla-put-Freeze layer ':vlax-false)
(vla-put-Layeron layer ':vlax-true)
(vla-put-Lock layer ':vlax-false)
(princ (strcat "\nLayer " lan1 " on,thawed & unlocked ....")
)
)
)
) ;_WG:activate-layer
Question 2.
How do one convert a handle to a vla-object?
Thanks.