@JelteDeJong Thank you,
I understand 2nd arguments need to be..
Func(Of Object, Boolean)
and 3rd argument needs to be...
Func(Of Object)
but creating a BreakOutOperation requires in 5 objects (DrawingView, Profile, GeometryIntent, depthValue As Double, SectionAllParts As Boolean )
How do I pass that information into those 2 arguments?
If more details would help then below is what I'm doing now. It sort of works but my end goal is to create 1 simplified function that uses AddManagedEntity(String, Func(Object, Boolean), Func(Object)) https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=55931a54-5145-dad9-5f6e-3e15ef6bdd4e
Public Function CreateBreakOut(imdv As IManagedDrawingView,
ThisDrawing As IManagedDrawing,
name As String,
partName As String,
intentName As String,
radius As Double,
Optional depthValue As Double = 0,
Optional SectionAllParts As Boolean = True) As BreakOutOperation
Dim sketchName = name & "_Sketch"
'Delete and recreate each time is much simpler than trying to update each time
ThisDrawing.DeleteManagedEntity(name)
ThisDrawing.DeleteManagedEntity(sketchName)
Dim dv As DrawingView = imdv.NativeEntity
'IMAGNIT FRAMEWORK METHOD
Dim giSheet As GeometryIntent = imdv.GetIntent(partName, intentName)
Dim dvcS As DrawingViewCurves = DrawingViewCurves.GetEdgeGroup(dv.DrawingCurves, dv)
Dim intents As GeometryIntentCollection = dvcS.Intents
giSheet = intents.OrderByClosestTo(giSheet.PointOnSheet).FirstOrDefault 'redefine to the closest drawing curve intent
'CREATE
Dim sketch As DrawingSketch = dv.Sketches.Add()
sketch.Name = sketchName
'Sketch
Dim skCenterPoint As Point2d = sketch.SheetToSketchSpace(giSheet.PointOnSheet)
Dim circumfrencePt2d As Point2d = skCenterPoint.Copy
circumfrencePt2d.X += radius '? UNITS
sketch.Edit() '!IMPORTANT
Dim lines = sketch.SketchLines.AddAsPolygon(7, skCenterPoint, circumfrencePt2d, True)
sketch.ExitEdit() '!IMPORTANT
'Profile and Operation
Dim prof As Profile = sketch.Profiles.AddForSolid()
Dim this As BreakOutOperation = dv.BreakOutOperations.Add(prof, giSheet, depthValue, SectionAllParts)
'Manage so this gets auto deleted if it is not created
ThisDrawing.AddManagedEntity(name, this)
ThisDrawing.AddManagedEntity(sketchName, sketch)
Return this
End Function
Josh Hunt