本帖最后由 yaojing38 于 2023-5-19 20:46 编辑
事情是,,想获得选取文字后面会拉出一条跟随的正交直线,,,但是不太熟悉grread的高深,,感觉获得了PT点,,线也画出来了但是,文字却移动了十万八千里,,,有点蒙,,请有空大家帮看看!谢谢!代码实现了画不是正交的斜线。。。。感觉就差一步。。。。但又感觉还好远。。。。无奈!-
- ;;-------------------------------------------------
- (defun c:tt ()
- ;(setq pt0 (getpoint))
- (setvar 'orthomode 1)
- (setq a (entsel))
- (setq pt0 (cadr a))
- (setq pt1 (cadr a))
- (setq ty (car a) )
- (setq enx (entget ty)
- txtpp (textbox enx)
- zg (cadr(cadr txtpp))
-
- )
- (command "line" pt0)
- (setq e(vlax-ename->vla-object ty))
- (setq loop t)
- (while loop
- (setq gr (grread t 15 0))
- (setq pt (trans (cadr gr) 1 0))
-
- (cond
-
- ;((equal gr '(2 15)) ;F8切换正交开关
- ; (if (= f8 0)
- ; (progn (setq f8 1) (princ "\n <正交 开>"))
- ; (progn (setq f8 0) (princ "\n <正交 关>"))
- ; )
- ; (setvar 'orthomode f8)
- ; (redraw)
- ; )
- ((= 5 (car gr))
- ;(vla-move e (vlax-3d-point pt0)(vlax-3d-point pt))
- (vla-move e (vlax-3d-point pt0)(vlax-3d-point pt))
-
- (redraw)
- (grdraw pt1 pt 255)
- (setq pt0 pt)
- )
- ((or (= 3 (car gr)) (= 32 (cadr gr)))
- (setq loop nil)
- (setq pt (polar pt1 (angle pt1 pt) (- (distance pt1 pt) (/ zg 3))))
- (command pt "")
- (redraw)
- )
- )
- )
-
-
-
- )
- ;;-------------------------------------------------
|