Hi
Would it be possible that a rule can suppress all part's features that contain in their name a certain word.
I use to rename features for better workflow. More features that form a part of the model can contain same word, for instance "foot": foot_extrusion; foot_plate and so on.
When working with ilogic I have to specify each feature name, but I was thinking that may be would be easier to suppress the features by their name.
Thanks
Alexandru
Solved! Go to Solution.
Solved by rossano_praderi. Go to Solution.
Hi Alexandru,
this piece of code che be your solution...
Sub Main Fsuppress(True) Fsuppress(False) End Sub Private Sub Fsuppress(suppress As Boolean) myparam = InputBox("Feature Name", "Feature suppress", "") If myparam <> "" Then Dim oDoc as PartDocument oDoc = ThisApplication.ActiveDocument Dim oFeature As PartFeature For Each oFeature In oDoc.ComponentDefinition.Features If oFeature.Name.ToUpper.Contains(myparam.ToUpper) Then oFeature.Suppressed = suppress oDoc.Update End If Next End If End Sub
Bregs
Rossano Praderi
Thank you, this is almost what I wanted.
The difference is that, I don't need the input window.
For example I want a rule when it will be run to suppress al features with "nozzle" word in their name.
I tried to adapt the code, but didn't manage 😞
Hi Fakeru, let me know if this is helpful to you.
myparam = "YOUR TEXT" Dim oDoc as PartDocument oDoc = ThisApplication.ActiveDocument Dim oFeature As PartFeature For Each oFeature In oDoc.ComponentDefinition.Features If oFeature.Name.ToUpper.Contains(myparam.ToUpper) Then oFeature.Suppressed = True oDoc.Update End If Next
Bregs
Rossano Praderi
Yes, it works! Thank you so much!