Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

suppress the hole features using api.

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
288 Views, 2 Replies

suppress the hole features using api.

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

2 REPLIES 2
Message 2 of 3
frederic.vandenplas
in reply to: Anonymous

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
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 3
Anonymous
in reply to: frederic.vandenplas

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.

Post to forums  

Autodesk Design & Make Report