Hello,
I hope you can help me with this.
For example if I have in a single drawing large number of polylines with different width, large number of blocks with polylines (with different width), and I want for all of polylines width to be set to 0, how can I do that. For those polylines that are not in block is easy, but for those polylines in block .... I got a problem.
On some other forum I found this code that works fine for block, but one at the time ...
How can we tweak this code to work for number of blocks?
code:
PHP Code:
(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)
)