Message 1 of 2
Check Feature Suppression
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an iLogic code to change the direction of a rectangular pattern as shown here:
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
oDef = oDoc.ComponentDefinition
If zeroCorner = "LEFT" Then
oDef.Features.RectangularPatternFeatures("Rectangular Pattern1").Definition.NaturalXDirection = True
oDef.Features.RectangularPatternFeatures("Rectangular Pattern2").Definition.NaturalXDirection = True
oDef.Features.RectangularPatternFeatures("Rectangular Pattern3").Definition.NaturalXDirection = True
Else
oDef.Features.RectangularPatternFeatures("Rectangular Pattern1").Definition.NaturalXDirection = False
oDef.Features.RectangularPatternFeatures("Rectangular Pattern2").Definition.NaturalXDirection = False
oDef.Features.RectangularPatternFeatures("Rectangular Pattern3").Definition.NaturalXDirection = False
End If
Subsequently, I have rules in place to suppress the rectangular patterns within the part. When the code given above is ran while the patterns are suppressed Inventor immediately crashes, losing all work. I would like to add a try/catch to check the suppression of the patterns before the change in direction takes place, but am having trouble finding an answer.
I'm assuming something like this will work, but have not had any luck:
Try
oDef.Features.RectangularPatternFeatures("Rectangular Pattern1").GetSuppressionCondition
Catch
MessageBox.Show("Make pattern active before executing change.", "Error")
End Try
How can I check that the rectangular pattern is active before changing the direction of the pattern? Thanks!