After posting I realize there's not much anyone can do without the files, Duh. So here they are.
Allen
''' Add a sheet metal PunchToolFeature to selected SketchPoints.
''' Sketch(s) and Point(s) must already be present.
Sub Main()
' Get the active sheet metal document and component definition.
Dim oPartDoc As PartDocument
Try
oPartDoc = ThisApplication.ActiveDocument
Catch
MessageBox.Show("A part document must be active.", "Error1")
Exit Sub
End Try
If Not oPartDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
MessageBox.Show("A sheet metal document must be open.", "Error2")
Exit Sub
End If
' Create a feature definition object for a punch tool.
Dim oSMDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition
Dim oSMFeatures As SheetMetalFeatures = oSMDef.Features
Dim oFile As String = "C:\Users\Public\Documents\Autodesk\Inventor 2023\Catalog\Punches\obround.ide"
Dim oiFeatureDef As iFeatureDefinition = oSMFeatures.PunchToolFeatures.CreateiFeatureDefinition(oFile)
' Prompt user to select a sketch point.
Dim oCmdMgr As CommandManager = ThisApplication.CommandManager
Dim oSourcePoint As SketchPoint = oCmdMgr.Pick(SelectionFilterEnum.kSketchPointFilter, "Select SketchPoint for Obround")
Dim oPoints As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Call oPoints.Add(oSourcePoint)
' Create the iFeature.
Dim oPunchTool As PunchToolFeature = oSMFeatures.PunchToolFeatures.Add(oPoints, oiFeatureDef)
' Find and change an existing PunchToolFeature. Uses iLogic Functions.
rowNumber = iFeature.FindRow(oPunchTool.Name, "PunchLength", "=", 0.375, "PunchWidth", "=", 0.188)
iFeature.ChangeRow(oPunchTool.Name, rowNumber)
End Sub 'Main