Hello friends,
I have another problem. I am trying to get idea how to get properties (author, revision...) of all parts from an opened assembly using apprentice server.
Any idea?
Thanks in advance
Danijel
You can find all referenced part document in ApprenticeServerDocument.AllReferencedDocuments(check the document type) and read their properties then. Hope this helps.
Hello yuhanzhang,
Thank you for the answer, I solved the problem few days before your reply but I forgot to share solution. Code is below and thank you very much for trying to help me.
Dim apprentice As Inventor.ApprenticeServerComponent
Dim partDoc As Inventor.ApprenticeServerDocument
Dim partPropSet As Inventor.PropertySet
Dim partProp As Inventor.Property
Dim partPath As String
For Each occ As Inventor.ComponentOccurrence In apprenticeDoc.ComponentDefinition.Occurrences
If occ.DefinitionDocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
DIM partName as String
partName=occ.Name
Dim stFilePathAndName As String
stFilePathAndName = openFileDialog1.FileName
partPath = Path.GetDirectoryName(stFilePathAndName)
partDoc = apprentice.Open(partPath & "\" & partName & ".ipt")
partPropSet = partDoc.PropertySets.Item("Design Tracking Properties")
partProp = partPropSet.Item("Part Number")
DataGridView1.Rows.Add(partName,partProp.Value)
End If
Next