LXM Posted March 5, 2019 Posted March 5, 2019 I'm very new to lisp. I have searched this forum for a way to get a count of total sheets in a project. Actually I've searched many different forums looking for some clue. Perhaps this topic is so easy no one ever has to ask about it? Anyway I don't know how this would be accomplished with LISP. If I look in the Project Manager and do a title block update, in the "Update Title Block" dialog there is a variable for Sheet maximum that shows the total number of sheets in the active project. I'm thinking that would be something I could use but I can't find any information on accessing that variable. Is there any way to access that variable? Barring that, is there a known method for using LISP to get a count of total sheets in the project? Thanks in advance to anyone who might be able to shed a little light on this mystery (mystery to me that is). Quote
rkmcswain Posted March 5, 2019 Posted March 5, 2019 What software are you working in? There is no "Project Manager" in AutoCAD. 1 Quote
LXM Posted March 6, 2019 Author Posted March 6, 2019 Sorry, I'm new to forums as well. I am using AutoCAD Electrical 2016. Perhaps this isn't even the right place to ask the question? Quote
rkmcswain Posted March 6, 2019 Posted March 6, 2019 No worries, just needed to know what software you were using. I'm not familiar with AutoCAD Electrical. You might try here while you wait. Quote
BIGAL Posted March 8, 2019 Posted March 8, 2019 If its a single layout per sheet then. (SETQ LAYOUTS (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))) (SETQ COUNT (- (VLA-GET-COUNT LAYOUTS) 1)) The -1 is to account for "Model" its a layout also. Quote
rkmcswain Posted March 11, 2019 Posted March 11, 2019 On 3/8/2019 at 5:41 PM, BIGAL said: If its a single layout per sheet then. Doubtful since OP is talking about AutoCAD Electrical Project Manager. Almost certainly multiple DWG files in the project. Quote
rlx Posted March 11, 2019 Posted March 11, 2019 no idea how the structure of a project is AutoCad Electrical but if all the files (drawings) are in one (master) folder , simply count all the drawings in this folder / subfolders, easy as pie Quote
rkmcswain Posted March 11, 2019 Posted March 11, 2019 That could be a big "if". I presume this tool is similar in nature to Sheet Set Manager, in which you can have single layout drawings, multi-layout drawings, and drawings in varying folders. Regardless, it feels like @LXM wants to query the 'project' itself, just like you might count the items in a .DST file (Sheet Set Manager) - in which case you're not really concerned with how many .DWG files or the number of layouts, you just want the sheet total so you can put Sheet Z of XX on each sheet (where XX is the variable). Quote
pBe Posted March 11, 2019 Posted March 11, 2019 7 hours ago, rkmcswain said: Doubtful since OP is talking about AutoCAD Electrical Project Manager. Almost certainly multiple DWG files in the project. Besides that point, if it is indeed layout tabs then it could be just (length (layoutlist)). If the project manager is anything like sheet set, then .NET is the tool you want. Quote
LXM Posted April 18, 2019 Author Posted April 18, 2019 Can't query folder as there is always the possibility of extra drawings, recovered drawing or just plain bad housekeeping. And no, I'm not dealing with tabs but individual drawings so that route is out. What I did to solve my dilemma was to query the .wdp (project file) and get a count from there based on an idea posted by Lee Mac. Works like a charm. Guess we can mark this one as solved. Not sure how that is done here. 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.