LAYDEL from a LISP
I am trying to duplicate the functionality of LAYDEL from inside a LISP. ie I need to delete a layer that has entities on it, and entities inside block definitions. They have redone LAYDEL for v26 so at least it works from the command line, if in a very clunky fashion. But I can't get it to work from inside a LISP using any of the command-s type things, because the number of questions is variable depending on whether there are entities inside blocks or not. I'd rather not have to write a LISP that goes through all the block definitions, but if I have to … Anybody got a better solution ?
Comments
-
1 You can select an object to get layer name.
2 You can select all objects on that layer and erase.
3 Could test does block have sub blocks, I think that is what your asking. Please confirm
4 There is get nested block names from a block lisp, you need to get that defun.
0 -
Hello.
In my testing with V26, using an sequence like:
(setq ent_n (car (entsel)))
(command "_laydel" ent_n "" "_y")
(graphscr)worked fine.
If the case is more complex, something useful could be to use the CMDACTIVE sysvar to check whether the command (LAYDEL) is still active.
0 -
The reason you can't control LAYDEL from LISP is that it is also a LISP function.
: !C:LAYDEL
#<<FUNCTION> #x38 @1000326af6>I would try putting in a support request to ask for the routine to be updated to honour the EXPERT sysvar setting i.e. EXPERT = 5 deletes requested layer without additional confirmation prompting.
0 -
Thanks for the various suggestions.
Yes, I have blocks within blocks that have entities on the layer I want to delete.
Have opted for the simplest solution - I've given up with this 🤣
0 -
you can roll a lisp function with Python.
Example AutoLISP execution usage: (pylaydel '("1_1_WALLS" "1_CRP_WALLS"))0


