magicheno 发表于 2021-9-21 13:21:08

连续复制如何实现拖动预览的那种效果

研究了好几天总算拼拼凑凑出一点效果,但是还是不是很完美,请教大神们,下面的程序能否再实现拖动预览的那种效果,目前的程序实现不了呢,研究了好久没研究出来
(defun c:tt5(/ oce ss p1 p2)
(setq n1 10)
(defun *error* (msg)
    (if ss (sshighlight ss 4)) ;取消亮显
    (SSSETFIRST NIL)
    (princ "error:")
    (princ msg)
)
(setq oce(getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ss (ssget))
   (if (< (sslength ss) n1)(SSSETFIRST NIL SS))
   (sshighlight ss 3)
(if (null ss) (exit))
(setq p0(getpoint"\n指定基点:"))
(setq p2 p0)
(if (null p0 )(exit))
(princ "\n指定第二点或位移:")
(while t
(setq p1(getpoint p0))
(setq ent (entlast))
(if (null p1) (mosi11) (mosi12))
(setq tempss ss)
(setq ss (entbackss ent))
(setq p2 (getvar "lastpoint"))
   (vl-cmdf ".copy" ss "")
(command)
   (command "select" ss "")
   (sshighlight ss 3)
)      
(princ)
)
(defun mosi12()
(vl-cmdf ".copy" ss "" p2 p1 )
(setq juli (distance p0 p1))
(setqx0 (car p0))
(setqy0 (cadr p0))
(setq p0 p1)
(setqx1 (car p1))
(setqy1 (cadr p1))
(setqx (- x1 x0))
(setqy (- y1 y0))
(setq   hudu(atan y x) )
(setqx1 (+ x0 x))
(setqy1 (+ y0 y))
(setqp1 (list x1 y1 0.0))
(princ (strcat "\n指定下一点或继续位移<" (rtos juli ) ">:"))
)
(defun mosi11()
       (setq p1 (list (+ (nth 0 p0) (* juli (cos hudu)))
                      (+ (nth 1 p0) (* juli (sin hudu)))
                      (nth 2 p0)
                )
       )
(vl-cmdf ".copy" ss "" p2 p1 )
(setq juli (distance p0 p1))
(setq p0 p1)
(princ (strcat "\n指定下一点或继续位移<" (rtos juli ) ">:"))
)

langjs 发表于 2021-9-21 13:21:09

我给你的程序不能用?怎么又发了一遍?

magicheno 发表于 2021-9-22 19:11:53

langjs 发表于 2021-9-22 18:13
我给你的程序不能用?怎么又发了一遍?

没有重新发呢,这个是21号中午发的,在你那个之前发出来的
页: [1]
查看完整版本: 连续复制如何实现拖动预览的那种效果