Rectangle with pew sepecified width

Rectangle with pew sepecified width

Anonymous
Not applicable
395 Views
1 Reply
Message 1 of 2

Rectangle with pew sepecified width

Anonymous
Not applicable

Hey anybody can help me please.

 

Make rectangle with specific width.the lisp may work like this.

 

rw

width?

specify first point

specify second point

Capture.JPG

0 Likes
Accepted solutions (1)
396 Views
1 Reply
Reply (1)
Message 2 of 2

ВeekeeCZ
Consultant
Consultant
Accepted solution

Hi... you may this one:

 

Spoiler
(defun c:RW ( / *error* oORTHOMODE pt1 pt2)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg)))
    (setvar 'ORTHOMODE oORTHOMODE)
    (princ))
  
  ; ----------------------------------

  (setq oORTHOMODE (getvar 'ORTHOMODE))

  (initget 6)
  (if (and (setq *w (cond ((getreal (strcat "\nRectangle width" (if *w (strcat " <" (rtos *w 2 2) ">: ") ": "))))
			  (*w)))
	   (setq pt1 (getpoint "\nSpecify first corner point: "))
	   (setvar 'ORTHOMODE 1)  		; comment this line in case you don't want orto on
	   (setq pt2 (getpoint pt1 "\nSpecify second corner point: "))
	   )
    (command "_.RECTANGLE"
	     "_none" pt1
	     "_none" (list (car pt2)
			   (+ (cadr pt1) *w))))
  (setvar 'ORTHOMODE oORTHOMODE)
  (princ)
)