Hi @LarsBJepsen
I found some code here:
https://adndevblog.typepad.com/manufacturing/2013/08/inventor-access-sheet-metal-part-bend-informati...
, and rewrote it a bit for ilogic.
Try this ilogic rule to get bend information from bend line 🙂
Sub Main
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
'Gets the selected curve segment
Dim oDwCurveSegment As DrawingCurveSegment
oDwCurveSegment = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select bend line")
Try
'Gets full drawing curve from the segment
Dim oDrawingCurve As DrawingCurve
oDrawingCurve = oDwCurveSegment.Parent
'Gets edge
Dim oEdge As Edge
oEdge = oDrawingCurve.ModelGeometry
'Retrieves component definition from the edge
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oEdge.Parent.ComponentDefinition
Dim oFlatPattern As FlatPattern
oFlatPattern = oSMDef.FlatPattern
'Gets flat bend result corresponding to the edge
Dim oBendResult As FlatBendResult
oBendResult = oFlatPattern.FlatBendResults.Item(oEdge)
Dim oReturnString As String = String.Empty
'Prints Flat Bend Results
oReturnString = oReturnString & "---------------- Flat Bend Infos ----------------" & vbCrLf
oReturnString = oReturnString & "Internal Name: " & oBendResult.InternalName & vbCrLf
If oBendResult.IsOnBottomFace Then
oReturnString = oReturnString & "Bend On Bottom Face" & vbCrLf
Else
oReturnString = oReturnString & "Bend On Top Face" & vbCrLf
End If
Dim oUOM As UnitsOfMeasure
oUOM = oDoc.UnitsOfMeasure
oReturnString = oReturnString & "Bend Angle = " & oUOM.GetStringFromValue(oBendResult.Angle, kDefaultDisplayAngleUnits) & vbCrLf
oReturnString = oReturnString & "Bend Radius = " & oUOM.GetStringFromValue(oBendResult.InnerRadius, kDefaultDisplayLengthUnits) & vbCrLf
If oBendResult.IsDirectionUp Then
oReturnString = oReturnString & "Bend Direction: " & "Bend Up" & vbCrLf
Else
oReturnString = oReturnString & "Bend Direction: " & "Bend Down" & vbCrLf
End If
Beep
MsgBox(oReturnString)
Catch
GoAgain = MessageBox.Show("This is not a bend line, select another line?", "Show bend info", MessageBoxButtons.YesNo)
If GoAgain = 6 Then
Main()
Else
Exit Sub
End If
End Try
End Sub