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

Using ilogic to search subname in partnumber

Hello Everyone,

 

This is my first post on the forum, i've looked around but i couldnt find the answer. 

We use partnumbers that are a mix of letters and numbers. Example:

651-004-WA001

 

This partnumber will show in the partslist. Now i want to make an ilogic that only shows WA numbers in the partslist.

I've come to this:

 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
    
' Set a reference to the first parts list on the active sheet.
' This assumes that a parts list is on the active sheet.
Dim oPartList As PartsList
oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
   
' Iterate through the contents of the parts list.
Dim i As Long
For i = 1 To oPartList.PartsListRows.Count
'look at only the part number column
oCell  = oPartList.PartsListRows.Item(i).Item("Part Number")
	'look at iproperty value
	If oCell.Value = "" Then 
		'show the row
		oPartList.PartsListRows.Item(i).Visible = True
	Else
		'hide the row
		oPartList.PartsListRows.Item(i).Visible = False
	End If
Next

But a i dont know how to filter on the WA section of the partslist. (xxx-xxx-WAxxx)

 

Can somebody help me?

Kind regards,

 

Koen