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
Solved! Go to Solution.
Solved by BrianEkins. Go to Solution.
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 !
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
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 !
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)
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.
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.
Can't find what you're looking for? Ask the community or share your knowledge.