难道EXTRIM命令不香吗?
是的,只能单个 czb203 发表于 2024-8-19 18:29
是这样的效果吗
可以私聊报价 如果出头一样长
;;;线缩短
(defun c:lsc (/ os l ss n en pt1 pt2 i l1)
(setvar "CMDECHO" 0)
(setq os (getvar "OSMODE"))
(setvar "OSMODE" 0)
(if (null ***l***)
(setq ***l*** "100")
)
(setq l (getreal (strcat "\n伸长量<" ***l*** ">:")))
(if (null l)
(setq l (atof ***l***))
)
(if (= l (fix l))
(setq ***l*** (rtos l 2 0))
(progn (setq i0
l1 l
)
(while (/= l1 (fix l1))
(setq l1 (* l (expt 10 i))
i(1+ i)
)
)
(setq ***l*** (rtos l 2 (1- i)))
)
)
(setq ss (ssget '((0 . "lwpolyline,line,arc"))))
(repeat (setq n (sslength ss))
(setq en(ssname ss (setq n (1- n)))
pt1 (vlax-curve-getstartpoint en)
pt2 (vlax-curve-getendpoint en)
)
(command "lengthen" "de" l (list en pt1) (list en pt2) "")
)
(setvar "OSMODE" os)
(princ)
)
----------------------------------------------------- 这个需求实际上是建多个选择集的外轮廓线,然后用这些外轮廓线进行“extrim”的工作
夏生生 发表于 2024-8-20 12:01
如果出头一样长
这个不太可以 lml2023 发表于 2024-8-21 09:53
这个不太可以
乞丐版,自己改一下吧,不会改就凑合着用
(defun c:ttt(/ area en lst n obj obj1 old pt1 pt2 ss)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(prompt "\n选择外框:")
(setq ss (ssget '((0 . "lwpolyline") (8 . "1")))) ;_无例图,假设边界图层为1
(repeat (setq n (sslength ss))
(setq en (ssname ss (setq n (1- n)))
obj(vlax-ename->vla-object en)
area (vla-get-area obj))
(setq obj1 (car (vlax-safearray->list
(vlax-variant-value (vla-offset obj 1))))) ;_无例图,假设边界偏移1为宜
(if (< (vla-get-area obj1) area)
(progn (vla-delete obj1)
(setq obj1 (car (vlax-safearray->list
(vlax-variant-value (vla-offset obj -1))))))) ;_无例图,假设边界偏移1为宜
(setq lst (vl-remove-if-not '(lambda (x) (= 10 (car x)))
(entget (vlax-vla-object->ename obj1)))
lst (mapcar 'cdr (cons (last lst) lst)))
(vla-getboundingbox obj1 'pt1 'pt2)
(vla-delete obj1)
(command "zoom"
(vlax-safearray->list pt1)
(vlax-safearray->list pt2))
(command "trim" en "" "f")
(foreach n lst (command n))
(command "" "")
(command "zoom" "p"))
(setvar "osmode" old)
(princ)) 夏生生 发表于 2024-8-21 16:02
乞丐版,自己改一下吧,不会改就凑合着用
en,我最终选择生成中线出头100,然后用全打断,快速选择<300的线头,即可解决
页:
1
[2]