TuttoCAD Forum

TuttoCAD Forum
[ Home | Registrati | Discussioni Attive | Discussioni Recenti | Segnalibro | Msg privati | Sondaggi Attivi | Utenti | Album Fotografico | Download | | Cerca | FAQ ]
Nome Utente:
Password:
Salva Password
Password Dimenticata?

 Tutti i Forum
 1 - TuttoCAD Software
 AutoLISP
 Creare sequenza layer numerati in modo ultrarapido

Nota: Devi essere registrato per poter inserire un messaggio.
Per registrarti, clicca qui. La Registrazione è semplice e gratuita!

Larghezza finestra:
Nome Utente:
Password:
Modo:
Formato: GrassettoCorsivoSottolineatoBarrato Aggiungi Spoiler Allinea a  SinistraCentraAllinea a Destra Riga Orizzontale Inserisci linkInserisci EmailInserisci FlashInserisci Immagine Inserisci CodiceInserisci CitazioneInserisci Lista
   
Icona Messaggio:              
             
Messaggio:

  * Il codice HTML è OFF
* Il Codice Forum è ON

Faccine
Felice [:)] Davvero Felice [:D] Caldo [8D] Imbarazzato [:I]
Goloso [:P] Diavoletto [):] Occhiolino [;)] Clown [:o)]
Occhio Nero [B)] Palla Otto [8] Infelice [:(] Compiaciuto [8)]
Scioccato [:0] Arrabbiato [:(!] Morto [xx(] Assonnato [|)]
Bacio [:X] Approvazione [^] Disapprovazione [V] Domanda [?]
Seleziona altre faccine

    
 
   

V I S U A L I Z Z A    D I S C U S S I O N E
arri Inserito il - 17 novembre 2011 : 10:00:00
fonte

(defun c:test ( / c n )
(setq c 0)
(if (setq n (getint "\nNumber of Layers: "))
(repeat n
(entmake
(list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
(cons 2 (itoa n))
(cons 62 (setq c (1+ (rem c 255))))
'(70 . 0)
)
)
(setq n (1- n))
)
)
(princ)
)
1   U L T I M E    R I S P O S T E    (in alto le più recenti)
arri Inserito il - 18 novembre 2011 : 08:37:03
variante con prefissi 0

(defun c:test ( / c n nl k kl pref name )
    (setq c 0 k 0 pref "")
    (initget 7)
    (if (setq n (getint "\nNumber of Layers: ") nl (strlen (itoa n)))
        (while (< k n)
            (setq k (1+ k) kl (strlen (itoa k)))
            (repeat (- nl kl)
                (setq pref (strcat "0" pref))
            )
            (setq name (strcat pref (itoa k)))
            (entmake
                (list
                   '(0 . "LAYER") 
                   '(100 . "AcDbSymbolTableRecord") 
                   '(100 . "AcDbLayerTableRecord") 
                    (cons 2 name) 
                    (cons 62 (setq c (1+ (rem c 256))))
                   '(70 . 0)
                )
            )
            (setq pref "")
        )
    )
    (princ)
)

TuttoCAD Forum © 2001-2010 CADLandia Torna all'inizio della Pagina
Pagina generata in 0,22 secondi.