Extracting info for a table of contents

I have several drawings for which I am attempting to create a master table of contents. I was hoping I could just use an attribute extractor to get the information from the titleblock. I was using lee Mac's excellent tool for this. However, it does not extract the name of the tab that the title block is located on, and the sequence is not in order anyway. Note that even on the Page Layout from the Explorer is not sorted by how they are organized. Rather, I suspect that they are listed in the order they were created.

In my search for an automatic solution, I used the Publish function to generate a .dsd file, and then opening that in Word, and by using Search/replace I was able to make a list that I can paste in to Excel, to create my Table of Contents. However, in addition to the issue that the order is wrong, this list doesn't have all the information I need. My names of the layout tabs are normally just a very abbreviated summary of what the title of the drawing is. So, I can't even use an Excel Hlookup function to somehow combine the list of list of title blocks. with the list of layouts

Any suggestions?

-Joe

Comments

  • I am evaluating if it is within my skill set to modify an existing block/attribute extraction utility to add the information saying what tab a title block is located. It would probably be a LISP routine.

    It would also somehow have to be correlated with the order of the tabs. So, simply the name of the tab is not enough. Even the list of page set-ups is not in the order of the tabs. (note that I am on v14, so I don't know what the current version does).

    I might do this in a somewhat manual approach, if I can somehow just extract the names of the tabs, and their sequence, then I can use my Excel knowledge to sort the list of block names and get them in the order of the tabs. But, I don't know where to even start.

    Any advice?

    -joe

  • In LISP you can use layoutlist to return a list of the current layouts.
    (LAYOUTLIST) ("Layout1" "Layout2" "Layout3")

    However, this doesn't necessarily return in the order they have been positioned. I believe Roy has spoken to this previously on this forum.

    For a command base alternative you could look at using SHEETSETS. This includes an option to generate a table of included sheets. In V19 I think the table now automatically updates with changes.

    Regards,
    Jason Bourhill
    CAD Concepts


    Come to the Australasia BricsCAD Conference


  • You could also take a look at DATAEXTRACTION to extract info out to a spreadsheet, manipulate it how you want, then paste back in as a TABLE.

    Regards,
    Jason Bourhill
    CAD Concepts


    Come to the Australasia BricsCAD Conference


  • Thank you both.

    -Joe
  • @Jason Bourhill said:
    You could also take a look at [DATAEXTRACTION]

    I don't have that in my v14, but did look over the help file. But, it does not seem to indicate which layout it is on, nor have I see any way to see on which layout a layout is located. I see that if I simply use LIST to list a title-block, it will indicate if it is in model space or paper space, but even if it is in paperspace, it does not indicate which of them it is on.

    -Joe

  • Joe,
    The Layout a block resides on is saved as a DXF value in the block

    For instance, the selected block in this data holds
    (410 . "Layout1")
    indicating it resides on Tab "Layout1"

    I don't know which "excellent tool" you are using but I'm sure the data could be extracted from the selected block insertion without too much issue.

            DoIt: LIST
            SOrt/Tracking/<Select entities to list>: 
            Entities in set: 1
            SOrt/Tracking/<Select entities to list>: 
    
        ---------- Insert of Block ----------------------------------------
                          Handle:  5DAD1
                   Current space:  Paper
                           Layer:  0
                           Color:  BYLAYER
                        Linetype:  ByLayer
                      Block name:  Marker
                     Description:  
                 Insertion point:  X=   8.962577  Y=   11.018194  Z=   0.000000
                  X scale factor:  10.000000
                  Y scale factor:  10.000000
                  Z scale factor:  10.000000
                  Rotation angle:  0.000000
        DoIt: DXFLIST
        Select entity to display its DXF value data: 
        (-1 . <Entity name: 82877720>) 
        (0 . "INSERT") 
        (5 . "5DAD1") 
        (330 . <Entity name: 37133150>) 
        (100 . "AcDbEntity") 
        (67 . 1) 
        (410 . "Layout1") 
        (8 . "0") 
        (370 . -1) 
        (100 . "AcDbBlockReference") 
        (2 . "Marker") 
        (10 8.96257709251103 11.0181938325991 0.0) 
        (41 . 10.0) 
        (42 . 10.0) 
        (43 . 10.0) 
        (50 . 0.0) 
        (70 . 0) 
        (71 . 0) 
        (44 . 0.0) 
        (45 . 0.0) 
        (210 0.0 0.0 1.0) 
    
  • Roy Klein Gebbinck
    edited February 2019

    To find the taborder of the layout the insert is on, you can use something like this (code tested in V14):

    ; (setq lytDatLst (LayoutDataList))                      ; => (("MODEL" . 0) ("LAYOUT1" . 1)) ; Note: Names in caps.
    ; (setq enm (car (entsel)))
    ; (cdr (assoc (strcase (vle-entget 410 enm)) lytDatLst)) ; => 1
    (defun LayoutDataList ()
      (mapcar
        '(lambda (obj) (cons (strcase (vla-get-name obj)) (vla-get-taborder obj)))
        (vle-collection->list (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))))
      )
    )