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

Hi @dleesuk 

 

You can use something like this to find the largest rev letter.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oPartList As PartsList
oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)

oMax = "A"
oRowMax = 1

' Iterate through the contents of the parts list
Dim i As Long
For i = 1 To oPartList.PartsListRows.Count
	'look at only the REVISION column
	oCell = oPartList.PartsListRows.Item(i).Item("REVISION")

	Dim letterarray As New ArrayList
	letterarray.Add(oCell.Value)
	letterarray.Add(oMax)
	letterarray.Sort
	oMax = letterarray.Item(1)

	If oCell.Value = oMax Then oRowMax = i
Next

MsgBox("Row " & oRowMax & " has the largest rev letter of " & _
oPartList.PartsListRows.Item(oRowMax).Item("REVISION").Value, , "iLogic")