×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBA to get value of cell in Revision Block?

VBA to get value of cell in Revision Block?

VBA to get value of cell in Revision Block?

(OP)
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

RE: VBA to get value of cell in Revision Block?

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  

RE: VBA to get value of cell in Revision Block?

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

RE: VBA to get value of cell in Revision Block?

(OP)
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

RE: VBA to get value of cell in Revision Block?

Brian,
We use the following in our Visual Basic Code:

CODE

Revision = Drawing.CustomInfo("Revision")
If Revision = "" Then
   Revision = "A01-01"
End If

Bradley

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources