Custom iProperties in component with VBA

Top  Previous  Next

Here is an example:

 

    Dim Inv As Inventor.Application

 

    Set Inv = GetInventorApp()

 

    Dim invAsm As Inventor.AssemblyDocument

 

 

    Set invAsm = Inv.Documents.Open(sComponentFullFileName)

 

    ' from iProperties

    ' CC_FIN_GEOMETRY

    ' CC_NUM_RANGHI

    ' TC_NAME = T014_R006_N014_T55_E02R_U01R_V1_V02

 

    Set PropSet = invAsm.PropertySets.Item("Inventor User Defined Properties")

 

 

    sGeom = PropSet.Count

 

    For p = 1 To PropSet.Count

        If PropSet.Item(p).Name = "CC_NUM_RANGHI" Then

            iNumRanghi = PropSet.Item(p).Value

 

        ElseIf PropSet.Item(p).Name = "CC_FIN_GEOMETRY" Then

            sGeom = PropSet.Item(p).Value

 

        ElseIf PropSet.Item(p).Name = "TC_NAME" Then

            sTcName = PropSet.Item(p).Value

 

        End If

 

    Next p

 

    Debug.Print "G= <" & sGeom & ">, numranghi = <" & iNumRanghi & ">"

    

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)