明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2261|回复: 0

请求完善下面程序,把块也能进行多重偏移,谢谢!

[复制链接]
发表于 2010-7-30 16:51:00 | 显示全部楼层 |阅读模式
;;多重偏移
(defun c:test ()
(setvar "cmdecho" 0)
(setq pyd (getvar "offsetdist"))
(setq pyd (abs pyd))
(setq str_1 (strcat "\n偏移距离<" (rtos pyd) ">:"))
(setq pydi (getreal str_1))
(if (null pydi) (setq pydi pyd))
(setq npy (getint "\n偏移次数<9>:"))
(if (null npy) (setq npy 9))
(setq en (car (entsel "\n选择对象:")))
(setq pt1 (getpoint "\n指定点以确认偏移方向:"))
(setq i 1)
(repeat npy
(setq pydis (* i pydi))
(command "offset" pydis en pt1 "")
(setq i (1+ i))
)
(setvar "offsetdist" pydi)
(prin1)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-2-27 17:15 , Processed in 0.166918 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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