Create visibility states for same feature found throughout all parts in assembly

Create visibility states for same feature found throughout all parts in assembly

Anonymous
Not applicable
448 Views
1 Reply
Message 1 of 2

Create visibility states for same feature found throughout all parts in assembly

Anonymous
Not applicable

I need help with turning on and off a common feature found in every part I have in any given assembly.  I've tried using Levels of Detail and Views, but I get the impression that those options are only available for parts, not the features in those parts.  True or not?

 

More specifically...I have conveyor beds as parts that have a feature in them called Control_Side_Crossover.  In any given project. some of the beds have this feature switched on, some have it off.  I need a way to globally shut them all off (for BOM export purposes) and then return them to their previous state.  I had kinda the same question a while ago, but that was for globally shutting off a feature that was completely either globally on/off.  

 

Again...this time, I need to capture the "visibility" state of a different component, globally turn them all off, then all-at-once restore the select few that were previously turned on. 

 

Thanks in advance for any help!

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

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @Anonymous,

 

Hope below sample iLogic rule can help to turn on / off specific Feature. It is tested with attached assembly file.

 

In this example, iLogic rule would turn on / off of Hole Feature.

 

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim featName As String = "Hole"

Dim oDef As AssemblyComponentDefinition
oDef = oDoc.ComponentDefinition

For Each occ As ComponentOccurrence In oDef.Occurrences
    If occ.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject Then
        Dim partDef As PartComponentDefinition
        partDef = occ.Definition

        For Each oFeature As PartFeature In partDef.Features
            If oFeature.Name.StartsWith(featName) Then
                If oFeature.Suppressed = True Then
                    oFeature.Suppressed = False
                Else
                    oFeature.Suppressed = True
                End If
            End If
        Next
    End If
Next

InventorVb.DocumentUpdate()

Refer the following link for more details on iLogic.

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-C5ADE109-10E9-41A0-BC4A-BE73AA68A1C7

 

Please feel free to contact if there is any doubt.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes