(defun c:ATTpunti () (SETVAR "CMDECHO" 0) (setq cLay(getvar "clayer")) (setq nomeBlocco(getstring "\n Nome del Blocco: ")) (setq Ris(getstring "\n Vuoi cancellare i blocchi con attributo ? ")) (setq Ris(strcase Ris)) (setq Ht(getreal "\n Altezza dei testi: ")) (princ "\n Attendere la selezione di tutti i blocchi <")(princ NomeBlocco) (princ "> ...") (setq gruppo(ssget "x" (list (cons 0 "INSERT") (cons 2 nomeBlocco) ) ) ) (setq lung(sslength gruppo)) (if (/= lung nil)(progn (setq i 0) (command "_layer" "_m" "0_PUNTI" "_c" "7" "0_PUNTI" \r) (command "_layer" "_m" "0_QUOTE" "_c" "2" "0_QUOTE" \r) (repeat lung (setq nodo1(ssname gruppo i)) (setq nodo1r(entget nodo1)) (setq pps(cdr(assoc 10 nodo1r))) ;;; estrae punto di inserimento del blocco (princ "\r Punti Totali n. ")(princ lung)(princ " ... Disegno punto n.")(princ (+ 1 i)) (command "_layer" "_s" "0_PUNTI" \r) (command "_point" pps \r) (command "_layer" "_s" "0_QUOTE" \r) (command "_text" "_c" pps Ht "0" (rtos (caddr pps) 2 2) \r) (if (= Ris "S")(command "_erase" nodo1 "")) (setq i(+ i 1)) ) ) (princ "... Non trovati blocchi!") ) (setvar "clayer" cLay) (princ) ) ;-------------------------------------------------------------------------- (defun c:ATTpuntiQ () (SETVAR "CMDECHO" 0) (setvar "osmode" 0) (setq cLay(getvar "clayer")) (setq nomeBlocco(getstring "\n Nome del Blocco: ")) (setq nomeATT(getstring 1 "\n Etichetta dell'attributo QUOTA: ")) (setq Ris(getstring "\n Vuoi cancellare i blocchi con attributo ? ")) (setq Ris(strcase Ris)) (setq Ht(getreal "\n Altezza dei testi: ")) (princ "\n Attendere la selezione di tutti i blocchi <")(princ NomeBlocco) (princ "> ...") (setq gruppo(ssget "x" (list (cons 0 "INSERT") (cons 2 nomeBlocco) ) ) ) (setq lung(sslength gruppo)) (if (/= lung nil)(progn (setq i 0) (command "_layer" "_m" "0_PUNTI" "_c" "7" "0_PUNTI" \r) (command "_layer" "_m" "0_QUOTE" "_c" "2" "0_QUOTE" \r) (repeat lung (setq nodo1(ssname gruppo i)) (setq nodo1Base nodo1) (setq nodo1r(entget nodo1)) ;;; estrae punto di inserimento del blocco: (setq pps(cdr(assoc 10 nodo1r))) (princ "\r Punti Totali n. ")(princ lung)(princ " ... Disegno punto n.")(princ (+ 1 i)) (setq nodo1(entnext nodo1)) (setq nodo10(cdr(assoc 0 (entget nodo1)))) (while (/= nodo10 "SEQEND") (setq nodo1rr(entget nodo1)) (setq eti(cdr (assoc 2 nodo1rr))) (if (= eti nomeATT) (PROGN (setq val(cdr (assoc 1 nodo1rr))) (setq nodo10 "SEQEND") (command "_layer" "_s" "0_PUNTI" \r) (command "_point" (list (car pps) (cadr pps) (atof val)) \r) (command "_layer" "_s" "0_QUOTE" \r) (command "_text" "_c" pps Ht "0" val \r) (if (= Ris "S")(command "_erase" nodo1Base "")) ) (PROGN (setq nodo1(entnext nodo1)) (setq nodo10(cdr(assoc 0 (entget nodo1)))) ) ) ) (setq i(+ i 1)) ) ) (princ "... Non trovati blocchi!") ) (setvar "clayer" cLay) (princ) ) ;-------------------------------------------------------------------------- (princ "\n") (princ "\n... Per l'esplosione dei blocchi 3D digita: ATTPUNTI") (princ "\n... Per l'esplosione dei blocchi digita: ATTPUNTIQ") (princ)