本帖最后由 yjr111 于 2011-10-25 03:17 编辑
矩阵研究了几天,忽然迷茫了。。。今天看highflybir的块切线的程序,忽然灵感来了:难道牛顿定律有了,我还要去重新发明牛顿定律不成!?哈哈,直接拿来主义,稍加修改,搞定!!
自己就写了这么一点:(完整下载在下面)
- (defun c:yxpq(/ e1 e2 ee eee s11 p11 ang1 ang2 an lst11 JIAODU1 JIAODU2 JIAODU3)
- (vl-load-com)
- (setvar "cmdecho" 0)
- (setq e1 (car(setq ee(nentselp"\n 请选择要对齐的物体:"))))
- (setq s11 (entget e1))
-
- (if (wcmatch(cdr(assoc 0 s11))"*TEXT")
- (progn
- (setq p11 (cdr(assoc 10 s11)))
- (setq ang1 (cdr(assoc 50 s11))))
- (progn
- (setq lst11(nentselp (setq p11(cadr ee))))
- (qvxianjiaodu lst11 )
- (setq ang1 an))
- )
- (SETQ JIAODU1 (* (/ ang1 PI)180))
- (setq an nil)
- (setq e2 (car(setq eee(nentselp"\n 请选择物体要对齐的曲线"))))
- (setq lst11(nentselp (cadr eee)))
- (qvxianjiaodu lst11 )
- (setq ang2 an)
- (SETQ JIAODU2 (* (/ ang2 PI)180))
- (setq an nil)
- ;;;;;;;;;;;;;;旋转平移;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
- (IF (> (LENGTH ee)2) (PROGN (SETQ e1 (CAAR (REVERSE ee)))
- (setq p11 (cdr(assoc 10 (ENTGET e1)))
- jiaodu3 (*(/(cdr(assoc 50 (ENTGET e1)))PI)180))))
- (setq jiaodu (- jiaodu2 jiaodu1))
-
- (cond
- ((and(and e1 e2)(> (LENGTH ee)2))
- (command "_.rotate" e1 "" p11 (- jiaodu jiaodu3))
- (command "_.MOVE" e1 "" p11 pause))
-
- (t(command "_.rotate" e1 "" p11 jiaodu )
- (command "_.MOVE" e1 "" p11 pause))
-
- )
-
- (princ)
- )
图片演示:
|