×
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

VB to retrieve "Revision" info from drawing documents
2

VB to retrieve "Revision" info from drawing documents

VB to retrieve "Revision" info from drawing documents

(OP)
I need to use VB to retrieve "Revision" info from drawing documents.  Is there a way to retrieve this information quickly without actually loading the drawing document into memory?  Do I have to use CustomInfo2, or is there a quicker way to read this information.  Micrososft Explorer's tooltip shows this revision info.  But I do not think it loads SW application object to read it.

Alex

RE: VB to retrieve "Revision" info from drawing documents

With VB, you can use the "DSOfile.dll" library to gain functionality to read properties without opening files.  The shortcoming is that you can only read gemeral properties, not config-specific properties.

I could be the world's greatest underachiever, if I could just learn to apply myself.
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: VB to retrieve "Revision" info from drawing documents

(OP)
Hi, TheTick:

Thanks for your quick reply.  I have never used this "DSOfile.dll".  I assumed that it is from Microsoft.  How do I use it?  Could you post demo codes to show how to use it to retrieve "Revision" property from a drawing document on server?

Thanks,

Alex Chen
VB6.0
SW2005 SP02

RE: VB to retrieve "Revision" info from drawing documents

(OP)
Just figured out how to retrieve custom property info from SW documents without loading them to memory using "DSOfile.dll" suggested by TheTick.

1. Download this ActiveX file from Micorsoft.com;
2. Install it to Windows;
3. Declare it in VB project;
4. Use the following codes to retrive custom property info from SW documents.

**********************************************************
    m_oDocumentProps.Open sFile, fOpenReadOnly,
dsoOptionOpenReadOnlyIfNoWriteAccess
    Revision =
m_oDocumentProps.CustomProperties.Item("Revision").Value
**********************************************************

Just want to post the codes to share with fellow SW users.

Alex

RE: VB to retrieve "Revision" info from drawing documents

Glad to hear you got it figured out.  I've experimented with DSOfile, but I haven't implemented it in anything I've published.  Still, a usefule thing to know.

Now you've also learned how to incorporate additional references into a VB project.  This greatly expands your VA/macro horizons.  This is also the means by which you can plug into MS Excel or Word or other applications from a SW macro.  Also, there are hundreds of other modules and controls available to add to your projects.

Good luck with your program.  Let us know how it works when you're done.

RE: VB to retrieve "Revision" info from drawing documents

Can you also write/update properties this way?

RE: VB to retrieve "Revision" info from drawing documents

(OP)
Hi, dogarila:

Yes, you can write/update all custom properties (except those of configuration specific properties).  But you need to change arguments in the open statement.  A demo file for DSOfile.dll on Microsoft website contains detailed information on how to use it.

TheTick:

I developed a custom PDM software (using VB DAO) to manage documents in my company.  It is universal for all digital files.  This includes SolidWorks, AutoCAD, Word, Spreadsheet, images, audio, videos, or whatever documents.  I evaluated many PDM software programs, and I like my custom PDM program better as it has a lot of automation features.  DSOfile.dll is a very impressive ActiveX.  I use it in my PDM to show revision of a document without loading it to computer memory.  It is very nice, and very efficient.

Thank you again for pointing me to the right direction.

Alex

RE: VB to retrieve "Revision" info from drawing documents

If you want to access custom properties in a drawing file without opening it, ask your VAR about SolidWorks Document Manager.  Very powerful, but not for the careless - you need to get a license key from SolidWorks.

RE: VB to retrieve "Revision" info from drawing documents

Alex, a star for you and one for Tick for

Quote (Alex):

Thank you again for pointing me to the right direction.

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