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

Hi @formobalaji 

 

Maybe something like this would work. This rule will expect to find a part number "1234" in a part file in the project folder. This rule is untested so you might find errors. Post back with the error messages on the more info tab.

 

Dim prjfolder As String = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath & "\")
Dim projectDir As New IO.DirectoryInfo(prjfolder)

Dim workFiles As String() = projectDir.GetFiles("*.ipt")
Dim doc As Document
For Each fi As String In workFiles 

	doc = ThisApplication.Documents.Open(fi,False)
	
	Try
		
		Dim designProp As PropertySet = invDoc.PropertySets.Item("Design Tracking Properties")
		Dim partNo as String  = designProp.Item|("Part Number").Value
		If partNo = "1234" Then
			Logger.Info("Found partNo : " & partNo,)
		End If
	Catch ex as Exception
		Logger.Info(ex & "-" & "Error Getting Part Number",)
	End Try

Next

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan