Since I don't have your specific model and drawing to play with, I'm just 'shooting from the hip' here, in the general direction of your scenario. This is just a quick, untested, rough draft of some iLogic code that should get you pointed in the right direction. There are multiple ways to do some of these things, and many things that can be identified/retrieved differently within it, so you may need to change some things to get it to work for your specific situation. Anyways, here's what I've thrown together for you, so far:
Sub Main
'this rule is designed to be ran within a DrawingDocument
'get the target drawing document
Dim oDDoc As DrawingDocument = ThisDrawing.Document
'check that there 'is' a model document, first
If ThisDrawing.ModelDocument Is Nothing Then
MsgBox("There is no model document being represented in this drawing yet. Exiting.",,"")
Exit Sub
End If
'now check which type of document the model is (assembly or part)
If ThisDrawing.ModelDocument.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then
MsgBox("This rule only works when the model document is a Part. Exiting.", , "")
Exit Sub
End If
'if it passed that check, it is a Part, so capture it in that Type of variable
Dim oPDoc As PartDocument = ThisDrawing.ModelDocument
'retrieve the named entities collection from the part document (only works with Part documents)
Dim oNEs As NamedEntities = iLogicVb.Automation.GetNamedEntities(oPDoc)
'the objects I named were Edge, so I'm expecting an Edge, so I defined the following variable's Type to be an Edge
Dim oEdge1 As Edge = oNEs.TryGetEntity("Bottom Edge") 'the name you assigned to the Edge/Face
If oEdge1 Is Nothing Then
MsgBox("The first named entity was not found in the model part. Exiting.", , "")
Exit Sub
End If
Dim oEdge2 As Edge = oNEs.TryGetEntity("First Step Top Edge") 'the name assigned to the other Edge/Face
If oEdge2 Is Nothing Then
MsgBox("The second named entity was not found in the model part. Exiting.", , "")
Exit Sub
End If
'specify which view on which sheet you are going to be working with
Dim oView As DrawingView = oDDoc.ActiveSheet.DrawingViews.Item(1)
'try to identify which Edge resulted in which DrawingCurve shown in the view
Dim oCurve1, oCurve2 As DrawingCurve
For Each oDC As DrawingCurve In oView.DrawingCurves
If oDC.ModelGeometry Is oEdge1 Then
oCurve1 = oDC
ElseIf oDC.ModelGeometry Is oEdge2 Then
oCurve2 = oDC
End If
Next
If oCurve1 Is Nothing Then
MsgBox("Did not find a DrawingCurve in that view for the first named model Edge. Exiting.", , "")
Exit Sub
End If
If oCurve2 Is Nothing Then
MsgBox("Did not find a DrawingCurve in that view for the second named model Edge. Exiting.", , "")
Exit Sub
End If
'try to get Point2d data from the two DrawingCurves that we can use
Dim oPt1 As Point2d = oCurve1.CenterPoint
Dim oPt2 As Point2d = oCurve2.CenterPoint
'create your break operation
Dim oBrOp As BreakOperation
oBrOp = oView.BreakOperations.Add(BreakOrientationEnum.kHorizontalBreakOrientation, oPt1, oPt2, BreakStyleEnum.kStructuralBreakStyle)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)