Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
FrodoZhou
in reply to: Anonymous

Hello,

 

You can add these several lines into your code to create a sketch point, before you exit the sketch env.

 

// Add a sketch point to a planar sketch

Dim oPointOnFace As Point
Set oPointOnFace = planarEntity.PointOnFace //just use the PointOnFace as an example, sounds you will get user input anyway

sk.SketchPoints.Add sk.ModelToSketchSpace(oPointOnFace)

 

After you exit the sketch env, you can add these lines to execute the Punch Tool command which will pop up the dialog. Hope this is helpful.

 

// Find the ButtonDefinition of Punch Tool command and execute it

Dim oDef As ButtonDefinition
For Each oDef In ThisApplication.CommandManager.ControlDefinitions
If oDef.InternalName = "SheetMetalPunchToolCmd" Then
oDef.Execute
End If
Next