ps122hb 发表于 2012-6-19 08:22:56

路过,学习了,不过一般情况不会有这种批量操作吧

缘份呐 发表于 2012-6-19 09:13:08

ps122hb 发表于 2012-6-19 08:22 static/image/common/back.gif
路过,学习了,不过一般情况不会有这种批量操作吧

谢谢发表,或许专业不同吧。

石井鱼 发表于 2012-6-19 10:28:33

感谢楼主,试用了下,只能用于双边延伸,有没有单侧批量延伸的呢,柱编号引线的时候经常用到这个功能

缘份呐 发表于 2012-6-20 16:13:14

石井鱼 发表于 2012-6-19 10:28 static/image/common/back.gif
感谢楼主,试用了下,只能用于双边延伸,有没有单侧批量延伸的呢,柱编号引线的时候经常用到这个功能

单侧批量延伸这个我有考虑,可方向不好定。
也希望有高手给个思路。谢谢

yjr111 发表于 2012-6-20 21:59:16

本帖最后由 yjr111 于 2012-6-20 22:10 编辑

可选择边延伸
(defun c:doublextend (/ss e n p1 p2 extendpoint )
(setq oldosmode (getvar "osmode"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(if *dist*
(setq dist (getdist (strcat "\n请输入每边变化值:< " (rtos *dist* 2 0) ">")))
(setq dist (getdist "\n请输入每边变化值: "))
)
(if (not dist)(setq dist *dist*)(setq *dist* dist))
(princ "\n请选择延伸对象:")
(while(setq ss(ssget '((0 . "LINE,ARC,LWPOLYLINE"))))
(setq extendpoint(getpoint"\n选择要延伸的一边<右键双边延伸>"))
(while(and ss (>(setq n(sslength ss))0))
(setq e(ssname ss (setq n(1- n)))

hhhlike 发表于 2012-6-21 07:01:04

还是不能选择方向
错误: 参数类型错误: 二维/三维点: nil

yjr111 发表于 2012-6-21 09:13:23

hhhlike 发表于 2012-6-21 07:01 static/image/common/back.gif
还是不能选择方向
错误: 参数类型错误: 二维/三维点: nil

(defun c:doublextend (/ss e n p1 p2 extendpoint)
(setq oldosmode (getvar "osmode"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(if *dist*
(setq dist (getdist (strcat "\n请输入每边变化值:< " (rtos *dist* 2 0) ">")))
(setq dist (getdist "\n请输入每边变化值: "))
)
(if (not dist)(setq dist *dist*)(setq *dist* dist))
(princ "\n请选择延伸对象:")
(while(setq ss(ssget '((0 . "LINE,ARC,LWPOLYLINE"))))
(setq extendpoint(getpoint"\n选择要延伸的一边<右键双边延伸>"))
(while(and ss (>(setq n(sslength ss))0))
(setq e(ssname ss (setq n(1- n)))
       p1 (vlax-curve-getstartpoint e )
       p2 (vlax-curve-getendpoint e )
       )
(cond((not extendpoint)
      (command "lengthen""de"(/ dist 2) (list e p1)"" )
      (command "lengthen""de"(/ dist 2) (list e p2)"" )
      )
       ((=(type extendpoint)'list)
      (if (<(distance p1(vlax-curve-getClosestPointTo e extendpoint))
                           (distance p2(vlax-curve-getClosestPointTo e extendpoint))
                           )
      (command "lengthen""de"(/ dist 2) (list e p1)"" )
      (command "lengthen""de"(/ dist 2) (list e p2)"" )
      )
      )
      )
(ssdel e ss)
)
)
(setvar "osmode" oldosmode)
(princ)
)
(princ"\n 批量双边延长缩短,BY YJR111 2012-6-19.命令:doublextend")

flytoday 发表于 2012-6-21 10:17:04

有图为证~~

flytoday 发表于 2012-6-21 13:23:15

本帖最后由 flytoday 于 2012-6-21 13:24 编辑

flytoday 发表于 2012-6-21 10:17 http://bbs.mjtd.com/static/image/common/back.gif
有图为证~~

6#楼有哦~。。严哥还有其它的线也是只单边延伸

缘份呐 发表于 2012-6-21 13:32:57

yjr111 发表于 2012-6-21 09:13 static/image/common/back.gif


好象不支持R14呀!上班只用R14。
页: 1 [2] 3
查看完整版本: 沿上次继续改进,线段和圆弧批量伸长或缩短