Component part feature suppression

Component part feature suppression

montylowe
Enthusiast Enthusiast
465 Views
1 Reply
Message 1 of 2

Component part feature suppression

montylowe
Enthusiast
Enthusiast

im looking for a way to suppress or delete a Component part feature from the assembly level by giving component name ("Part1") and component Feature name ("Hole6") thru the API

 

Thanks in advance......

0 Likes
Accepted solutions (1)
466 Views
1 Reply
Reply (1)
Message 2 of 2

montylowe
Enthusiast
Enthusiast
Accepted solution

I figured it out.

 

My Code

 

if component is not suppressed then it goes out and suppresses  or unsuppresses the feature based on a switch you send it. 

 

Sub

 

oCompDef = oDoc.ComponentDefinition

oCompOcc = oCompDef.Occurrences.ItemByName(Comp)

 

ofeat = iFeature.InventorFeature(Comp, Feat)

 

Sub ACSFeat(ByVal Comp, ByVal Feat, ByVal SWT)
        Dim oCompDef As Inventor.ComponentDefinition
        Dim oCompOcc As Inventor.ComponentOccurrence
        oCompDef = oDoc.ComponentDefinition
        oCompOcc = oCompDef.Occurrences.ItemByName(Comp)
        Dim ofeat As PartFeature
        ofeat = iFeature.InventorFeature(Comp, Feat)
        If oCompOcc.Suppressed = False Then
            If SWT = False Then
                If ofeat.Suppressed = False Then
                Else
                    ofeat.Suppressed = False
                End If
            Else
                If ofeat.Suppressed = True Then
                Else
                    ofeat.Suppressed = True
                End If
            End If
        Else

        End If
End Sub

 

 

0 Likes