Design Tracking Properties of parts through assembly using apprentice server

Design Tracking Properties of parts through assembly using apprentice server

danijel.radenkovic
Collaborator Collaborator
483 Views
2 Replies
Message 1 of 3

Design Tracking Properties of parts through assembly using apprentice server

danijel.radenkovic
Collaborator
Collaborator

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

 

Inventor 2018/Windows 10 x64
If this information was helpful, please consider marking it as an Accepted Solution by using the Accept as Solution. Kudos are also gladly accepted.
0 Likes
484 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk

You can find all referenced part document in ApprenticeServerDocument.AllReferencedDocuments(check the document type) and read their properties then. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

danijel.radenkovic
Collaborator
Collaborator

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

Inventor 2018/Windows 10 x64
If this information was helpful, please consider marking it as an Accepted Solution by using the Accept as Solution. Kudos are also gladly accepted.
0 Likes