0 Members and 1 Guest are viewing this topic.
;;RETOPO(defun c:retopo (/ w1) (setvar "cmdecho" 1) (setq w1 (entget (car (entsel "\nSélectionnez votre région: ")))) (if w1 (progn;;is layer lock ?(if (= 4 (logand 4 (cdr (assoc 70 (tblsearch "layer" (cdr (assoc 8 w1)))))))(command "_layer" "_U" (cdr (assoc 8 w1)) ""));;si c'est une REGION (if (eq (cdr (assoc 0 w1)) "REGION") (progn (command "._explode" (cdr (assoc -1 w1)))(setq w1 (entget (entlast)))(if (eq (cdr (assoc 0 w1)) "LWPOLYLINE")(command "._pedit" "_l" "_J" "_P" "" ""))(if (and (/= (cdr (assoc 0 w1)) "CIRCLE")(/= (cdr (assoc 0 w1)) "LWPOLYLINE"))(command "._pedit" "_l" "_Y" "_J" "_P" "" ""))(princ "\nConversion en polyligne réussi.")(setq w1 (entget (entlast)))(command "_area" "_O" (cdr (assoc -1 w1)))(getretopoinfo))(progn(command "_area" "_O" (cdr (assoc -1 w1)))(getretopoinfo)))))(princ)(c:retopo));;;;;;;;;;;;;;;;;;;;;;;(defun getretopoinfo ()(alert (strcat "Superficie: " (rtos (getvar "AREA") 2 8)"\nPerimètre : " (rtos (getvar "PERIMETER") 2 8))))