Author Topic: Riddle me this BATTMAN... =P  (Read 2111 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
Riddle me this BATTMAN... =P
« 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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Riddle me this BATTMAN... =P
« Reply #1 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

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

KewlToyZ

  • Guest
Re: Riddle me this BATTMAN... =P
« Reply #2 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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
« Last Edit: April 03, 2009, 10:30:03 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: Riddle me this BATTMAN... =P
« Reply #4 on: April 06, 2009, 11:08:47 AM »
Thanks CAB, I really needed it  :wink: