12-25-2023
11:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-25-2023
11:26 PM
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
Or if this helped you, please, click (like)
Regards
Alan