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

create new layers

  • Thread starter Thread starter joe
  • Start date Start date

joe

Guest
check this lisp please

(defun c:crealay()
(setq var)
(getstring "\ninseriting the layer name: ")
(command "_layer" "_n" var")
(Sectq
(getstring "\ninseriting color for questo layer: ")
(command "_layer" with var ")
(Sectq var nil)
(setq with nil)
(princ)
)

I would like to put in place of "questo layer"the name inserted" and then make sure that if there is already some other similar name, the request repeats

Could you help me out, please?
 
per il controllo sul nome layer esistente:


(setq var "0")
(while (tblsearch "layer" var)
(setq var (getstring "\ninserire il nome del layer: "))
(if (tblsearch "layer" var) (alert (strcat "il layer \"" var "\" è già esistente")))
)
(command "_layer" "_n" var "")

...... ecc.
 
works well
only that if I have to insert a layer consisting of two names(e.g.: external walls) I cannot insert the space because the bar on the keyboard is equivalent to the sending key.
can you overcome this, in the code, making sure that the spacebar does not have the function of sending?
 
so that the string may contain empty spaces:

(setq var) t "\ninseri il nome del layer: ")
 

Forum statistics

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

Members online

No members online now.
Back
Top