Reply

Open Document In Revision Manager and Display it

[ Edited ]

 

Hi,

I need to write a small piece of C# that starts revision manager and then loads a document using a string file path (equivalent of  File->Open->RevisionManager).  I did something similar for solid edge and it worked fine, but I can't seem to get it to work with revision manager.  The revision manager application starts up, but I then don't see the document.  When I close revision manager, it asks me to save 'untitled' so a document  is being created - it just isn't being shown in a window.

Any help on this simple problem would be appreciated!

Cheers,

Nick

Here's the code:

        public static void OpenInRevisionManager(string file)

        {

            RevisionManager.Application objApp;

            try

            {

                objApp = System.Runtime.InteropServices.Marshal.GetActiveObject("RevisionManager.Application") as RevisionManager.Application;

            }

            catch (Exception)

            {

                objApp = Activator.CreateInstance(Type.GetTypeFromProgID("RevisionManager.Application")) as RevisionManager.Application;

            }

            RevisionManager.Document doc;

            doc = (RevisionManager.Document)objApp.Open(file, SolidEdgeConstants.RevisionRuleType.LatestRevision, false);

 

            objApp.Visible = 1;

            objApp = null;

        }

 

Posted by: nick lawrence
Post date: 7/8/2008 10:44:10 PM

4 REPLIES

RE: Open Document In Revision Manager and Display it

[ Edited ]

 

Nick,

I'm seeing the same problem that you're seeing and I don't have a solution for that approach.  If all you're needing to do is open the document, why don't you just use the command line?"C:\Program Files\Solid Edge V19\Program\iCnct.exe" C:\Part1.par

You can get the Solid Edge install path from the SEInstallData API.

 

Posted by: Jason Newell
Post date: 7/9/2008 7:31:08 AM

RE: Open Document In Revision Manager and Display it

[ Edited ]

Hi Jason,

 

Many thanks for your help - the command line option is fine for what I want (I gave it a try this morning and it worked fine). One last query: When I run the command line that you suggest, the part opens in view and markup - is there a command option for it to automatically open in revision manager (so you can see the file list etc)?

 

Cheers,

 

Nick

 

Posted by: nick lawrence
Post date: 7/10/2008 2:33:44 AM

RE: Open Document In Revision Manager and Display it

[ Edited ]

Hi Nick,

 

Try the following:

"C:\Program Files\Solid Edge V19\Program\iCnct.exe" /r "C:\Test Files\Part1.par"

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 7/10/2008 2:56:35 AM

RE: Open Document In Revision Manager and Display it

[ Edited ]

Hi Calum,

 

The /r worked a treat...

 

Many thanks,

 

Nick

 

Posted by: nick lawrence
Post date: 7/10/2008 4:00:57 AM