Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Summarizing all blocks by their name into a table or a list.

  1. #11
    Active Member
    Join Date
    2012-06
    Posts
    85
    0 Did you find this post helpful? Yes

    Default Re: Summarizing all blocks by their name into a table or a list.

    Thank you, that worked very well.

  2. #12
    Active Member
    Join Date
    2012-06
    Posts
    85
    0 Did you find this post helpful? Yes

    Default 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
    Last edited by vladimir.karatsupa982899; 2014-07-24 at 09:54 PM.

  3. #13
    Member
    Join Date
    2006-07
    Posts
    30
    0 Did you find this post helpful? Yes

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

  4. #14
    Active Member
    Join Date
    2012-06
    Posts
    85
    0 Did you find this post helpful? Yes

    Default Re: Summarizing all blocks by their name into a table or a list.

    Quote Originally Posted by cadhelp Van View Post
    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?

  5. #15
    Active Member
    Join Date
    2012-06
    Posts
    85
    0 Did you find this post helpful? Yes

    Default 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 View Post
    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)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Table List for Non SS Drawings
    By CADdancer in forum AutoCAD Sheet Set Manager
    Replies: 1
    Last Post: 2010-01-29, 05:07 PM
  2. Replies: 1
    Last Post: 2006-12-12, 07:36 AM
  3. Replies: 1
    Last Post: 2006-10-13, 04:58 PM
  4. Sheet List Table
    By pangell in forum ACA General
    Replies: 2
    Last Post: 2006-02-01, 07:04 PM
  5. Sheet List Table
    By afortier in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2005-06-01, 10:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •