This routine does not work on versions above the map autocad 2004, what may be happening?
regards!
(defun c:IL (/ pt pt1 pt2 objpt1 objpt2 pilha divisa contador cont plista lista
XIZ XFZ YIZ YFZ XYIZ XYFZ XIPT1 XFPT1 YIPT1 YFPT1 XYIPT1 XYFPT1
XIPT2 XFPT2 YIPT2 YFPT2 XYIPT2 XYFPT2)
(command "undo" "M")
(COMMAND "APERTURE" "50")
(SETQ CONTADOR 0)
(Setq pt nil)
(setq pt1 nil)
(setq pt2 nil)
(setq OBJpt1 nil)
(setq OBJpt2 nil)
(setq pilha nil)
(setq divisa nil)
(setq pilha (ssget '((8 . "divisa" ))))
(setq cont (sslength pilha))
(WHILE (< contador cont)
(setq PLISTA (ssname pilha contador))
(setq lista (entget PLISTA))
(setq pt (cdr (assoc 10 lista )))
(command "erase" plista "")
(command "osnap" "NEAREST")
(command "insert" "*c:/temp/linha" pt "1" "1" "0" )
(command "osnap" "None")
(SETQ XIz (- (CAR pt) 10))
(SETQ XFz (+ (CAR pt) 10))
(SETQ YIz (- (CADR pt) 10))
(SETQ YFz (+ (CADR pt) 10))
(SETQ XYIz (LIST XIz YIz))
(SETQ XYFz (LIST XFz YFz))
(command "zoom" "w" XYIz XYFz )
(setq pt1 (cdr (assoc 10 (entget (SETQ DIVISA (entlast))))))
(setq pt2 (cdr (assoc 11 (entget (SETQ DIVISA (entlast))))))
(SETQ XIpt1 (- (CAR pt1) 0.2))
(SETQ XFpt1 (+ (CAR pt1) 0.2))
(SETQ YIpt1 (- (CADR pt1) 0.2))
(SETQ YFpt1 (+ (CADR pt1) 0.2))
(SETQ XYIpt1 (LIST XIpt1 YIpt1))
(SETQ XYFpt1 (LIST XFpt1 YFpt1))
(SETQ XIpt2 (- (CAR pt2) 0.2))
(SETQ XFpt2 (+ (CAR pt2) 0.2))
(SETQ YIpt2 (- (CADR pt2) 0.2))
(SETQ YFpt2 (+ (CADR pt2) 0.2))
(SETQ XYIpt2 (LIST XIpt2 YIpt2))
(SETQ XYFpt2 (LIST XFpt2 YFpt2))
(gc)
(SETQ OBJpt1 (SSGET "C" XYIpt1 XYFpt1 '((8 . "alinha" ))))
(SETQ OBJpt2 (SSGET "C" XYIpt2 XYFpt2 '((8 . "alinha" ))))
(gc)
(if (or (/= OBJpt1 NIL)(/= OBJpt2 NIL))
(progn
(COMMAND "ROTATE" DIVISA "" PT "90" )
(setq pt1 (cdr (assoc 10 (entget (SETQ DIVISA (entlast))))))
(setq pt2 (cdr (assoc 11 (entget (SETQ DIVISA (entlast))))))
(SETQ XIpt1 (- (CAR pt1) 0.2))
(SETQ XFpt1 (+ (CAR pt1) 0.2))
(SETQ YIpt1 (- (CADR pt1) 0.2))
(SETQ YFpt1 (+ (CADR pt1) 0.2))
(SETQ XYIpt1 (LIST XIpt1 YIpt1))
(SETQ XYFpt1 (LIST XFpt1 YFpt1))
(gc)
(SETQ OBJpt1 (SSGET "C" XYIpt1 XYFpt1 '((8 . "alinha" ))))
;(command "rectangle" XYIpt1 XYFpt1)
(if (/= OBJpt1 NIL)
(progn
(COMMAND "ROTATE" DIVISA "" PT "30" )
)
)
(SETQ XIpt2 (- (CAR pt2) 0.2))
(SETQ XFpt2 (+ (CAR pt2) 0.2))
(SETQ YIpt2 (- (CADR pt2) 0.2))
(SETQ YFpt2 (+ (CADR pt2) 0.2))
(SETQ XYIpt2 (LIST XIpt2 YIpt2))
(SETQ XYFpt2 (LIST XFpt2 YFpt2))
(SETQ OBJpt2 (SSGET "C" XYIpt2 XYFpt2 '((8 . "alinha" ))))
;(command "rectangle" XYIpt2 XYFpt2)
(if (/= OBJpt2 NIL)
(progn
(COMMAND "ROTATE" DIVISA "" PT "30" )
)
)
)
)
(setq OBJpt1 nil)
(setq OBJpt2 nil)
;(command "erase" plista "")
(setq contador (+ 1 contador))
(gc)
)
(COMMAND "APERTURE" "3")
Solved! Go to Solution.
Solved by alexlibrelon. Go to Solution.
Solved the problem with the help of you.
Using -insert in the insert.
Thank you all and sorry the English.
Alex.