hoowahfun Posted October 2, 2009 Posted October 2, 2009 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!! Quote
chelsea1307 Posted October 2, 2009 Posted October 2, 2009 You can add that when using sheet set manager Quote
hoowahfun Posted October 2, 2009 Author Posted October 2, 2009 I must be missing it completely. Can you walk me through how to do that? Quote
alanjt Posted October 3, 2009 Posted October 3, 2009 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. Quote
hoowahfun Posted October 5, 2009 Author Posted October 5, 2009 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? Quote
alanjt Posted October 5, 2009 Posted October 5, 2009 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. Quote
hoowahfun Posted October 8, 2009 Author Posted October 8, 2009 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? Quote
ShawnCox70 Posted July 9, 2010 Posted July 9, 2010 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"). Quote
lfe011969 Posted July 27, 2010 Posted July 27, 2010 (edited) 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 March 6, 2012 by SLW210 Add Code Tags Quote
chulse Posted July 27, 2010 Posted July 27, 2010 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... 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!! Quote
markv Posted March 6, 2012 Posted March 6, 2012 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 Quote
lfe011969 Posted March 11, 2012 Posted March 11, 2012 The useri1 variable is an AutoCAD variable and not a lisp variable therefore it must be set as such: (setvar "useri1" (length (layoutlist))) Quote
rickh Posted March 12, 2012 Posted March 12, 2012 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... Quote
elepisk Posted May 30, 2019 Posted May 30, 2019 Hello do you may have the file to share? :) I really do not understand how to do that :( Quote
ammobake Posted June 13, 2019 Posted June 13, 2019 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 Quote
markv Posted June 13, 2019 Posted June 13, 2019 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 Quote
Recommended Posts
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.