- (defun SSDrag_Move (ss pt) (ssDrag ss pt ".Move"))
- ;; (defun SSDrag_Rotate (ss pt) (ssDrag ss pt ".Rotate"))
- (defun SSDrag (ss pt DragCommand / get-ss ss2 e cmdecho ret catchit)
- (Defun get-ss (e / ss ep)
- (setq ss (ssadd)
- ep e
- )
- (if (not ep)
- (setq ep (entnext))
- )
- (while (/= (setq ep (entnext ep)) nil) (ssadd ep ss))
- ss
- )
- ;; ssdrag main:
- (setq cmdecho (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq e (entlast))
- (command "_.copy" ss "" "_non" "0,0,0" "_non" "0,0,0")
- (setq ss2 (get-ss e))
- (setq
- catchit (vl-catch-all-apply
- (function
- (lambda ()
- (command DragCommand ss2 "" pt)
- (while (/= "" (getvar "cmdnames")) (command pause))
- (setq ret (getvar "lastpoint"))
- (setvar "cmdecho" 0)
- (command "_.erase" ss2 "")
- (setvar "cmdecho" cmdecho)
- ret
- )
- )
- nil
- )
- )
- (if (vl-catch-all-error-p catchit)
- (progn
- (command "_.erase" ss2 "")
- (setvar "cmdecho" cmdecho)
- nil
- )
- ret
- )
- )
自认为比飞兄的效果理想一点~~直接用的Move。原计划把Rotate,Scale形式的拖动也写进去的,不成功。哪位有好的办法和思路,拿出来讨论讨论。 |