Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to get value of cell in Revision Block? 1

Status
Not open for further replies.

brrian

Mechanical
Jan 21, 2004
164
I'm sure this is simple...

Is there a way to get the value of a cell in a revision block using VBA? I have a small macro that automates the insertion of a new revision line, but I'd like to make it look at the table and figure out what the next revision should be. If I can get the value of the previous revision, I can take it from there. Help? Thanks,

Brian
 
Replies continue below

Recommended for you

You're in luck because this is simple.

Use TableAnnotation.RowCount to get the current number of rows, followed by TableAnnotation.Text ( Row, Column ) to get the existing rev and then add your new rev. If you also show the revision level in the main title block at the bottom right of the sheet, you can either update both fields with the same routine or at least do a check to make sure that they agree.

The examples in the api help show most of what you need
 
Hi, Brrian:

SolidWorks' default revision block already does it automatically for you. You do not need to create a macro to do it. Just right click your revision block, and select "Revision" and then click "revision or symbol". You are done.

You customize SW default revision block to your need.

Alex
 
We don't use 'standard' numbers or letters--we use some goofy 00-1, 00-2, 00-3 etc. system, then it switches to 001, 002, 003 and so on. The automatic number doesn't work.

Thanks for the help...

Brian
 
Brian,
We use the following in our Visual Basic Code:
Code:
Revision = Drawing.CustomInfo("Revision") 
If Revision = "" Then
   Revision = "A01-01"
End If


Bradley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor