明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 544|回复: 2

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

[复制链接]
发表于 2021-9-21 13:21 | 显示全部楼层 |阅读模式
5明经币
研究了好几天总算拼拼凑凑出一点效果,但是还是不是很完美,请教大神们,下面的程序能否再实现拖动预览的那种效果,目前的程序实现不了呢,研究了好久没研究出来
(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))
(setq  x0 (car p0))
(setq  y0 (cadr p0))
(setq p0 p1)
(setq  x1 (car p1))
(setq  y1 (cadr p1))
(setq  x (- x1 x0))
(setq  y (- y1 y0))
(setq   hudu(atan y x) )
(setq  x1 (+ x0 x))
(setq  y1 (+ y0 y))
(setq  p1 (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 ) ">:"))
)

附件: 您需要 登录 才可以下载或查看,没有账号?注册

最佳答案

查看完整内容

我给你的程序不能用?怎么又发了一遍?
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2021-9-21 13:21 | 显示全部楼层
我给你的程序不能用?怎么又发了一遍?
回复

使用道具 举报

 楼主| 发表于 2021-9-22 19:11 | 显示全部楼层
langjs 发表于 2021-9-22 18:13
我给你的程序不能用?怎么又发了一遍?

没有重新发呢,这个是21号中午发的,在你那个之前发出来的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-10 23:22 , Processed in 0.149175 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表