Message 1 of 5
Suppress all features starting with 02 or 03 etc. in a part
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We have an ilogic code that allows you to switch features back and forth with the suppression using the "low and high" parameters. This has worked wonderfully so far.
But I'm looking for a shorter way where I say: suppress all features that start with "03 - ".
Does anyone have a solution?
Attached is the current ilogic code
Dim part As PartDocument = ThisDoc.Document Dim features As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection() Features.Add(Feature.InventorFeature("Extrusion - polygon:1")) Features.Add(Feature.InventorFeature("Rectangular Pattern - polyon:1")) If Level:of:detail = "low" Then Dim featuresToSuppress = ThisApplication.TransientObjects.CreateObjectCollection() For Each f As PartFeature In features If Not f.Suppressed Then featuresToSuppress.Add(f) Next part.ComponentDefinition.SuppressFeatures(featuresToSuppress) 'NO Error End If If Level:of:detail = "high" Then Dim featuresToUnsuppress = ThisApplication.TransientObjects.CreateObjectCollection() For Each f As PartFeature In features If f.Suppressed Then featuresToUnsuppress.Add(f) Next part.ComponentDefinition.UnsuppressFeatures(featuresToUnsuppress) ' NO Error End If
Where 2 feature suppressions now take place:
Features.Add(Feature.InventorFeature("Extrusion - polygon:1"))
Features.Add(Feature.InventorFeature("Rectangular Pattern - polyon:1"))
If possible, I would like to replace this with e.g.:
Features.Add(Feature.InventorFeature("03 - *.*"))