Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a code that works for hole count that looks at sketch driven pattern and it works great. If the part is cut and some holes are no longer visible it still counts them. Is there a code that will count only the visible holes of a named sketch pattern and add that # to a custom iprop? below is the code I now for a part with no cuts. I then push qty in to a sketch symbol.
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then MsgBox("This rule only works for Part Documents. Exiting.", vbOKOnly, " ") Exit Sub End If Dim oSDPs As SketchDrivenPatternFeatures = ThisDoc.Document.ComponentDefinition.Features.SketchDrivenPatternFeatures Dim oSDP As SketchDrivenPatternFeature Dim oFPE As FeaturePatternElement If oSDPs.Count > 0 Then For Each oSDP In oSDPs oCount = 0 For Each oFPE In oSDP.PatternElements If Not oFPE.Suppressed Then oCount = oCount + 1 Next iProperties.Value("Custom", oSDP.Name & " Active Count") = oCount Next End If
Solved! Go to Solution.