Autosort partslist with 2 parts list on 1 sheet

Autosort partslist with 2 parts list on 1 sheet

Robin_Erich
Advocate Advocate
553 Views
2 Replies
Message 1 of 3

Autosort partslist with 2 parts list on 1 sheet

Robin_Erich
Advocate
Advocate

I use a I-logic rule I found on this forum to sort the parts list by POS and toggle auto sort on update,

my workplace uses 2 seperate parts lists, one for normal parts and one for purchased parts.

I would like to change the code so that it does the auto sort for both lists, is this possible?

 

the code we use:

 

On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oPartsList As PartsList
oPartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
oPartsList.Sort2("POS", True, , , , , , True)

 

Did this reply help? Please click the „Accept Solution“ button. Helps me gather those Internet points
Check out my Ideas! I’m interested in your input and/or opinions.
https://autode.sk/3paEHwS
0 Likes
Accepted solutions (1)
554 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution

@Robin_Erich 

Something like this should work then? 🙂

On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
For Each oPartsList As PartsList In oDrawDoc.ActiveSheet.PartsLists
oPartsList.Sort2("POS", True, , , , , , True)
Next
Message 3 of 3

Robin_Erich
Advocate
Advocate

Thanks! it works like a charm.. have a nice day!

Did this reply help? Please click the „Accept Solution“ button. Helps me gather those Internet points
Check out my Ideas! I’m interested in your input and/or opinions.
https://autode.sk/3paEHwS