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: 

check if it is derived part in vba

1 REPLY 1
SOLVED
Reply
Message 1 of 2
skyngu
899 Views, 1 Reply

check if it is derived part in vba

hi,

 

how to check if a part document is a derived part in vba? then, I can check if its link is fine and updated.

 

thanks.

Autodesk Inventor Professional 2019
1 REPLY 1
Message 2 of 2
humbertogo
in reply to: skyngu

 

from Manufacturing DevBlog

 

 

  Public Sub ModifDerivedParams()

        If ThisApplication.ActiveDocument.DocumentType <>

           kPartDocumentObject Then

            MsgBox("Make a Part Document the active document")

            End

        End If

 

        Dim oDerPart As PartDocument

        oDerPart = ThisApplication.ActiveDocument

 

        Dim oDerPartComp As DerivedPartComponent

        If oDerPart.ComponentDefinition.ReferenceComponents.

           DerivedPartComponents.Count < 1 Then

            MsgBox("No Derived Part Components in this part")

            End

        End If

 

        oDerPartComp =

         oDerPart.ComponentDefinition.

          ReferenceComponents.DerivedPartComponents(1)

 

        Dim oDerivedPartDef As DerivedPartUniformScaleDef

        oDerivedPartDef = oDerPartComp.Definition

 

        Dim oDerEntity As DerivedPartEntity

        For Each oDerEntity In oDerivedPartDef.Parameters

            If (oDerEntity.ReferencedEntity.Name = "d1") Then

                oDerEntity.IncludeEntity = True

                Exit For

            End If

        Next

        'Set Definition back, so DerivedPart Document is updated

        oDerPartComp.Definition = oDerivedPartDef

    End Sub

 

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

Post to forums  

Autodesk Design & Make Report