With this fancy dancy lil procedure.
;;; FUNCTION
;;; determines if a layer is locked, returns either :vlax-true
;;; or :vlax-false
;;;
;;; ARGUMENTS
;;; layer name = string
;;;
;;; USAGE
;;; (if (= (MST-IslockedLayer "Layername") :vlax-true)
;;; (prompt "layer is locked"))
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2003 Mark S. Thomas
;;; mark.thomas@bigswamp.org
;;;
;;; VERSION
;;; 1.0 Wed Thu Apr 03, 2003
(defun MST-IslockedLayer (lname)
(if
(not
(vl-catch-all-error-p
(vl-catch-all-apply
'vla-item
(list
(vla-get-Layers
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
lname
); list
)
)
); not
(vlax-get-property
(vla-item
(vla-get-Layers
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
lname); layer name
'Lock)
)
); defun
does that help ya?