Lets start with some code. Here is my code that collects all blocks for a panel and then produce a list of blocks and counts elements of equal length.
(defun c:cutlist nil (cutlist))
(defun cutlist ( / ss i e eo blocknames lens block_list len_list);
(defun LM:unique (lst)(if (and lst) (cons (car lst) (LM:unique (vl-remove (car lst) (cdr lst))))))
(defun LM:getdynpropvalue ( blk prp )
(setq prp (strcase prp))
(vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
(vlax-invoke blk 'getdynamicblockproperties)
)
)
(princ "\nSelect a panel inside closing window >")
(setq ss (ssget '((0 . "insert") (8 . "C16 TIMBER"))))
(setq i 0)
(repeat (sslength ss)
(setq e (ssname ss i) eo (vlax-ename->vla-object e))
(if (vlax-property-available-p eo 'effectivename)
(setq blocknames (cons (vlax-get eo 'effectivename) blocknames))
)
(setq i (+ i 1))
)
(setq blocknames (LM:unique blocknames) len_list (list) block_list (list))
(foreach block blocknames
(setq i 0 lengthlist nil)
(repeat (sslength ss)
(setq e (ssname ss i) eo (vlax-ename->vla-object e))
(if (vlax-property-available-p eo 'effectivename)
(if (= (vlax-get eo 'effectivename) block)
(setq lengthlist (cons (lM:getdynpropvalue eo "Distance1") lengthlist))
)
)
(setq i (+ i 1))
)
(setq lens (LM:unique lengthlist) i 0 cnt 0)
(foreach len lens
(repeat (length lengthlist)
(if (= len (nth i lengthlist)) (setq cnt (+ cnt 1)))
(setq i (+ i 1))
)
(setq len_list (append len_list (list(list len cnt))))
(setq i 0 cnt 0 )
)
(setq block_list (append block_list (list(list block len_list))) len_list (list) )
)
block_list
)
When run on your sample it produces following list in a format
Block name - list of unique length for that block and its number
(
("1. Timber - Blue Interlocking Flexible Length" ((2275.0 2) (4540.84 1)))
("1. Timber - Flexible Length" ((4360.84 5) (2275.0 3) (92.5 3) (555.0 6)
(487.5 3)))
("1. Timber - 245 Cripple Stud Flexible" ((4360.84 8))))
This can be converted to a table. Procedure requires precise drafting as well.
Miljenko Hatlak

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.