I'm looking to pick objects and have their layers set to no plot.
I dont have a full working understanding of Lisp (or any programming), but I've generally managed to fudge things together based on others hard work and some trial and error.... But not this time!!
More often than not i'll be selecting entities nested within a block/xref, so have been looking at doing it via
(vla-put-Plottable objectLayer :vlax-False)
But this is my first foray in to VLA, and I can't get my head around the object grouping & syntax order.
I've tried lots of variations, so this might not be the 'closest' I've come, but the autocad error isnt really helping me figure things out. Currently I have;
(defun c:NoP ( / doc enm obj objLayer)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(while (setq enm (car (nentsel)))
(setq obj (vlax-ename->vla-object enm))
(setq objLayer (vla-get-layer obj))
)
(vla-put-Plottable objLayer :vlax-False)
(princ)
)
The autocad error returns the correct Layer name, but it's obviously not getting it the way I want it to.
Select object: ; error: bad argument type: VLA-OBJECT "LayerName"
Do I need to look at retrieving a full list of layers at some point?
Is it failing because the Command is set up to get a list of layers, but then I'm processing it as if there's only one? Or am I just way off?
Thanks in advance for any pointers!