Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Design Tracking Properties of parts through assembly using apprentice server

2 REPLIES 2
Reply
Message 1 of 3
danijel.radenkovic
397 Views, 2 Replies

Design Tracking Properties of parts through assembly using apprentice server

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.
2 REPLIES 2
Message 2 of 3

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.

Message 3 of 3

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report