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: 

Inventer API and Parallelization

6 REPLIES 6
Reply
Message 1 of 7
JamieVJohnson2
624 Views, 6 Replies

Inventer API and Parallelization

JamieVJohnson2
Collaborator
Collaborator

So while my code compiles and runs, Inventor 2018 sometimes behaves and sometimes throws a conniption fit, and blows up completely.  Is there a guide as to what is safe to do in Parallel within Inventor?  ("nothing", being the easy response)

 

I know that 2019 has received many more parallel abilities in the core, but what about through the API? 

 

If I wanted to read multiple properties from the same document in mass, if I wanted to check parameters values in mass, if I wanted to verify 3D points in mass.  Many of these things seem harmless, but fail.  For adding items, I can code the use of synclock, but Inventor runs the code with 50% stability.  Many times it runs into memory violation issues, or 'not marshal-able' issues with its sub classes.  I've even attempted to reclass some inventor objects to get speed out of them, but that's reinventing the wheel so to speak.

 

Since we (developers) are attempting to make programs that work faster than the human on redundant tasks, I 'd like to be able to take advantage of parallelization from system.threading.tasks.parallel.

jvj
0 Likes

Inventer API and Parallelization

So while my code compiles and runs, Inventor 2018 sometimes behaves and sometimes throws a conniption fit, and blows up completely.  Is there a guide as to what is safe to do in Parallel within Inventor?  ("nothing", being the easy response)

 

I know that 2019 has received many more parallel abilities in the core, but what about through the API? 

 

If I wanted to read multiple properties from the same document in mass, if I wanted to check parameters values in mass, if I wanted to verify 3D points in mass.  Many of these things seem harmless, but fail.  For adding items, I can code the use of synclock, but Inventor runs the code with 50% stability.  Many times it runs into memory violation issues, or 'not marshal-able' issues with its sub classes.  I've even attempted to reclass some inventor objects to get speed out of them, but that's reinventing the wheel so to speak.

 

Since we (developers) are attempting to make programs that work faster than the human on redundant tasks, I 'd like to be able to take advantage of parallelization from system.threading.tasks.parallel.

jvj
6 REPLIES 6
Message 2 of 7
raymondxu
in reply to: JamieVJohnson2

raymondxu
Autodesk
Autodesk

Hi jvj,

 

Thanks for reporting your requirements. At this point, we did not expose parallel capability through API. If you really need tasks being processed in parallel, I suggest you to try run multiple Inventor processes at the same version.

Meanwhile, you still need deal with general multiple core/thread safe. But this really depends on your tasks. However I am not sure whether this can meet your requirement as they are in different process.

 

Regards,

Ray



Raymond Xu
Software Architect
Autodesk, Inc.
0 Likes

Hi jvj,

 

Thanks for reporting your requirements. At this point, we did not expose parallel capability through API. If you really need tasks being processed in parallel, I suggest you to try run multiple Inventor processes at the same version.

Meanwhile, you still need deal with general multiple core/thread safe. But this really depends on your tasks. However I am not sure whether this can meet your requirement as they are in different process.

 

Regards,

Ray



Raymond Xu
Software Architect
Autodesk, Inc.
Message 3 of 7
JamieVJohnson2
in reply to: raymondxu

JamieVJohnson2
Collaborator
Collaborator

The issue lies in attempting to speed up the processing of a single file.  So multiple Inventor's won't help there much.  I've found a few bottle necks that could be address in the mean time,  sketchpoint.geometry3d.x,y,z is way to slow.  Doing point math takes more time than expected (compared to autocad, or pure data classes).

if ParameterSet.Parameter.Name = string then... is way to slow (the iteration takes seconds for only 100 parameters). 

Enumerators are slower than expected when faced with over 50 (custom parameters exported as properties).

Our machines are Xeon 6 core, 32gb ddr4, Nvidia Quadro K5200 based (HP Z440), and there should not be this kind of lag in the code.  We can walk to those processing being optimized, before we run to parallelization.

jvj
0 Likes

The issue lies in attempting to speed up the processing of a single file.  So multiple Inventor's won't help there much.  I've found a few bottle necks that could be address in the mean time,  sketchpoint.geometry3d.x,y,z is way to slow.  Doing point math takes more time than expected (compared to autocad, or pure data classes).

if ParameterSet.Parameter.Name = string then... is way to slow (the iteration takes seconds for only 100 parameters). 

Enumerators are slower than expected when faced with over 50 (custom parameters exported as properties).

Our machines are Xeon 6 core, 32gb ddr4, Nvidia Quadro K5200 based (HP Z440), and there should not be this kind of lag in the code.  We can walk to those processing being optimized, before we run to parallelization.

jvj
Message 4 of 7
raymondxu
in reply to: JamieVJohnson2

raymondxu
Autodesk
Autodesk

Simply call these two properties are not slow. I am wondering whether this is related to your logic, saying your code need frequently call them. If you can send me some sample code and dataset which reproduce performance, we are happy to look into them.



Raymond Xu
Software Architect
Autodesk, Inc.
0 Likes

Simply call these two properties are not slow. I am wondering whether this is related to your logic, saying your code need frequently call them. If you can send me some sample code and dataset which reproduce performance, we are happy to look into them.



Raymond Xu
Software Architect
Autodesk, Inc.
Message 5 of 7
JamieVJohnson2
in reply to: raymondxu

JamieVJohnson2
Collaborator
Collaborator

I can give you the entire solution of projects if you like.  but for now, check out this code (Public sub UserFinishCustomProfile) and this file (C-18105-01-test.iam).  To use, (not all code is present such as getting the Inventor Application), the user would activate the Clearance Profile sketch in Inventor, then select all the lines of the profile surround (surrounding of load on railcar), activate the command (I have a button on a separate window), that directly runs UserFinishCustomProfile.  Then the command would take the selected lines, filter and validate their points, remove any stuck dimensional attributes (ATRWide includes a work around due to the error in the api with assembly sketch dimensions not properly creating linked parameters discovered several years ago, reported and not fixed).  Finally it would reassemble a clean profile, and tag the lines and add new dimensions (labeled).  The bottlenecks are ATRWide searching parameters, and the sort routines, looking at geometry3D point data.  In addition inventor is very slow when creating dimensions in the assembly sketch. 

 

Make it faster, I dare you.

jvj
0 Likes

I can give you the entire solution of projects if you like.  but for now, check out this code (Public sub UserFinishCustomProfile) and this file (C-18105-01-test.iam).  To use, (not all code is present such as getting the Inventor Application), the user would activate the Clearance Profile sketch in Inventor, then select all the lines of the profile surround (surrounding of load on railcar), activate the command (I have a button on a separate window), that directly runs UserFinishCustomProfile.  Then the command would take the selected lines, filter and validate their points, remove any stuck dimensional attributes (ATRWide includes a work around due to the error in the api with assembly sketch dimensions not properly creating linked parameters discovered several years ago, reported and not fixed).  Finally it would reassemble a clean profile, and tag the lines and add new dimensions (labeled).  The bottlenecks are ATRWide searching parameters, and the sort routines, looking at geometry3D point data.  In addition inventor is very slow when creating dimensions in the assembly sketch. 

 

Make it faster, I dare you.

jvj
Message 6 of 7

JamieVJohnson2
Collaborator
Collaborator

system won't let me upload cad files or zip of pack-n-go.

jvj
0 Likes

system won't let me upload cad files or zip of pack-n-go.

jvj
Message 7 of 7
raymondxu
in reply to: JamieVJohnson2

raymondxu
Autodesk
Autodesk

I am not sure whether it is big. If it is not that big, can you share with me through my mail: Raymond.xu@autodesk.com?



Raymond Xu
Software Architect
Autodesk, Inc.
0 Likes

I am not sure whether it is big. If it is not that big, can you share with me through my mail: Raymond.xu@autodesk.com?



Raymond Xu
Software Architect
Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report