Auto-Adjust Drawing Index Report - AutoCAD Electrical

  • Controlling the Machine is no longer being updated. Don't worry, though, you can still follow Nate Holt at his new blog, AutoCAD Electrical Etcetera. You'll find it at http://nateholt.wordpress.com. Or you can subscribe to his feed to get latest words of wisdom automatically: http://nateholt.wordpress.com/feed/. You also can continue to view the Controlling Machine archives for Nate's AutoCAD Electrical tips and tricks.

    About Nate

Latest Post

  • Auto-Adjust Drawing Index Report - AutoCAD Electrical
    February 22, 2008, 08:32 AM Nate Holt

    (Note: this posting is a variation on the last posting's theme)

    You plan for future expansion of your control system by leaving unused sheet numbers in your project drawing set. But when you run AutoCAD Electrical's 'Drawing List Report' and then pop it on the drawing as a table, the blank 'future' slots don't show up. You left room for future sheets 3, 7, 10-12... but they don't show up in the index table.

    What you really want to see is this:

    One way around this is to put in dummy placeholder drawings into your project set. But it's a hassle, and you waste paper when you plot the project set.

    A better solution would be to have AutoCAD Electrical's Drawing List Report 'know' when there are unused entries in the sequence and adjust the drawing list report accordingly. You can do this, like the previous posting, by displaying the Drawing List Report and then running a custom 'User Post' utility.

    Setting up the dwglst.lsp 'User Post' utility

    Basically the same sequence as previous posting except that we now set up the program to look at the SHEET number column. When the program detects that there is a sheet number 'gap', it pushes in enough blank lines into the report to fill in the gap. Each blank line is formatted with the next sheet number in the sequence and the label '(future)' in the DWGDESC column.

    Here is the key part of the user post AutoLISP utility:

    How it works

    Data from the report is passed to the user postprocessing utility as a "list of lists". Each of the sub-lists is data for one line of the report. The order of the data elements in each sublist follows this table:

    ; -- Structure of the "wd_rdata" list of lists passed from AutoCAD Electrical:
    ;
    ; (list (list <report line1 data>) (list <report line2 data>) ... )
    ; where each line data sublist consists of a list of the following:
    ; 0 = drawing file name (no path, no extension)
    ; 1 = date stamp
    ; 2 = time stamp
    ; 3 = SHEET assignment (the %S value)
    ; 4 = SHDWGNAME assignment (the %D value)
    ; 5 = SEC assignment (the %A value)
    ; 6 = SUBSEC assignment (the %B value)
    ; 7 = Drawing desc line 1
    ; 8 = Full file name
    ; 9 = Drawing desc line 2
    ; 10 = Drawing desc line 3
    ; 11 = IEC-Project (the %P value)
    ; 12 = IEC-Installation (the %I value)
    ; 13 = IEC-Location (the %L value)
    ; 14-x = other values defined in ".wdt" title block attribute mapping file

    So, we want to the program to monitor the SHEET number (index #3 in each sublist) and insert a blank line into the report whenever the program detects a sheet value 'gap' as it goes from one line to the next in the report data.

    The program first grabs the data's beginning sheet number text value and converts it to an integer number.

              ; Get first line's SHEET value (integer value)
              (setq sheet (atoi (nth 3 (car wd_rdata))))

    Next it begins to loop through each line of the report data. It looks for a 'change' in the sheet number that is greater than one.

              (foreach xx wd_rdata
                (setq nextsheet (atoi (nth 3 xx)))
                (if (AND (> sheet 0)
                         (> nextsheet 0)
                         (> nextsheet sheet)
                         (> (- nextsheet sheet) 1))
                  (progn ; one or more skipped sheet numbers.
                         ; Add in blank entries as place holders.

    If a gap greater than 1 is found, then it goes into a 'repeat' loop and outputs a number of new blank lines into the report data equal to the size of the sheet number gap. Just before each blank line is inserted, the utility pops in the next sheet number sequential and pastes in the word (future):

                    (repeat (1- (- nextsheet sheet))
                      (setq sheet (1+ sheet)) ; increment sheet number
                      ; Insert into blank line
                      (setq blank (wd_nth_subst 3 (itoa sheet) blank))
                      ; Insert word "(future)" into the DWGDESC column
                      (setq blank (wd_nth_subst 7 "(future)" blank))
                      ; Push blank line into the output list
                      (setq rtrn (cons blank rtrn))
                    )

    That's about it.

    Set up

    Here's the dwglst.lsp file  files/20901_21000/20908/file_20908.lsp (rename to dwglst.lsp and push into your c:\program files\autodesk\acade 2008\support\" folder, overwrite existing version)

    And here's the associated dialog DCL file  files/20901_21000/20909/file_20909.dcl (rename to dwglst.dcl and push into the above folder, overwrite existing)

    0 Comment | Add Comment Controlling the Machine >

Comments



You must be logged in to post a comment.

Subscribe to Blog

Want to keep up with the latest? Subscribe to the RSS feed today.

RSS

Tags

You must be logged in to add a tag.

Send to a Peer

You must login to share pages.

Feedback

Tell us what you think of the site.

Send Feedback