Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run more apprentice server in the same time

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
infoQN6A6
519 Views, 5 Replies

Run more apprentice server in the same time

Hi all,

I need to run more apprentice server component from a my application.

To do this I use more tasks but the problem is that the apprentices don't works, only 1 at time is working.

I need to do this because I have to manage a lot of files (about 300000) and is better have more tasks to check all.

 

If I create more than 1 application they works, I can understand that I can manage 1 apprentice server of each my application.

 

Someone knows this argument?

 

Thanks a lot

Valerio Pittavino
5 REPLIES 5
Message 2 of 6

Does this work:

 

Dim a1 As Inventor.ApprenticeServer = New Inventor.ApprenticeServerComponent
Dim b1 As Inventor.ApprenticeServerDrawingDocument = Nothing
'Dim c1 As Inventor.ApprenticeServerDocument = Nothing


Dim a2 As Inventor.ApprenticeServer = New Inventor.ApprenticeServerComponent
Dim b2 As Inventor.ApprenticeServerDrawingDocument = Nothing
'Dim c2 As Inventor.ApprenticeServerDocument = Nothing


b1 = a1.Open(FullName)
b2 = a2.Open(FullName)

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 3 of 6
infoQN6A6
in reply to: infoQN6A6

Ok, but I want that all works in the same time and this not happen in this way. I tried.

I tried to insert the code in a separate thread but they don't work in the same time, for example

Apprentice 1 is opening a big assembly (20 seconds)

I want open an ipt with Apprentice 2 and it will open the file only after Apprentice 1 has finished its operation.

 

Now I created an external .exe (command line) and I start more istances of .exe and in this way all work fine

Valerio Pittavino
Message 4 of 6

use:  Application.DoEvents()

            Dim a1 As Inventor.ApprenticeServer = New Inventor.ApprenticeServerComponent
            Dim b1 As Inventor.ApprenticeServerDrawingDocument = Nothing
            'Dim c1 As Inventor.ApprenticeServerDocument = Nothing


            Dim a2 As Inventor.ApprenticeServer = New Inventor.ApprenticeServerComponent
            Dim b2 As Inventor.ApprenticeServerDrawingDocument = Nothing
            'Dim c2 As Inventor.ApprenticeServerDocument = Nothing

            Application.DoEvents()

            b1 = a1.Open(FullName)
            b2 = a2.Open(FullName)

  

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 5 of 6
NachitoMax
in reply to: infoQN6A6

Hey

 

maybe this link could help?

 

https://adndevblog.typepad.com/manufacturing/2014/09/apprentice-in-side-thread.html

 

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 6 of 6
BrianEkins
in reply to: infoQN6A6

Apprentice is loaded and runs within the process of the program that is using it. Apprentice doesn't support multi-threading so you can't have a unique Apprentice associated with separate threads in the process.  To work around this you'll need to have multiple processes (exe's) where each one starts and drives Apprentice.  

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report