lisp用于更改多段线宽度
我需要修改我找到的lisp:http://forums.augi.com/showthread.php?133428-块内的多段线宽度将嵌套块中的多段线宽度更改为0的步骤
(定义c:pib(/秒)
(vl load com)
(princ“\n选择具有多段线的块”)
(if(and(setq s(ssget“+:s”((0。“insert”)))
(setq s(cdr(assoc 2(entget(ssname s 0Ю)Ю))))
) ;_和
(程序
(vlax代表
o
(vla项目(vla get blocks
(vla get ActiveDocument(vlax get acad object))
) ;_vla获取块
s
) ;_vla项目
;;(setq o(vla item(vla item(vla get blocks(vla get ActiveDocument(vlax get acad object)))s)0)
(if(=(vla get objectname o)“AcDbPolyline”)
(vl catch all apply‘vla put ConstantWidth(列表0))
) ;_如果
) ;_vlax for
(foreach x(mapcar(功能cadr))
(ssnamex(ssget“_x”(列表(cons 2 s)))
) ;_地图车
(vla更新(vlax ename->vla对象x))
) ;_foreach公司
) ;_程序
) ;_如果
(普林斯)
)
但是我想处理嵌套块,有可能吗?
谢谢 有两件事你可能已经说过了,但值得重复。
1.如果已知(在本例中是已知的),由您以外的其他人编写的代码应归于发起者,在本例中是Lee Mac。
2.论坛中发布的代码,除非是代码的图像,否则应包含在代码标签中。
如果你不明白,那就去问。 对不起,如果我省略了代码作者的名字:
代码由:Lee Mac编写
代码:
(defun c:polywidthzero(/doc)(vlax表示块(vla get blocks(setq doc(vla get activedocument(vlax get acad object))))(if(eq:vlax false(vla get isxref block))(vlax表示obj块(if(eq“AcDbPolyline”(vla get objectname obj))(vl catch all apply‘vla put constantwidth(list obj 0)))))(vla regen doc acallviewports)(princ))(vl load com)(princ) 请阅读代码发布指南,并编辑代码以包含在代码标签中。
Your Code Here=
Your Code Here =
(defun c:pib (/ s)
(vl-load-com)
(princ "\n Select the block with a polyline")
(if (and (setq s (ssget "_+.:S" '((0 . "insert"))))
(setq s (cdr (assoc 2 (entget (ssname s 0)))))
) ;_and
(progn
(vlax-for
o
(vla-item (vla-get-blocks
(vla-get-ActiveDocument (vlax-get-acad-object))
) ;_vla-get-blocks
s
) ;_vla-item
;;(setq o (vla-item (vla-item (vla-get-blocks (vla-get-ActiveDocument(vlax-get-acad-object))) s)0))
(if (= (vla-get-objectname o) "AcDbPolyline")
(vl-catch-all-apply 'vla-put-ConstantWidth (list o 0.))
) ;_if
) ;_vlax-for
(foreach x (mapcar (function cadr)
(ssnamex (ssget "_x" (list (cons 2 s))))
) ;_mapcar
(vla-update (vlax-ename->vla-object x))
) ;_foreach
) ;_progn
) ;_if
(princ)
)
页:
[1]