本帖最后由 ZZXXQQ 于 2013-8-17 07:37 编辑
是这个意思吧- (defun C:TT (/ ANG0 ANG180 ANG270 ANG90 PLWID PT01 PT02
- PT03 PT04 PT05 PT06 PT1 PT10 PT2 PT20)
- (princ "\n画板正筋")
- (command "layer" "m" "REIN" "Color" 1 "" "")
- (setq PT1 (getpoint "\n指定第一点:"))
- (setq PT2 (getpoint PT1 "\n指定第二点:"))
- (setq ANG0 (angle PT1 PT2);_pt1到pt2的角度,返回弧度值
- ANG180 (angle PT2 PT1))
- (if (and (> ANG0 (* 0.5 pi)) (<= ANG0 (* 1.5 pi))) ;_角度大于90小于等于270
- (setq ANG90 (+ ANG0 (* 1.5 pi))
- ANG270 (+ ANG0 (* 0.5 pi)))
- (setq ANG90 (+ ANG0 (* 0.5 pi))
- ANG270 (+ ANG0 (* 1.5 pi)))
- )
- (setq PT10 (polar PT1 ANG0 50)
- PT02 (polar PT10 ANG90 50)
- PT03 (polar PT10 ANG270 50)
- PT01 (polar PT02 ANG0 120))
- (setq PT20 (polar PT2 ANG180 50)
- PT04 (polar PT20 ANG270 50)
- PT05 (polar PT20 ANG90 50)
- PT06 (polar PT05 ANG180 120))
- (setq PLWID (getvar "PLINEWID"))
- (setvar "PLINEWID" 30);_设置线宽为30
- ; (command "._pline" "none" PT01 "none" PT02 "a"
- ; "none" PT03 "l" "none" PT04 "a" "none" PT05 "l" "none" PT06 "")
- (command "._pline" "none" PT02 "none" PT1 "none" PT2 "none" PT05"")
- (setvar "PLINEWID" PLWID)
- (princ)
- )
|