cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API access to auto sort on update in parts list

API access to auto sort on update in parts list

I would like to be able to turn on the Parts List auto sort on update option from the API. This would be useful for either defaulting the option to on with ilogic (since there is not currently a way to default this option on) or simply turning the option on when running a script that edits the BOM or Parts List. That way if manual edits are made afterwards the Parts list will update without further action.

 

I will also throw in someones request for being able to set this option in a template or style. I feel both of these ideas are similar and both provide a better level of control.

 

http://forums.autodesk.com/t5/inventor-general-discussion/auto-sort-parts-list-iv2016/td-p/6402958

32 Comments
Carl_mgfx
Advocate

I see there are default column settings for Column Chooser, Grouping and Filter... Why not just add "Sort".  See image.

 

Sort defaults in Styles.png 

chrisw01a
Collaborator

Carl, has anything been done on this?  Adding a "sort" option to the default parts list style would be really nice.  I hate that you have to set your sorting parameters every time you make a new parts list.

 

In other words, I agree 100% with your post.

 

Anyone else use this?

 

Chris

Carl_mgfx
Advocate

I haven't heard or seen anything with regards to this improvement, to be honest I haven't really been paying attention to it.  Hopefully it will slip in quietly somewhere along the line.

chrisw01a
Collaborator
Ok.

Thanks.
dusan.naus.trz
Advisor

Thumbs up.

DRoam
Mentor

Technically, this was implemented with the "Sort2" method in 2018. However, not fully. We can "Set" the auto-sort, but we can't "Get" it in order to query if a Parts List is set to auto-sort or not. So only half access. We still need access to the current state of auto-sort.

 

Related thread: Determine (Get) Parts List "Auto Sort on Update" status.

chrisw01a
Collaborator
It would be so nice if we could just set a default to auto sort by part
number and auto update.
dusan.naus.trz
Advisor

Hi @chrisw01a 

Many things would be nice just to make the right decision and step forward.))))

https://forums.autodesk.com/t5/inventor-ideas/new-bill-of-materials/idi-p/8358449

dan_szymanski
Autodesk
Status changed to: Future Consideration

Idea added to backlog for future consideration [498]. Thanks!

akaluri
Enthusiast

@dan_szymanski do you know if there is a way to have a default sort order in the .iam BOM? I see a lot of ilogic to first sort in the parts list (in .idw) and then it would be reflected in the BOM. But I am wondering if there is any way to do this in the assembly itself (ilogic or setting). Also, I saw ilogic for sorting only one parameter in the BOM, but I need to sort 3 parameters. Thank you!

 

MjDeck
Autodesk

@akaluri , you can set the default sort order on the BOM and save that assembly as a template. Then that setting will persist in new assemblies that you create from that template.
Here's sample code to sort by three columns in the BOM. The sample column names are A, B, and C.
Dim assemDoc As AssemblyDocument = ThisDoc.Document
Dim bomView = assemDoc.ComponentDefinition.BOM.BOMViews("Parts Only")
bomView.Sort2("A", True, "B", False, "C", True, SortByString := True)

dusan.naus.trz
Advisor

Hi @MjDeck 

I tried it. It's all nice to work. I have a question. Please how to extend the sort to more than 3? I have more items for sorting and for a long time do not know what to do. Is it possible using iLogic? I tried to add more sort to your code, but it didn't work. Thank you very much.

MjDeck
Autodesk

@dusan.naus.trz , it looks like we can't sort by more than three columns. I'm confirming that now. If it turns out to be true, please create a new Idea entry for this.
As a workaround, would it be useful to you to export the BOM and then sort it? If so, I can help with some iLogic code to do it.

DRoam
Mentor

@dusan.naus.trz, one trick you could use to sort by as many columns as you want is to create a custom iProperty column called something like "Sort" or "Sorter", and in that column, concatenate all of the properties you want to sort by. So if you want to sort by Project, then Description, then Stock Number, then Part Number, you would set Sort to:

 

=<Project> <Description> <Stock Number> <Part Number>

Then hit "Enter". The Sort property will then concatenate each of those properties. You can copy/paste this to each row in the BOM, or use iLogic to do this in your assemblies automatically so you don't always have to do it.

 

Then you can sort your BOM by just that one column.

MjDeck
Autodesk

@DRoam , it seems like that would work only if each of those properties was a fixed-length string. I guess there might be a company standard format for some properties, but even then there could be exceptions.

DRoam
Mentor

@MjDeck that's a good point, I didn't think of that. It may not work well in some situations. We actually do something similar what I described, but we do use iLogic to populate the sorting string rather than simple concatenation. And the iLogic applies the following format for each part: "[TYPE] [STOCK SIZE formatted as XXXX.XXXX] X [CUT LENGTH formatted as XXXX.XXXX]".

 

This works well to sort by type, then stock size, then cut size. But it wouldn't work well for variable-length strings, as you said.

dusan.naus.trz
Advisor

Hi, @MjDeck 

I'm sending the Idea. https://forums.autodesk.com/t5/inventor-ideas/more-keys-for-parts-list/idi-p/7690004

I'll be very happy if you help me with iLogic for more sort (keys) for BOM or Parts list. I believe it will help more people. Thank you.

MjDeck
Autodesk

Just to clarify: the iLogic sort is only for exported data. It can't be used to modify the BOM or parts list in the Inventor document.

dusan.naus.trz
Advisor

Hi, @MjDeck 

Yes, I understand. Please. Is it possible for another update of Inventor 2020.1 or .2 to have function more sort feature for BOM and Part List?

 

MjDeck
Autodesk

@dusan.naus.trz , I'm not sure how soon we can do it.
Let's continue the discussion about more sort columns on the other Idea page: https://forums.autodesk.com/t5/inventor-ideas/more-keys-for-parts-list/idi-p/7690004

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

Submit Idea