Jump to content
LXM

Using LISP to get total number of sheets in project

Recommended Posts

LXM

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

Share this post


Link to post
Share on other sites
rkmcswain

What software are you working in? There is no "Project Manager" in AutoCAD.

  • Like 1

Share this post


Link to post
Share on other sites
LXM

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?

Share this post


Link to post
Share on other sites
rkmcswain

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.

Share this post


Link to post
Share on other sites
BIGAL

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.

Share this post


Link to post
Share on other sites
rkmcswain
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.

Share this post


Link to post
Share on other sites
rlx

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

Share this post


Link to post
Share on other sites
rkmcswain

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

Share this post


Link to post
Share on other sites
pBe
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.

 

 

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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