Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I have a code that populate 3 different listboxes.
1st listbox = Displayname of part if drawing is approved
2nd listbox = Displayname of part if drawing exists but not approved
3rd listbox = DIsplayname of part if drawing doesnt exist
The 2nd and 3rd listbox works perfectly, but grabbing value of "Mfg Approved By" from the drawing is a bit more tricky it seems.
My code so far:
Dim invapp As Inventor.Application
invapp = GetObject(, "Inventor.Application")
Dim asmDoc As AssemblyDocument
asmDoc = invapp.ActiveDocument
If asmDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
For Each Doc In asmDoc.AllReferencedDocuments
If Doc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
Try
Dim drawing As String = Doc.FullFileName
drawing = drawing.Substring(0, drawing.Length - 3)
If System.IO.File.Exists(drawing & "idw") Then
If drawing.PropertySets("Design Tracking Properties").Item("Mfg Approved By").Value <> "" Then
ListBox1.Items.Add(Doc.DisplayName)
Else
ListBox2.Items.Add(Doc.displayname)
End If
End If
ListBox3.Items.Add(Doc.DisplayName)
Catch ex As Exception
MsgBox(Doc & " : failed to check part")
End Try
End If
Next
End if
This code won't work cause I've placed a dummy text in " If drawing.propertysets .." just to illustrate what I want to achieve.
Can anyone help me with this?
Thanks!
Solved! Go to Solution.