Hi, you can try this one. It'll show you the list of all bend lines in your part. To run this your part must have the flat patter created.
Sub Main()
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSMCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim oFlatPattern As FlatPattern = oSMCD.FlatPattern
If oFlatPattern.FlatBendResults.Count = 0 Then Exit Sub
Dim AllBends As String
Dim AngleI As String
Dim RadiusI As String
Dim iUp As Integer = 1
Dim iDown As Integer = 1
Dim oBendResult As FlatBendResult
For Each oBendResult In oFlatPattern.FlatBendResults
Try
Dim oText As String
If oBendResult.IsDirectionUp Then
oText = "UP"
iUp = iUp + 1
Else
oText = "DOWN"
iDown = iDown + 1
End If
RadiusI = oDoc.UnitsOfMeasure.GetStringFromValue(oBendResult.InnerRadius, UnitsTypeEnum.kDefaultDisplayLengthUnits)
Pos = InStr(1, RadiusI, ",", 1)
Zero = Mid(RadiusI, Pos + 1, 1)
If Zero = "0" Then
RadiusI = Left(RadiusI, Pos - 1)
Else
RadiusI = Left(RadiusI, Pos + 1)
End If
AngleI = oDoc.UnitsOfMeasure.GetStringFromValue(oBendResult.Angle, UnitsTypeEnum.kDefaultDisplayAngleUnits)
AngleI = Round(Val(Left(AngleI, Len(AngleI)-4)))
oText = oText & vbLf & "R" & RadiusI & vbLf & AngleI & "°" & vbNewLine & vbNewLine
AllBends = AllBends & oText
Catch
End Try
Next
MsgBox(AllBends)
End Sub
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods