Message 1 of 10
LISP to get a retangular area by diagonal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
I Have a lisp to capture a rectangular area by diagonal using the Autocad default green transparent markup.
The lisp catches and draw the first rectangle, but what I want to is continuing the application taking other rectangles but showing the markups in the screen. Actually, I take the first rectangle and, in the sequence, I draw the others, point by point.
(defun c:RETANGULAREA(/ pt1 pt2 pt3 pt4) (setq pt1(getpoint "\nPonto inicial")) (initget 32) (setq pt3(getpoint PT1 "\nPonto final")) (setq Pt2 (list (car PT1)(cadr pt3) 0)) (setq Pt4 (list (car PT3)(cadr pt1) 0)) (command ".area" "ADD" PT1 PT2 PT3 PT4 "") (princ) )
If I put a while, ok, it works but not stay on the screen the transparent green:
(defun c:RETANGULAREA(/ pt1 pt2 pt3 pt4) (setq areasum 0) (while (setq pt1(getpoint "\nPonto inicial")) (initget 32) (setq pt3(getpoint PT1 "\nPonto final")) (setq Pt2 (list (car PT1)(cadr pt3) 0)) (setq Pt4 (list (car PT3)(cadr pt1) 0)) (command "._area" PT1 PT2 PT3 PT4 "") (setq areatosum (getvar "area")) (setq areasum (+ areasum areatosum)) (PRINC (RTOS AREASUM)) ) (princ) )
TIA