Jump to content

Sheet x of 45 - Automatic Numbering??


hoowahfun

Recommended Posts

I'm unsure where I should post this because I'm not sure what the solution will be. I'm thinking maybe some kind of lisp routine...although i'm very unfamiliar with them.

 

What I'd like to know is if there's a way to automatically update the sheet number in seperate dwgs.

 

For example: at work we have 45 seperate dwgs in multiple disciplines. Is there a way to have the "x" in "Sheet X of 45" update automatically on each sheet? This way whenever we insert/delete a sheet in the set it automatially knows which number it is in regard to the set as a whole.

 

Running Autocad 2008 btw. Full Version. Thanks!!

Link to comment
Share on other sites

If you are interested in the current sheet number, you can name your layout the sheet number, then use a System Variable Field and choose ctab.

Link to comment
Share on other sites

If you are interested in the current sheet number, you can name your layout the sheet number, then use a System Variable Field and choose ctab.

 

hm. how that would automatically update when i add/remove a sheet?

Link to comment
Share on other sites

hm. how that would automatically update when i add/remove a sheet?

 

Well, it would be based on the layout tab name.

Go to a layout and type in ctab. This will not do anything for the total number.

Link to comment
Share on other sites

That didn't seem to work for me. What we ended up doing was just entering the sequence number in sheet manager so when all is said and done we just cycle through under renumber/rename.

 

I was hoping for something more automatic where I could enter a field or run a lisp and not have to go through each drawing. Even using the above method can get old with 100+ sheets. Suggestions?

Link to comment
Share on other sites

  • 9 months later...

1. Define an attribute containing a field (within the create field dialog box the Property should be set to "SheetSet" and the Field Name should be set to "CurrentSheetNumber").

 

2. Create a new title block and include the attribute with the field in it that you just created. Save the title block as a template file (.DWT).

 

3. Open the Sheet Set Manager and create a sheet set. In the Properties dialog box for the sheet set, choose as the "Sheet Set Template" the .dwt of the title block drawing you created above.

 

4. Create a sheet. Number it in the pre-creation dialog box. Observe the number populate automatically. Viola. I haven't figured out how to make it automatically populate the total number of sheets, however (For example, if I used to have five sheets total and now I have created a sixth one, I don't know how to automatically make the number say "Sheet 3 of 6").

Link to comment
Share on other sites

  • 3 weeks later...

I just figured this out myself and not knowing how good of a solution it is, I guess I will still share it :?

 

I used a tidbit Alan shared on another thread about creating a lispvariable in the startup suite to get the total layout count. AutoCAD does not have a system variable assigned to tally the number of layouts but you can find it via the expression:

(length(layoutlist))

 

So I added a simple line in my accaddoc.lsp assigning the value derived from the above expression to the AutoCAD variable "useri1". I think Alan's example used the "users1" variable but I couldn't get that to work. The "i" in useri1 stands for integer I believe while the "s" in users1 stands for string. Anyways, I used a DieselExpression (see below) in a Field to get my desired results.

 

"SHEET "$(*,1,$(substr,$(getvar,ctab),4))" OF "$(getvar,useri1)

 

-Obviously the "SHEET " just returns the same string. Diesel is a string language so any text within quotes is returned as is.

-The $(getvar,ctab),4 gets the name of the tab starting at the 4th character til the end of the string. In my case my layouts are named SH 01, SH 02, etc. so only the number portion of the string is returned. I have to start at the fourth character as some drawings have double digit sheets.

-To get rid of the 0 in the 01, 02, 03, etc. that is returned I simply multiply it by 1.

-The " OF " just returns that text

-The

$(getvar,useri1)

returns the value of the

(length(layoutlist))

that is assigned in the acaddoc.lsp.

 

I hope this helps.

 

Lonnie

Edited by SLW210
Add Code Tags
Link to comment
Share on other sites

I just figured this out myself and not knowing how good of a solution it is, I guess I will still share it :?

 

I used a tidbit Alan shared on another thread about creating a lispvariable in the startup suite to get the total layout count. AutoCAD does not have a system variable assigned to tally the number of layouts but you can find it via the expression:

 

(length(layoutlist))

 

So I added a simple line in my accaddoc.lsp assigning the value derived from the above expression to the AutoCAD variable "useri1". I think Alan's example used the "users1" variable but I couldn't get that to work. The "i" in useri1 stands for integer I believe while the "s" in users1 stands for string. Anyways, I used a DieselExpression (see below) in a Field to get my desired results.

 

"SHEET "$(*,1,$(substr,$(getvar,ctab),4))" OF "$(getvar,useri1)

 

-Obviously the "SHEET " just returns the same string. Diesel is a string language so any text within quotes is returned as is.

-The $(getvar,ctab),4 gets the name of the tab starting at the 4th character til the end of the string. In my case my layouts are named SH 01, SH 02, etc. so only the number portion of the string is returned. I have to start at the fourth character as some drawings have double digit sheets.

-To get rid of the 0 in the 01, 02, 03, etc. that is returned I simply multiply it by 1.

-The " OF " just returns that text

-The $(getvar,useri1) returns the value of the (length(layoutlist)) that is assigned in the acaddoc.lsp.

 

I hope this helps.

 

Lonnie

 

 

Wow, that's a lightbulb moment...:D

I have used

$(getvar,ctab)

in a field for my sheet number for a long time, but could never think of a way to get the "OF ##" portion to update automatically. This is an awesome solution. Also, I didn't realize you could use SUBSTR with it. Very usefull, Thanks!!

Link to comment
Share on other sites

  • 1 year later...

I cant seem to get this to work properly. I have pasted the code into a mtext field and get "SHEET 4 OF 0" returned in the field. When I bang the variable it returns 5 at the command line as I have 5 layout tabs and the field is on the fourth. Any ideas? this is the code I am using

 

 
(setq useri1 (length(layoutlist))) ; in acaddoc.lsp file


"SHEET "$(*,1,$(substr,$(getvar,ctab),2))" OF "$(getvar,useri1) ;in the field

Link to comment
Share on other sites

The useri1 variable is an AutoCAD variable and not a lisp variable therefore it must be set as such:

 

(setvar "useri1" (length (layoutlist)))

Link to comment
Share on other sites

I agree with OP that these methods can get tedious with 100+ dwg files when another is added somewhere in the middle. Someone has to sit through the renam/renumber process for a whole lot of drawings. We use the title, number, and layout name, but still have to sit through the process. Luckily, I don't have a whole lot of projects using more than about 20-30 dwgs.

 

Maybe an alternative is to use an excel -paste-link for these items, but I'm not sure how to handle adding somehting in the middle of the list...just trying to brainstorm here...

Link to comment
Share on other sites

  • 7 years later...
  • 2 weeks later...

Our own company uses a special LISP routine that will automatically number the sheets.  Sheet set manager works good too.  Plus, if you're dealing with tons of drawings each with their own cad file, sheet set manager has other benefits. 

 

Our company uses a LISP routine vplot command that will open each drawing, print it, then close it, open next drawing, etc..  But since the vplot command prints a view, we have to put our titleblocks in model space (which I don't like).

 

Sheet set manager can do the same thing for plotting tho.

In fact, short of some crazy LISP routine,  I think sheet set manager is the only way to truly batch plot when you have each sheet on its own DWG file.

 

We use an AutoCAD add-on called FugleCAD that was developed by people at my company.

It's pretty powerful for Civil stuff.  Not sure if it's publicly available tho.

 

ChriS

Link to comment
Share on other sites

On 5/30/2019 at 5:44 AM, elepisk said:

Hello do you may have the file to share? :) I really do not understand how to do that :(

I have attached a DWG that has some blocks and Mtext in it with fields in it that give some examples. I have also includes a lisp routine that associates an attribute with the scale of the viewport by clicking the edge of the viewport then the attrisheet numbering fields.dwgbute. to start the comma type S2A. hope this helps you out. 

scale2Attribute.lsp

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