R2004:
Is this the correct way to glean layer names using VL?
(defun GetLayerNames ( / result )
(vlax-for layer
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
(setq result (cons (vla-get-name layer) result))
)
(reverse result)
)
And, would this be a better/faster way?
They both seem to get the job done.
Or am I getting 2 different types of codes mixed up here.
(defun GetLayerNames ( / result )
(vlax-for layer
(vlax-get-property
(vlax-get-property
(vlax-get-acad-object) 'ActiveDocument) 'Layers)
(setq result (cons (vla-get-name layer) result))
)
(reverse result)
)
Just wondered why there are so many ways to do the same thing. I am pretty new to this VLA and VLAX stuff and would like to start on the right foot.
Bill
Is this the correct way to glean layer names using VL?
(defun GetLayerNames ( / result )
(vlax-for layer
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
(setq result (cons (vla-get-name layer) result))
)
(reverse result)
)
And, would this be a better/faster way?
They both seem to get the job done.
Or am I getting 2 different types of codes mixed up here.
(defun GetLayerNames ( / result )
(vlax-for layer
(vlax-get-property
(vlax-get-property
(vlax-get-acad-object) 'ActiveDocument) 'Layers)
(setq result (cons (vla-get-name layer) result))
)
(reverse result)
)
Just wondered why there are so many ways to do the same thing. I am pretty new to this VLA and VLAX stuff and would like to start on the right foot.
Bill