TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: KewlToyZ on April 01, 2009, 06:38:50 PM

Title: Riddle me this BATTMAN... =P
Post 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.
Title: Re: Riddle me this BATTMAN... =P
Post by: MP on April 01, 2009, 06:54:49 PM
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

Title: Re: Riddle me this BATTMAN... =P
Post by: KewlToyZ on April 03, 2009, 01:47:39 PM
OK so far I am just getting the list of blocks:
Code: [Select]
;; 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.
Title: Re: Riddle me this BATTMAN... =P
Post by: CAB on April 03, 2009, 10:26:50 PM
Reading material 8-)
http://www.theswamp.org/index.php?topic=1173.0
and this
http://www.theswamp.org/index.php?topic=16987.msg205912#msg205912
Title: Re: Riddle me this BATTMAN... =P
Post by: KewlToyZ on April 06, 2009, 11:08:47 AM
Thanks CAB, I really needed it  :wink: