Hello,
I have iLogic code to create the necessary dimensions in my drawing views. However, I need to determine if a feature is suppressed and, if so, skip creating dimensions.
I captured the model name as shown below.
ActiveSheet = ThisDrawing.Sheet("UPPER SM PAN:18") Dim modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
I want to check the file to see if certain features are suppressed.
Solved! Go to Solution.
Solved by J_Dumont. Go to Solution.
Hi @J_Dumont
You will need to use the inventor API for this. From the model document you will need to declare as a partcomponentdefinition, then traverse PartFeatures
PartComponentDefinition.Features()
As PartFeatures
Then check each Partfeature for being suppressed
PartFeature.Suppressed() As Boolean
Here is a sample.
Dim partDoc as PartDocument = ThisDrawing.ModelDocument
Dim partDef as PartComponentDefinition = partDoc.ComponentDefinition
For each feat as PartFeature in partDef.Features
If feat.Name = "xyz" AndAlso feat.Suppressed = True Then
'DO SOMETHING
End If
Next
Hi @A.Acheson
Thanks for the help.
I was able to get what I needed using the code shown below.
Dim Sheet_18 = ThisDrawing.Sheets.ItemByName("UPPER SM PAN:18") Dim FrontView = Sheet_18.DrawingViews.ItemByName("FrontView") Dim modelDoc = FrontView.ModelDocument Dim modelObjects = StandardObjectFactory.Create(modelDoc) If modelObjects.Feature.IsActive(modelDoc, "Notch Cut Out") AddNotchForAnchor = True Else AddNotchForAnchor = False End If
Can't find what you're looking for? Ask the community or share your knowledge.