Apprentice from Add-in

Apprentice from Add-in

Anonymous
Not applicable
680 Views
1 Reply
Message 1 of 2

Apprentice from Add-in

Anonymous
Not applicable

I've written a standalone vb.net program that first uses apprentice to "copy design" some assemblies. It then starts Inventor and builds an assembly of those files and updates parameters.  I'm trying to convert this to an addin. It appears apprentice can't be run from the add-in. I read a solution where it's recommended to create a separate exe for the apprentice part and call it running in its own process. That involved creating an activex component with vb6. I'm using vb.net 2010. I'm having problems figuring this out in .net. Also, I'd like to be able to have the addin know when the apprentice copy design is done.

Does this sound reasonable? Should I still do the copy design with apprentice? Could I do it with Inventor and not use apprentice? Thanks.

 

jrossco

Inventor 2014

WIndows 7

0 Likes
Accepted solutions (1)
681 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

You may get some ideas from the post published by Philippe Leefsma in the Cloud & Mobile DevBlog:   “Inter-process communication using WCF” http://adndevblog.typepad.com/cloud_and_mobile/2013/12/inter-process-communication-using-wcf.html.  A WCF server could be hosted by Apprentice based Copy Design application that executes requests from the client Inventor AddIn running on the same machine. It looks like this method could be efficient if you need to clone a lot of Inventor assemblies.

See also another Philippe’s post “Connecting an Inventor plug-in to an external application using WCF”  

http://adndevblog.typepad.com/manufacturing/2013/12/connecting-an-inventor-plug-in-to-an-external-ap.../

 

But the simplest solution is to start your CopyDesign standalone EXE utility from the Inventor AddIn providing appropriate arguments (source assembly FullFilename, target folder, prefix, suffix, etc.).

You may use .NET Framework Process class to start and stop local system processes.

http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.process(v=vs.100).aspx.  ProcessStartInfo class could be very useful to specify settings and arguments when you start a process.  http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.processstartinfo(v=vs.100).aspx.  Process.ExitCode property gets the value that the associated process specified when it terminated.  Both articles contain code samples.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network