在论坛上找的类似命令
- ;;;动态角度矩形
- (defun c:are (/ os pt1 pt2 pt3 pt4 ag0 ag len ent ct in k)
- (setq os (getvar "osmode"))
- (while (and (setq pt1 (getpoint "\n角点1:"))
- (setq ag0 (getangle pt1 "角度:"))
- (progn (princ "对角点:") (setq ct t))
- (progn
- (setq ct t k t ent nil)
- (while ct
- (setq in (grread 1))
- (cond
- ( (= 5 (car in))
- (setq pt3 (cadr in))
- (setq len (distance pt1 pt3) ag (angle pt1 pt3) )
- (setq pt2 (polar pt1 ag0 (* len (cos (- ag ag0)))))
- (setq pt4 (polar pt1 (+ (/ pi 2.) ag0) (* len (sin (- ag ag0)))))
- (if ent (command "erase" ent ""))
- (setvar "osmode" 0)
- (command "pline" pt1 pt2 pt3 pt4 "c" )
- (setvar "osmode" os)
- (setq ent (entlast))
- )
- ( (= 3 (car in))
- (setq pt3 (cadr in))
- (setq len (distance pt1 pt3) ag (angle pt1 pt3) )
- (setq pt2 (polar pt1 ag0 (* len (cos (- ag ag0)))))
- (setq pt4 (polar pt1 (+ (/ pi 2.) ag0) (* len (sin (- ag ag0)))))
- (if ent (command "erase" ent ""))
- (setvar "osmode" 0)
- (command "pline" pt1 pt2 pt3 pt4 "c" )
- (setvar "osmode" os)
- (setq ent (entlast))
- (setq ct nil)
- )
- ( (equal '(11 0) in)
- (if ent (command "erase" ent ""))
- (setq ct nil k nil)
- )
- (t)
- )
- )
- k
- )
- )
-
- )
- (setvar "osmode" os)
- (princ)
- )
|