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

create a command that turns on and off the layers with names ending with "ns"

  • Thread starter Thread starter pippo.poppi
  • Start date Start date

pippo.poppi

Guest
it is possible to create a file lisp to turn on and off all layers ending with "ns" or it is too complicated.. knowledge almost nothing of lisp. I tried with chat gpt but gives me error.. apart from the extra parentheses.
(defun c:accendispegnilayerns () (setq layer-prefix "ns") ; prefisso dei layer da accendere/spegnere (setq layers-to-toggle nil) ; lista dei layer da accendere/spegnere ; scansione di tutti i layer nel disegno (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) (if (string-match (strcat layer-prefix "$") (strcase (vla-get-name layer))) (setq layers-to-toggle (cons (vla-get-name layer) layers-to-toggle)) ) ) (if layers-to-toggle (progn (foreach layer layers-to-toggle (if (tblsearch "layer" layer) (if (= (cdr (assoc 70 (tblsearch "layer" layer))) 0) ; se il layer ë spento, accendilo (vla-put-on (tblsearch "layer" layer) :vlax-true) ; altrimenti, spegnilo (vla-put-on (tblsearch "layer" layer) :vlax-false) ) ) ) (princ (strcat "layer " (apply 'strcat layers-to-toggle) " aggiornati.")) ) (princ "nessun layer con il prefisso specificato trovato.") ) )
 
I tried with chat gpt but it gives me error.. apart from the extra parentheses.
We stayed at the degradation of intelligence from two-dimensional representations to programs exclusively in 3d (which makes the user lose the mental construction of the object, so you are the program makes a chaplain today almost nobody knows how to identify it).
Now we extend the same concept to programming. . .
the future dystopian imagined by orwell in 1984, from asimov in me robot and exaggerated by matrix approaches. . .
 

Forum statistics

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

Members online

No members online now.
Back
Top