Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a part that contains a sketch pattern in which I try to suppress a specific occurrence of that pattern the rule does work pretty well when I run the rule in the part environment. Still, when I run the rule from the assembly that contains this part, the rule does not work at all, probably because of the first two lines of my code.
I need to modify my code a little bit to be called from the assembly environment.
Dim oCompD As PartComponentDefinition
oCompD = ThisApplication.ActiveDocument.ComponentDefinition
Dim oFeature As PartFeatures
oFeature = oCompD.Features
Dim oPattern As SketchDrivenPatternFeature
oPattern = oFeature.SketchDrivenPatternFeatures.Item(1)
If Bags_NO = 6 Or Bags_NO = 8 Or Bags_NO = 11 Then
oPattern.PatternElements.Item(2).Suppressed = False
L2 = 400
Else
oPattern.PatternElements.Item(2).Suppressed = False
L2 = 600
End If
If Bags_NO = 5 Then
oPattern.PatternElements.Item(2).Suppressed = True
End If
If Bags_NO <=9 Then
oPattern.PatternElements.Item(3).Suppressed = True
Else If Bags_NO = 14
oPattern.PatternElements.Item(3).Suppressed = False
L3 = 400
Else
oPattern.PatternElements.Item(3).Suppressed = False
L3 = 600
End If
If Bags_NO <=10 Or Bags_NO = 12 Then
oPattern.PatternElements.Item(4).Suppressed = True
Else If Bags_NO = 11
oPattern.PatternElements.Item(4).Suppressed = False
L4 = 400
Else
oPattern.PatternElements.Item(4).Suppressed = False
L4 = 600
End If
InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True
ThisDoc.Save
that part, it does not work at all
Solved! Go to Solution.