Community
hi everyone,
I want to suppress the hole features which is having diameter less than the thickness of part by using API.Can anyone help me on this.
Thanks and Regards
Yogesh
Hi,
This is what you need, you'll need to rename the value that represents the thickness consequently, this way the code will do what you want
Sub SupressSmallHoles() Dim oPartDoc As PartDocument Set oPartDoc = ThisApplication.ActiveDocument Dim oPartDef As PartComponentDefinition Set oPartDef = oPartDoc.ComponentDefinition Dim dblThickness As Double dblThickness = oPartDef.Parameters.ModelParameters.Item("Thickness").Value 'Change name as required Debug.Print dblThickness Dim oHoleFeature As HoleFeature For Each oHoleFeature In oPartDef.Features.HoleFeatures If oHoleFeature.HoleDiameter.Value < dblThickness Then oHoleFeature.Suppressed = True End If Next oHoleFeature End Sub
Hello Frederic,
Thank you for the answer.
I have included the the code it is working fine.
Can't find what you're looking for? Ask the community or share your knowledge.