Inventor instance inside IWebServiceExtension

Inventor instance inside IWebServiceExtension

Anonymous
Not applicable
365 Views
1 Reply
Message 1 of 2

Inventor instance inside IWebServiceExtension

Anonymous
Not applicable

Dears,

 

This is a copy of same post from Inventor-Customisation since problem lays between Inventor and Vault

 

What I want to achieve:

I would like to modify Inventor's file properties just after Vault's state change has been done on that file.

It shall work from any Valut's client.

 

Thus I have created IWebServiceExtension which catches this state change and by Apprentice modifies file's properties.

 

Problem:

This works fine when state is changed in Vault Client but it doesn't work when it is done in Inventor's Vault add-in.

It is because apprentice is executed within Inventor process.

 

According to the discussion in apprentice-error-run-time-error-91

it is not possible to use Apprentice inside Inventor process.

 

Possible solution:

I could use current Inventor instance which has open file to change its properties but I don't know how to get Inventor instance inside IWebServiceExtension.

My code is executed in Inventor process but I can't figure out how to get Inventor.Application object.

I don't know if it is possible.

 

I would like to avoid to use Marshal.GetActiveObject("Inventor.Application") since in case there will be more than one Inventor instance opened i can get into troubles.

 

Any help would be appreciated.

 

Best regards,

Kamil

0 Likes
366 Views
1 Reply
Reply (1)
Message 2 of 2

gavbath
Collaborator
Collaborator
I've only ever done it by using Marshal.GetActiveObject("Inventor.Application"). Can you not just do some checks? So if there are multiple instances, just go through them and see if any of them have the document that you are looking for open, if not, open it in one of the instances?

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

0 Likes