Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
chandra.shekar.g
in reply to: GeorgK

@GeorgK ,

 

Hoping that below iLogic code may be helpful to sort part numbers.

 

Dim oDoc As DrawingDocument 
oDoc = ThisApplication.ActiveDocument 

Dim oSheet As Sheet 
oSheet = oDoc.ActiveSheet 

Dim oPartslist As PartsList
oPartslist = oSheet.PartsLists.Item(1)

Dim oRow As PartsListRow 
 
Dim myList As New List(Of String)()
Dim i As Integer  
For Each oRow In oPartslist.PartsListRows 
	If oRow.Item(3).Value.Length = 13 Then
		myList.Add(oRow.Item(3).Value)
	End If 
Next
Dim list() As String = myList.ToArray()
Dim result = list.OrderBy(Function(q) q.Substring(11)).ToArray

i = 1
For Each s As String In result
    For Each oRow In oPartslist.PartsListRows 
		If s = oRow.Item(3).Value Then
			Call oRow.Reposition(i)
			i = i + 1
		End If
	Next 
Next

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network