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: 

Parallel threading in iLogic

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Holgarsson
873 Views, 4 Replies

Parallel threading in iLogic

Hi

 

We have been experimenting with Parallel threading. The situation is that I have an assembly that contains multiple parts (approx. 40) which all have contained "almost" the same code. In order to rationalize this; we have rearranged the code in such way that we now only reference External iLogic rules form these 40 part files (only one place to revise the code if necessary).

 

The side effect to this rationalization has been tha we have problems in executing the codes in parallel, see this simplified example:

 

Imports System.Threading.Tasks

Parallel.For(1,40, Sub(h As Integer)
                    iLogicVb.RunRule ("Part "& h &"", "iTriggerRule")
                End Sub)

 

 Now all of these 40 part files try to execute their code.

 

 

'Configutation of Part files
iTrigger=iTrigger0
iLogicVb.RunExternalRule("Cut configuration")
iLogicVb.RunExternalRule("Bracing of the part")
iLogicVb.RunExternalRule("Parameter context")

 As they all are dependent upon running the same external rules the result is that not all part files are updated according to the required design requirements. It seem as if one of the part files calls the external rule and the rule is "busy" handling another part file it just terminates without warnings or errors.

 

Can multiple part files run the same external rule at the same time?

Is there some form of queue?

I do not get any warnings or errors, the partfiles just do not update. How can I make sure that all the part files run the external rules and is there a way of checking this?

 

Regards

Kari

 

4 REPLIES 4
Message 2 of 5

Hi Kari,

 

iLogic is based on the Inventor API, which doesn't support multithreading and parralel tasks, so there is no chance iLogic can take advantage of parallel programming for the moment.

 

Being a COM API, the calls to the Inventor API are just getting queued in the order they are performed and then being executed sequentially, however with the iLogic extra layer and the potentially complex inter-dependencies between the rules, it is possible to have side effects like the one you mentionned.

 

My advice would be just not make use of parralel programming when using Inventor API or iLogic as you will hardly get any benefit out of it anyway.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 5
jdkriek
in reply to: philippe.leefsma

Thank you Philippe, this is good information to know.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 4 of 5

Thanks for the information.

 

I will follow your advice.

Message 5 of 5
maxim.teleguz
in reply to: Holgarsson

With later versions of inventor is this possible yet?

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

Post to forums  

Autodesk Design & Make Report