Message 1 of 11

Not applicable
11-17-2017
09:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello to all:
I need help modifying an iLogic rule, if possible.
This current rule suppresses all the features that contain "Control_Side" in their names.
SyntaxEditor Code Snippet
Sub Main() Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition Dim oUniqueOccurrencesFileNames As New List(Of String)() Dim oUniqueOccurrencesDefs As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection For Each oThing As ComponentOccurrence In oAsmDef.Occurrences If Not oUniqueOccurrencesFileNames.Contains(oThing.Definition.Document.FullFileName) Then oUniqueOccurrencesFileNames.Add(oThing.Definition.Document.FullFileName) oUniqueOccurrencesDefs.Add(oThing.Definition) End If Next Dim oStringToFilter As String = "Control_Side" ''' Make this whatever For Each oThing As ComponentDefinition In oUniqueOccurrencesDefs For Each oFeature As PartFeature In oThing.Features If oFeature.Name.ToUpper.Contains(oStringToFilter.ToUpper) Then oFeature.Suppressed = True End If Next Next InventorVb.DocumentUpdate() End Sub
I need the rule to be changed; I now need this Rule to run in the Inventor Drawing (.idw) environment instead, and all the features to be placed on the Inventor drawing layer called "power_breaks".
I'm pretty sure that this is the line needs to be changed :
oFeature.Suppressed = True
Can someone edit this for me? I'd greatly appreciate it. Thanks in advance!
Solved! Go to Solution.