- 积分
- 14013
- 明经币
- 个
- 注册时间
- 2013-9-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 荒野孤行 于 2015-6-26 21:57 编辑
将线段等分后,由于中间要留有间隙,那么左右两边的尺寸就相对中间的大了一点,这样就不算是完全的等分了,所以。。。
已集成在WDY工具箱:http://bbs.mjtd.com/thread-108389-1-1.html
;;;*****十线九隙 程序开始*****
(defun c:sxjx (/ sel len)
(setvar "osmode" 15359)
(setvar "cmdecho" 0)
(princ
"\n★功能:对直线、多段线在指定距离上进行等距偏移且间距相等.\n"
)
(command "undo" "be")
(while
(progn (setq sel (entsel "\n请点选直线、多段线:\n"))
(not (if (= sel nil)
nil
(wcmatch (cdr (assoc 0 (entget (car sel))))
"LWPOLYLINE,POLYLINE,LINE"
)
)
)
)
(princ
"\n提示:选取的不是直线、多段线或未选取任何图元,请重新点选:\n"
)
)
(initget 7)
(setq len (getdist "\n指定总线长:"))
(princ (strcat "\n★当前总线长为:" (rtos len 2)))
(if (not backup_gap)
(setq backup_gap 0.03)
)
(initget 6)
(if (not (setq gap (getdist (strcat "\n指定间距:<"
(rtos backup_gap 2)
">"
)
)
)
)
(setq gap backup_gap)
)
(setq backup_gap gap)
(princ (strcat "\n★当前间距为:" (rtos gap 2)))
(initget 6)
(if (not (setq npy (getint "\n等分数<10>:\n")))
(setq npy 10)
)
(setq len (/ (- len (* (- npy 1) gap)) npy))
(initget 1)
(setq pt1 (getpoint "\n指定偏移方向:\n"))
(setvar "osmode" 0)
(setq len1 len
gap1 gap
)
(repeat (- npy 1)
(command "OFFSET" len sel pt1 "")
(setq gap (+ gap1 len))
(command "OFFSET" gap sel pt1 "")
(setq len (+ len1 gap))
)
(command "OFFSET" len sel pt1 "")
(setvar "osmode" 15359)
(command "undo" "e")
(princ)
)
;;;*****十线九隙 程序结束*****
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
评分
-
查看全部评分
|