- 积分
- 3188
- 明经币
- 个
- 注册时间
- 2012-5-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
1明经币
本帖最后由 半听可乐 于 2012-8-28 10:39 编辑
记忆移动程序,美中不足的是默认正交模式,能不能改一下?
承蒙楼下Andyhon 兄出手正交问题已解决, (setvar "orthomode" 1)改为 (setvar "orthomode"0)之后,如果移动较远则前后移动的图元会错位,即便在源程序上临时切换正交模式也会出现同样问题,这是为什么呢?
;;;-------------------------------------------------------------------------------------------------------------------
;;; ★DB_REMMOVE 记忆移动,定向定距移动(默认正交,待修改)
;;; By luyu9635 2012.06深圳
;;;-------------------------------------------------------------------------------------------------------------------
(defun c:DB_REMMOVE (/ ss p1 p2 mbd gr temp)
(setvar "orthomode" 1)
(if (not movedist)
(setq movedist 3)
)
(if (not moveang0)
(setq moveang0 pi)
)
(if (setq ss (ssget)
p1 (getpoint "\n指定基点:")
)
(progn
(initget 128)
(setq
p2 (getpoint p1 (strcat "\n指定第二点<" (rtos movedist) ">:"))
)
(cond ((= (type p2) 'LIST);鼠标点,直接到鼠标点位
(setq moveang0 (angle p1 p2))
(setq movedist (distance p1 p2)
mbd (polar p1 moveang0 movedist)
)
)
((= (type p2) 'STR);键盘输入,按象皮筯方向移动
(setq gr(cadr(grread 1)))
(if (> (abs (- (car gr)(car p1))) (abs (- (cadr gr)(cadr p1))))
(setq temp(list (car gr)(cadr p1)))
(setq temp(list (car p1)(cadr gr)))
)
(setq moveang0 (angle p1 temp))
(setq movedist (atof p2)
mbd (polar p1 moveang0 movedist)
)
)
((= (type p2) nil);空格,默认上次的方向和距离
(setq mbd (polar p1 moveang0 movedist))
)
)
(command "move" ss "" p1 mbd)
)
)
(princ)
)
|
附件: 您需要 登录 才可以下载或查看,没有账号?注册
最佳答案
查看完整内容
1#
(command "move" ss "" p1 mbd)
==>
(command "move" ss "" "none" p1 "none" mbd)
|