Use Revision Manager to read file properties

Experimenter
Experimenter

I am writing a C# app to crawl users' save directory and retrieve certain custom properties, such as "CustomTitle" from Solid Edge files. For performance reasons, I'd like to do this "offline" (not open each file in Solid Edge). It appears that using the Revision Manager to get file properties should work better according to this answer (is there a better way?).

 

However, I am running into an issue that I can't figure out and I'd like a nudge in the right direction.

 

Here is my code:

 

RevisionManager.Application RM = new RevisionManager.Application();

RevisionManager.PropertySets propertySets = null;

RevisionManager.Properties properties = null;

RevisionManager.Property property = null;

 

RM = new RevisionManager.Application();

propertySets = RM.PropertySets;

propertySets.Open(file);

properties = propertySets.Item["Custom"]; // error here

property = properties.get_PropertyByID(72);

print(property.Value); // never get here. Is this right?

 

Even though I haven't gotten there yet, I know for a fact that there is an item at index 72. I use Solid Edge Spy to verify. This is the error I get:

 

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

 

How can I fix this? What am I doing wrong? Thanks.

 

 

 

4 REPLIES

Re: Use Revision Manager to read file properties

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Or use the SolidEdge.FileProperties API...? The old SE programmers guide used to cover both revision manager and fileproperties API in some detail with some C# examples. I can't seem to see the examples in the new online guide.

Re: Use Revision Manager to read file properties

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

If I were only wanting to read file properties, I would not use Revision Manager. I would either use:

 

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Use Revision Manager to read file properties

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer
I'm using those now Jason, but forgot to mention it! Also emailed Nate the old programmers guide. Was always my first point of reference for a while. Old habits die hard!

Re: Use Revision Manager to read file properties

Experimenter
Experimenter

Dave, you were right about the Solid Edge Properties API. And Jason I took a look at the Samples on Github. The one in particular you linked to works fine and I now know exactly what I was hoping to learn. I've already abandoned the code in my original post, but I believe the issue was that "Custom" should be an int rather than a string.

 

Thanks for the help.