Re: Summarizing all blocks by their name into a table or a list.
Thank you, that worked very well.
Re: Summarizing all blocks by their name into a table or a list.
Can we somehow modify the code to display the list in the table in an alphabetical order?
And lastly...the routine will be picking up some of the blocks that have attributed text within. Specifically the attributed text will be number of feet. As the routine adds up the quantity of blocks is there a way for it to add up all the number of feet as well?
For example:
Block-A 123 ft
Block-A 456 ft
Block-B
Block-C
The table should look like this:
Unit Name.......QTY....FEET
Block-A.............2...... 579
Block-B.............1
Block-C.............1
Re: Summarizing all blocks by their name into a table or a list.
Have you ever tried autocad command "dataextraction" ?
It can sort and create a file or autocad table.
Re: Summarizing all blocks by their name into a table or a list.
Quote:
Originally Posted by
cadhelp Van
Have you ever tried autocad command "dataextraction" ?
It can sort and create a file or autocad table.
No I haven't how would I be able to extract attribute info?
Re: Summarizing all blocks by their name into a table or a list.
How can I modify the TableFontStyle in tis routine?
I tried creating a text style (xyz) and then referencing the style in (tblobjname "STYLE" "xyz") but nothing seems to change. Why is that so. I would like the text style xyz to be arial with the height of the text predetermined in text style xyz
Please help
Quote:
Originally Posted by
Tharwat
Try this .
Code:
(defun c:Test (/ WriteAndSet columns e ss l hgt inc ins rows p r tbl)
;; Tharwat 23. May. 2014 ;;
(if l
(progn
(setq hgt
(if
(zerop
(cdr
(assoc
40
(setq
e (entget (tblobjname "STYLE" (getvar 'textstyle)))
)
)
)
)
(* (getvar 'textsize) 2.0)
(* (cdr (assoc 40 e)) 2.0)
)
columns 2
r 2
)
(if (setq ins (getpoint "\n Specify Table Location :"))
(progn
(setq
tbl (vla-addtable
(vlax-get
(vla-get-activelayout
(vla-get-activedocument (vlax-get-acad-object))
)
'BLOCK
)
(vlax-3d-point ins)
(+ (length l) 2)
columns
(* hgt 1.5)
(* hgt 1.5)
)
)
(setq inc -1)
(repeat 2
(vla-setcolumnwidth tbl (setq inc (1+ inc)) (* hgt 5.))
)
(vla-setrowheight tbl 0 (* hgt 1.5))
(vla-setrowheight tbl 1 (* hgt 1.5))
(vla-settext
tbl
0
0
(strcat "Blocks Quantity")
)
(vla-setcolumnwidth tbl 0 (* hgt 10.))
(vla-setcolumnwidth tbl 1 (* hgt 4.5))
(vla-settext tbl 1 0 "Block Name")
(vla-settext tbl 1 1 "QTY")
)
)
(defun WriteAndSet (col row string)
(vla-settext tbl row col string)
(vla-setcellalignment tbl row col acMiddleCenter)
)
(foreach x l
(WriteAndSet 0 r (car x))
(WriteAndSet 1 r (cadr x))
(setq r (1+ r))
)
)
)
(princ)
)
(vl-load-com)