@KurtzDavid wrote:
....I'm looking for a tool that will create a table of a size that I will define and in each cell of the table the tool will insert and explode a nested block from a library with its block name (and then loop through all the nested blocks in the library). ....
Here's something I worked up a few years ago that's not fully developed but may at least get you started. It only Inserts them [doesn't add the name, doesn't Explode], and it spaces them based on their individual sizes rather than in table-like regular spacing, and it uses the drawing limits for the defining width to determine when to step up to a new row above, so you would need to size a drawing appropriately for the kinds of Blocks involved. But it includes some aspects you can probably utilize -- navigation to the folder where the Blocks are that you want to chart, stepping through all Blocks in that folder and Inserting one of each.
(defun C:BC (/ blkfolder space nextLL rowht rowL blkLL blkUR objwid objht); = Block Chart
(vl-load-com)
(setvar 'osmode 0)
(alert "Pick OK here, then double-click any file in desired folder: ")
(setq
blkfolder (getfiled "Find folder" "" "dwg" 0)
blkfolder (substr blkfolder 1 (1+ (vl-string-position 92 blkfolder 1 T))); path without dwg name
space 1 ; between blocks and min. from limits <------ set as desired
nextLL (mapcar '+ (getvar 'limmin) (list space space 0)); lower left of next block
rowht 0 ; height of tallest block in row
rowL nextLL; left end of baseline of row
); end setq
(foreach blk (vl-directory-files blkfolder "*.dwg" 1)
(command "_.insert" (strcat blkfolder blk) (getvar 'viewctr) "" "" "")
(vla-getboundingbox (vlax-ename->vla-object (entlast)) 'minpt 'maxpt)
(setq
blkLL (vlax-safearray->list minpt)
blkUR (vlax-safearray->list maxpt)
objwid (- (car blkUR) (car blkLL))
objht (- (cadr blkUR) (cadr blkLL))
)
(if (> (+ (car nextLL) objwid space) (car (getvar 'limmax)))
(setq ; then - start new row above previous row
nextLL (polar rowL (/ pi 2) (+ rowht space))
rowL nextLL
rowht 0
); end setq
); end if - no else [next in current row]
(command "_.move" (entlast) "" blkLL nextLL)
(setq nextLL (polar nextLL 0 (+ objwid space)))
(if (> objht rowht) (setq rowht objht))
); end foreach
); end defun
Kent Cooper, AIA