Create a Map/Table of my Blocks

Create a Map/Table of my Blocks

KurtzDavid
Enthusiast Enthusiast
373 Views
3 Replies
Message 1 of 4

Create a Map/Table of my Blocks

KurtzDavid
Enthusiast
Enthusiast

Hello,

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).

a tool like this will help me to maintenance my block library (Standard Naming convention, Blocks layers & Weight)

Thanks in advance,

David.

0 Likes
374 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

@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
0 Likes
Message 3 of 4

KurtzDavid
Enthusiast
Enthusiast
Hello Kent,
Thanks for your answer.
I'm trying to avoid getting into development of the tool (Since I hope there is some of the shelve tools).
I will let this post to hang for few more days and if an answer will not arise then I'll develop the tool myself.
If I'll develop the tool then I'll put here a link to it so you could download it if you ever need it.
(Since you wrote that your tool is "Not fully developed")

Best regards,
David.
0 Likes
Message 4 of 4

3wood
Advisor
Advisor

You can try BLOCKOUT to write blocks in current drawing to a library directory, then use LISTBLOCK to create block schedule(s) in that directory.

0 Likes