TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: KewlToyZ on April 01, 2009, 06:38:50 PM
-
If I want to update every possible block name in a drawing that has a specific tag name with a new Default Contents in AutoLisp, where would I begin?
I can see all of these block names and the oddball versions of them with DXF names as well in BATTMAN.
It looked like they all update from one shot in BATTMAN but I found a few still get by with the old contents.
-
if I understood you correctly
walk the blocks collection
walk each block's collection
if it's an attribute
if it's tag meets spec
update default value
-
OK so far I am just getting the list of blocks:
;; walk the blocks collection
;;====================================================================
(defun c:blocks (/ blox bname title)
(vlax-for blox
(vla-get-blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
(setq title (vla-get-name blox) )
(princ "\n______________________________________________________Block Name\n")
(princ title)
)
)
Next I'm going to try for the attributes with each block.
I'm going around this to try and see how to get to each portion and see what shows up first.
-
Reading material 8-)
http://www.theswamp.org/index.php?topic=1173.0
and this
http://www.theswamp.org/index.php?topic=16987.msg205912#msg205912
-
Thanks CAB, I really needed it :wink: