Lispboy 发表于 2016-5-12 21:03:53

(XD::Drag:SimpleMove)基本的移动或拷贝选择集



(defun XD::Drag:SimpleMove (ss info baseptflag tf / dynpt lastpnt myerr olderr)
(defun _callback (dynpt)
    (xdrx_entity_move ss lastpnt dynpt)
    (setq lastpnt dynpt)
)
(defun myerr (msg)
    (princ "\nCancel")
    (xdrx_end)
    (vl-cmdf ".undo" 1)
    (setq *error* olderr)
)
(setq olderr *error*)
(setq *error* myerr)
(xdrx_begin)
(if (or
      (< baseptflag 1)
      (> baseptflag 9)
      )
    (setq baseptflag 5)
)
(setq lastpnt (xd::geom:get9pt ss baseptflag))
(if (not tf)
    (setq ss (xdrx_entity_copy ss))
)
(xdrx_pointmonitor "_callback" ss)
(initget 1)
(getpoint info)
(xdrx_pointmonitor)
(xdrx_end)
(setq *error* olderr)
ss
)


eachy 发表于 2016-5-12 22:02:07

多了一份copy吧

eachy 发表于 2016-5-12 22:02:12

多了一份copy吧

Lispboy 发表于 2016-5-12 22:09:29

eachy 发表于 2016-5-12 22:02
多了一份copy吧

哪里多了? 两种模式,COPY的时候先 COPY下选择集,然后移动这个选择集。

eachy 发表于 2016-5-12 22:17:30

Lispboy 发表于 2016-5-12 22:09
哪里多了? 两种模式,COPY的时候先 COPY下选择集,然后移动这个选择集。

只看了名称 move ,少看了个 tf 参数(move/copy)

xxxxxxxxx123 发表于 2016-8-26 12:19:02

:):):):)些学医学习

striver 发表于 2024-1-24 17:40:13

这个函数实用价值较大,感谢分享。
页: [1]
查看完整版本: (XD::Drag:SimpleMove)基本的移动或拷贝选择集