Community
Hi all,
How can I change the termination of an existing hole feature ?.
If app.ActiveDocument Is PartDocument Then Dim doc as PartDocument doc = app.ActiveDocument Dim hole as HoleFeature hole = doc.ComponentDefinition.Features.HoleFeatures(1) ... End If
Thanks,
Pascal Langlais
Hi Pascal,
The sample VBA code shown below changes the extent of hole from ToExtent to Through hole and vice versa.
Hope this helps!
-Ishwar N
Sub changeHoleTermination() Dim app As Inventor.Application Set app = ThisApplication If TypeOf app.ActiveDocument Is PartDocument Then Dim doc As PartDocument Set doc = app.ActiveDocument Dim def As PartComponentDefinition Set def = doc.ComponentDefinition Dim hole As HoleFeature Set hole = def.Features.HoleFeatures.Item(1) If hole.ExtentType = kToExtent Then ' Make it a through hole hole.SetThroughAllExtent (kPositiveExtentDirection) ElseIf hole.ExtentType = kThroughAllExtent Then
' In this sample the 4th workplane is at center of extruded part Call hole.SetToFaceExtent(def.WorkPlanes.Item(4), True) End If End If End Sub
Thank you Ishwar,
I will take a look this week-end and I'll give you feedback next week
Pascal