Multiple instances of Inventor on multi core CPU´s ? ( C# )

Multiple instances of Inventor on multi core CPU´s ? ( C# )

Anonymous
Not applicable
1,330 Views
3 Replies
Message 1 of 4

Multiple instances of Inventor on multi core CPU´s ? ( C# )

Anonymous
Not applicable

Is it possible to utilize a multicore CPU by running simultanious instances of Inventor and controlling them through the API?

 

The reason for asking is a standalone application that will que jobs taking approximately 2 minutes to compute in Inventor, but Inventor only seems to be using one core. ( Inventor 2010 & C# )

 

Any experiences, constraints, pitfalls, code examples would be appreciated.. I will gladly share my experiences if I could get a little guiding along the way.

0 Likes
1,331 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Hmmm..  Not much respons..

 

Here´s one for starters as myself..

 

using System;
using Inventor;

namespace MultiThreadTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Application myInventorA;
            Application myInventorB;
            Application myInventorC;
            Application myInventorD;
            try
            {
                Type inventorAppType = System.Type.GetTypeFromProgID("Inventor.Application");
                myInventorA = (Inventor.Application)System.Activator.CreateInstance(inventorAppType);
                myInventorB = (Inventor.Application)System.Activator.CreateInstance(inventorAppType);
                myInventorC = (Inventor.Application)System.Activator.CreateInstance(inventorAppType);
                myInventorD = (Inventor.Application)System.Activator.CreateInstance(inventorAppType);
            }
            catch
            {
                System.Windows.Forms.MessageBox.Show("hmmm");
            }
        }
    }
}

 

So in theory it´s straight forward, but it´s hard to believe no one has been out this road before?

 

Please respond if there is any interest in keeping this thread alive..

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi noontz,

 

Based on your code i'm not sure you would get the result that you are looking for. If you are looking to process multiple jobs simultaneously using your application, you should really make the application that you are writing multi-threaded, otherwise even though you have multiple instances of inventor open you will not be able to actively work with more than one at a time.

 

I don't work with threading enough to say for certain, but having a single threaded root application would probably limit Inventor to one core as well. I would try restructuring your application so that it delegates jobs to your inventor applications, with each one running in a different thread within your application. Like I said before, I don't really work with threading in my applications so I'm not 100% about this stuff, but I would definitely be interested in hearing how it turns out.

 

Best Regards,

John Potocny

0 Likes
Message 4 of 4

Anonymous
Not applicable

Thanks for the respons. I was a bit surprised by the lack of interest in the subject.

Sure the root application will have to manage the threads, but this is "rather easy" in C#, and each instance of Inventor will have to be working on jobs that  handle independent files.. My main goal is to performance test single parts in three threads and the assembly in a fourth, but it´s gonna be a spare time project, so it might be a while before I post any results. From what I have read IO bottlenecks, seems to be the main issue with multithreading and .NET..

 

 

0 Likes