Hi
I have a little lisp which will toggle a point cloud on/off by its layer. The problem is that I am unable to lock the point cloud as if you do you are unable to apply clipping etc. Because of this it is often selected and then accidentally has its layer changed.
Is there away of selecting the point cloud by its type instead of by its layer?
This is the lisp I currently use:
;;; http://forums.augi.com/showthread.php?17541-Toggle-Layer-ON-OFF
(defun c:pcl() (c:pointcloudonoff))
(defun c:pointcloudonoff(/ lName lyr lyrCol)
(setq lyrCol (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object)))) ;;get the layer collection
(setq lName "0-Cloud") ;;<-set the layer name here
(if (vl-catch-all-error-p (setq lyr (vl-catch-all-apply 'vla-item (list lyrCol lName)))) ;;get specific layer object or error code
(princ) ;;if error, do nothing
(if (= (vla-get-layerOn lyr) :vlax-true) ;;if no error, check if layer is on
(vla-put-layerOn lyr :vlax-false) ;;if on, turn it off
(vla-put-layerOn lyr :vlax-true) ;;if off, turn it on
)
)
(princ)
)
Thanks