本帖最后由 kwok 于 2014-11-13 10:56 编辑
love1030312 发表于 2014-11-13 08:53
谢谢大哥的回复 大概是你这样的 你这个程序比我现在用的还繁琐 哈哈 每次还要输入一次距离
之前弄过这个- (defun c:tt (/ p1 p2 p3 p4 );;;;;;;;;;;定高定2点画矩形
- (vl-cmdf ".undo" "be")
- (while
- (setq key T)
- (if (null rdh)
- (setq rdh 50)
- )
- (initget "S ")
- (while
- (and key
- (= (setq
- p1 (getpoint (strcat "\n矩形边起点,或,设置(S)<矩形宽度"
- (rtos rdh)
- ">:"
- )
- )
- )
- "S"
- )
- )
- (if p1
- (setq key nil)
- )
- (if (setq s (getdist (strcat "\n设置矩形宽度:<" (rtos rdh) ">")))
- (setq rdh s
- key T
- )
- )
- (initget "S ")
- )
- (setq p2 (getpoint p1 "矩形边终点:"))
- (setq p3 (polar p2 (+ (angle p1 p2) (* 0.5 pi)) rdh)
- p4 (polar p1 (+ (angle p1 p2) (* 0.5 pi)) rdh)
- )
- (apply 'vl-cmdf (list "_pline" "non" p1 "non" p2 "non" p3 "non" p4 "c"))
- (princ "\n**回车结束**")
- )
- (vl-cmdf ".undo" "e")
- (princ)
- )
|