• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

eliminate layers not used with autolisp

just to widen the scope of possible solutions, as I did in the first "posts", I inserted the lambda function inside vlax-map-collection instead of vlax-for.

(defun c:del-lay1 ()
(vl-load-com)
(setq layers (vla-get-layers))
(vlax-map-collection layers '(lambda (x) (if (/= (vl-string-search "ec" (vla-get-name x)) nil)
(vla-delete x)))
)
-----
with regard to the assignment of variables, personally during the drafting of the code I check them independently, especially because this facilitates the operation of "debug"; only in the vers. I try to eliminate them to the limit of comprensibility.
the fact that the assignment occupies more memory was a problem with the machines of twenty years ago; Moreover, declaring them as premises, at the end of the execution their allocation is emptied and still available.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top