Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

PartsList API performance issues.

Mircea_Dorobantu
Explorer

PartsList API performance issues.

Mircea_Dorobantu
Explorer
Explorer

I ran in to a wall dealing with the PartsList API.

Our organization deals with pretty large assemblies in the order of 750-1000 parts. When we create our drawing package the first drawing is BoM drawing containing all the parts in the project. We use the parts list for this purpose.

SplitTable.png

In order to make this work now, we use the "Split Table" command from the context menu when right clicking on a row. This splits the table at that row and 2 children tables appear in the tree. In our current process we split the parts list 8-10 times or more depending on the project size and then we move the sub tables to other sheets (2 tables per sheet). This is very time consuming. This functionality is not available through the API.

 

I decided that I could do this by making a copy of the full parts list and hide the rows that I don't need. That is to say, I have some code that copies the full expanded parts list in to a temporary sheet and then I loop through all the rows and set the visibility. Then I move the resulting "partial list" to the appropriate sheet. This worked reasonably well for an assembly with 40 parts. However when ruining on a full project with 600 parts the routine takes more that an hour. It stalls on setting the visibility of a row since Inventor runs the UpdatePartsList command after each call to the visibility property of the row.

 

I would like to mention I did the usual stuff to improve performance as per this blog post (http://modthemachine.typepad.com/my_weblog/2015/09/improving-your-programs-performance.html). The whole routine is warped in a global transaction. The drawing document is opened in the background, the loop is a foreach loop and I disabled user interactions. This is also and add-in so it runs in process.

 

If anybody has dealt with this issue before I would greatly appreciate any suggestion for making this work in a reasonable time.

 

If anybody from Autodesk sees this, is there any plans for bringing some of the functionality that is available through the user interface of the parts list to the API i.e the split table function. This might be useful for a lot of users since BoM work is very common and repetitive. (ideal for automation).

0 Likes
Reply
Accepted solutions (1)
745 Views
7 Replies
Replies (7)

chandra.shekar.g
Autodesk Support
Autodesk Support

@Mircea_Dorobantu,

 

For more understanding, can you please demonstrate automation or task with the help of video record (Assembly with 40 parts)? Please make sure that files are non confidential. 

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

Mircea_Dorobantu
Explorer
Explorer
Hi Chandra,



I have been swamped with other tasks at the moment. I will get back to you with a recording by the end of the week.



Cheers,

Merch


0 Likes

Frederick_Law
Mentor
Mentor

I haven't try it.

There are 2 properties in PartList: PartsList.MaximumRows and PartList.WrapAutomatically.

What happen when you set PartsList.MaximumRows to 20 and PartList.WrapAutomatically to TRUE?

0 Likes

Mircea_Dorobantu
Explorer
Explorer

I have tried what you suggest. However, this is not what I'm looking for since this simply wraps the BoM on the same sheet and i need the BoM to be split among several sheets (the BoM are simply to large to fit on one sheet).

 

Using the Split Table command mentioned in my initial post is what I'm looking for. This allows you to move the split parts in to different sheets. This is however not available in the API as far as I'm aware...

 

I'll post a screen capture late this week to clarify.

 

Cheers,

Mircea

0 Likes

omartin
Advocate
Advocate
Accepted solution

Not sure it would be any quicker, but maybe the split tables need to be regular tables.

you can get all the data from the original table, store it in a .net data table or something so you are not working in inventor any more, create the required table objects first with out placing them on the sheet, and then at the end just create regular tables in inventor....this adds the caveat of the tables being possibly out of sync...

Was my reply Helpful ? send a Kudos or accept as solution
0 Likes

Mircea_Dorobantu
Explorer
Explorer

Thanks for the idea! This worked for my needs perfectly!

 

Cheers,
Merch

0 Likes

omartin
Advocate
Advocate

Awesome good to know, glad it worked out for you!!

Was my reply Helpful ? send a Kudos or accept as solution
0 Likes