Hi,
This vba code does what you want. Run the code select a face where a new sketch should be placed (code will create sketch for you)
after that, it will draw a circle on the Y-max point of a BendEdge, so if a line is horizontal, it will be placed on the endpoint of the projected edge, from thoses circles, the cutfeature will be created in the flatpattern definition
Sub AddCircles()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As SheetMetalComponentDefinition
Set oDef = oDoc.ComponentDefinition
Dim oFlatPattern As FlatPattern
Set oFlatPattern = oDef.FlatPattern
oFlatPattern.Edit
Dim oFace As Face
Set oFace = ThisApplication.CommandManager.Pick(kPartFacePlanarFilter, "Select a planar face")
Dim oSketch As Sketch
Set oSketch = oFlatPattern.Sketches.Add(oFace)
oSketch.Edit
Dim oTopFaceBendUpEdges As Edges
Set oTopFaceBendUpEdges = oFlatPattern.GetEdgesOfType(kBendUpFlatPatternEdge, True)
Dim oTg As TransientGeometry
Set oTg = ThisApplication.TransientGeometry
Dim oEdge As Edge
Dim oProjectedEdge As SketchLine
For Each oEdge In oTopFaceBendUpEdges
Set oProjectedEdge = oSketch.AddByProjectingEntity(oEdge)
If oEdge.Geometry.StartPoint.Y > oEdge.Geometry.EndPoint.Y Then
Call oSketch.SketchCircles.AddByCenterRadius(oTg.CreatePoint2d(oProjectedEdge.Geometry.StartPoint.X, oProjectedEdge.Geometry.StartPoint.Y), 0.05)
Else
Call oSketch.SketchCircles.AddByCenterRadius(oTg.CreatePoint2d(oProjectedEdge.Geometry.EndPoint.X, oProjectedEdge.Geometry.EndPoint.Y), 0.05)
End If
Next oEdge
oSketch.ExitEdit
Set oProfile = oSketch.Profiles.AddForSolid
Dim oCutDefinition As CutDefinition
Set oCutDefinition = oFlatPattern.Features.CutFeatures.CreateCutDefinition(oProfile)
Call oCutDefinition.SetThroughAllExtent(kNegativeExtentDirection)
Dim oCutFeature As CutFeature
Set oCutFeature = oFlatPattern.Features.CutFeatures.Add(oCutDefinition)
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"