AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Next Sheet Number

31 REPLIES 31
Reply
Message 1 of 32
DBrohm
3295 Views, 31 Replies

Next Sheet Number

Good Morning;

The majority of my customers require their title blocks show the current sheet number, for which I utilize the %S variable. Additionally, they want the maximum number of sheets indicated, which is a standard “title block update” function, as we all know. So far easily done.

Where my challenge comes is the odd customer prefers the next sheet number to be displayed in the title block as opposed to the maximum number of sheets. Up to this point in time we have been editing that information manually. Is there a means by which to automatically “calculate” that value based upon the current sheet number or to read the next sheet number from the project database? If there is I am unable to determine what that method would be.

Any suggestions, help would be appreciated.


Doug
31 REPLIES 31
Message 21 of 32
dougmcalexander
in reply to: robbm2k

That looks very similar to mine but my lisp routine is named tbnp.lsp and mine handles previous sheet and next sheet.  It adds the previous sheet value to the PREVSHEET attribute in the titleblock and the next sheet value goes to the NEXTSHEET attribute in the titleblock.

 

The following is added to the end of the WD_TB attribute.  Must have the semicolon as a delimiter.

 

;PREVSHT = (if (setq x (findfile "tbnp.lsp" ))(progn(load x)(c:prevsheet)) " ");NEXTSHT = (if (setq x (findfile "tbnp.lsp" ))(progn(load x)(c:nextsheet)) " ")

 

Be sure your lisp file is named the same as the call from your WD_TB.

 

If there is a smiley face in the code string above that is caused by this forum.  The smiley face should be a colon followed by the letter p.



Doug McAlexander


Design Engineer/Consultant/Instructor/Mentor specializing in AutoCAD Electrical training and implementation support

Phone and Web-based Support Plans Available

Phone: (770) 841-8009

www.linkedin.com/in/doug-mcalexander-1a77623




Please Accept as Solution if I helped you. Likes are also much appreciated.
Message 22 of 32
robbm2k
in reply to: dougmcalexander

after looking closer, i found it.

what's listed is missing a ( before the PROGN. it should show as

 

(IF (SETQ X (FINDFILE "TITLEBLOCK UPDATE.LSP"))(PROGN(LOAD X)(C:NEXTSHEET)) " ")

 

then it works.

 

thanks for the look Doug.

 

Message 23 of 32
kani_mca
in reply to: mako68

how to get sheet number of currently opened drawing from autocad electrical using vb.net?

How can i get it?

Tags (1)
Message 24 of 32
drathak
in reply to: eric.powell


@eric.powell wrote:

Does anyone else have a copy of this LISP ZIP file?  I try to download it but it says that it is corrupted.

 

Thanks!!


Same here.

--------------
Joe Weaver
Principle Associate Engineer - Nashville Electric Service
P&C Committee Chair – SDS Industry Consortium
Message 25 of 32
rhesusminus
in reply to: robbm2k

Here it is.

 

 


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 26 of 32
drathak
in reply to: rhesusminus

Many thanks!  Very handy and was a quick fix to something someone asked for.

 

That's ALWAYS a good thing.

--------------
Joe Weaver
Principle Associate Engineer - Nashville Electric Service
P&C Committee Chair – SDS Industry Consortium
Message 27 of 32
drathak
in reply to: drathak

Well this has been working just fine until today.  I've added two new drawings and neither of them will update the Next/Prev attributes.

 

I've checked and they are the same title block as others that do still work.  Even exploded it to check that the code is indeed in the WD_TB attribute.  Nothing else I know of has changed.  Any ideas what might cause this to not work on a particular drawing(s)?

--------------
Joe Weaver
Principle Associate Engineer - Nashville Electric Service
P&C Committee Chair – SDS Industry Consortium
Message 28 of 32
rhesusminus
in reply to: DBrohm

Check the contents of the WD_TB attribute before you explode the block.
You might have hit the roof on the length of the attribute text...

Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 29 of 32
dougmcalexander
in reply to: DBrohm

Good point Bob. I thought he had said he checked that but if he used Enhanced Attribute Editor there is a limit. Try using Properties when entering a long string of mapping data.


Doug McAlexander


Design Engineer/Consultant/Instructor/Mentor specializing in AutoCAD Electrical training and implementation support

Phone and Web-based Support Plans Available

Phone: (770) 841-8009

www.linkedin.com/in/doug-mcalexander-1a77623




Please Accept as Solution if I helped you. Likes are also much appreciated.
Message 30 of 32
pjfontes
in reply to: kani_mca

What the heck is LISP? 🙂

To get the current sheet In VB.Net:
On the active drawing look in the (hidden) WD_M block. The SHEET attribute of the WD_M block is the value for the currently opened sheet.

'Next/Prev Sheet' Ids can then be found by looking in the .WDP file.
Message 31 of 32
drathak
in reply to: dougmcalexander


@dougmcalexander wrote:
Good point Bob. I thought he had said he checked that but if he used Enhanced Attribute Editor there is a limit. Try using Properties when entering a long string of mapping data.

You seem to have missed the fact that the exact same title block drawing is working in all the other drawings in this project.  It is just the two I added last week that aren't working.  If the WD_TB string was too long none of them would work, right?

--------------
Joe Weaver
Principle Associate Engineer - Nashville Electric Service
P&C Committee Chair – SDS Industry Consortium
Message 32 of 32
drathak
in reply to: drathak

And is often the case, a clear head on a Monday (on Tuesday) morning helps.  I had failed to update the template file the new drawings were created from.  Swapping the block out didn't work, but deleting it and purging before reinserting did.  All is fixed now.

 

Thanks!

 

--------------
Joe Weaver
Principle Associate Engineer - Nashville Electric Service
P&C Committee Chair – SDS Industry Consortium

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost