Jump to content

LISP for total # of sheets in a Sheet Set


brawleyman

Recommended Posts

I have created a title block that automatically fills out almost all the information from the .DST file for a project (project number, name, drafter, checker, create date, page number, etc.). Right now, I have a Custom Properties that I just fill out the total number of sheets, but I was hoping that it could become automatic.

 

I have been searching, but evidently there is nothing that keeps a count of the total number of sheets in a sheet set. Is there a LISP routine that can extract that information so that I can put it in field on the title block?

 

Thanks!

Link to comment
Share on other sites

We use 1 layout tab per plotted sheet I know you can get a list of your layout tabs hence total number of plotted sheets not sure if this is what you want search here for code (layout tabs)

 

Another try we have an automated system for updating title blocks it would allow me to count the number of blocks updated hence number of sheets this may work for you now if your already updating blocks it just means a second pass.

Link to comment
Share on other sites

This will return how many tabs you have in a drawing... Is that what you're looking for?

 

(length(layoutlist))

Link to comment
Share on other sites

If you are looking to manipulate the Sheet Set manager through LISP, I believe its pretty difficult - (beyond my knowledge anyway), I think it runs on a COM interface.

Link to comment
Share on other sites

For each project, there will be several drawing files (one for floor plans, one for risers, details, etc.). Each drawing file will have multiple tabs with titleblocks.

 

I was hoping that there was a way to keep a count of all the sheets in the sheet set without having to manually input it. I guess I will have to wait until they come out with something in 2010 or beyond...

Link to comment
Share on other sites

As CommandoBill says, if you want to count the tabs in each drawing:

 

(length (layoutlist))

 

Will do the trick - you could run this on many drawings and sum the total - is this what you are after?

Link to comment
Share on other sites

If you write a script to open all the drawings then run (length (layoutlist)) write the answer to a txt file say called project- name with 2 columns tab-no dwgname. you can then in any drawing read the total number of sheets. Or always re-read all the drawings and update sheet number. You could get a bit smarter and renumber all sheets as well if say you inserted a tab you just need a list of drawings and the correct order.

 

I am suggesting two programs.

 

Just another thought do a test run ie dont change anything but run a check that everything is correct and you have accounted for every sheet.

 

To make life easier you can get a lisp program to write a script and then run it this way (command "script" myscript)you only need a source txt file as above rather than hard coding a script every time. (phew 3rd program now)

Link to comment
Share on other sites

Well, I'll get you started if you like... here program 1...

 

(defun c:shtcnt (/ path ofile)

 (setq path "[color=Red][b]C:\\sheet.txt[/b][/color]")

 
 (setq ofile (open path "a"))
 (write-line (itoa (length (layoutlist))) ofile)
 (close ofile)
 (princ))

 

Change the highlighted path to what you want (use double backslashes..)

Link to comment
Share on other sites

  • 7 years later...
Well, I'll get you started if you like... here program 1...

 

(defun c:shtcnt (/ path ofile)

 (setq path "[color=Red][b]C:\\sheet.txt[/b][/color]")

 
 (setq ofile (open path "a"))
 (write-line (itoa (length (layoutlist))) ofile)
 (close ofile)
 (princ))

 

Change the highlighted path to what you want (use double backslashes..)

 

Hi guys,

 

How Can I create a field for the total of sheets?

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...