find dervied base model in asembly

find dervied base model in asembly

NachoShaw
Advisor Advisor
315 Views
1 Reply
Message 1 of 2

find dervied base model in asembly

NachoShaw
Advisor
Advisor

Hi

 

Please see image. How can i find these derived base model parts to suppress them by using code only?

 

derived.jpg

 

Cheers

 

Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
316 Views
1 Reply
Reply (1)
Message 2 of 2

dano0310
Advocate
Advocate

Hi Nacho

 

See if this is what you are chasing

 

Sub Derived_Part_Hider()
    'Turns off all parts which have a derived feature as the first feature
    '4/02/2016   
    Dim oAssyDoc As Document
    Set oAssyDoc = ThisApplication.ActiveDocument
    
    If oAssyDoc.DocumentType = kAssemblyDocumentObject Then
        Dim oOccs As ComponentOccurrences
        Set oOccs = oAssyDoc.ComponentDefinition.Occurrences
        
        Dim oOcc As ComponentOccurrence
        For Each oOcc In oOccs
            If oOcc.DefinitionDocumentType = kPartDocumentObject Then
                If oOcc.Definition.Features(1).Type = kReferenceFeatureObject Then oOcc.Visible = False
            End If
        Next
        
    Else
        Exit Sub
    End If
End Sub

Regards

 

Dan

0 Likes