AnsweredAssumed Answered

SW API : Get bend note associated to a selected bend line (or vice versa)

Question asked by Vincent Perry on Aug 20, 2019
Latest reply on Nov 5, 2019 by Neil Jeffers

Hi All, 

 

I've been trying to find a way to get the bend Note attached to a specific bend line using API (VBA) but I just can't figure it out. 

Does anyone have an idea ? 

 

The goal of the macro is to display two lines (on both sides of the bend line), that correspond to the minimum length needed to fold the part. Basically, any cut in between those 2 lines will be deformed, and if the edge of the part is between those lines, we can't fold the part: (the two blue lines define the deformation area)

So far, I got the macro working but I am considering that all folds are 90deg. However, the "Minimum needed length" depends on the angle (among others), and I would like to be able to pickup the bend angle for each bend from the bend line, to get a more accurate display...

 

In terms of code, I use "GetBendLines" to fill an array with all the bend lines and then I use a "For" loop to select each bend line individually. I then offset them to get the blue lines: 

(Min is the offset value and it is a property of the part at the moment but I want to replace it with a formula, function of the angle)

 

If Min = 0 Then
      Exit Sub
Else
      If FlatView.GetBendLineCount <> 0 Then
            BendLineArr = FlatView.GetBendLines
      Else
            Exit Sub
      End If
      For i = 0 To UBound(BendLineArr)
            Set swSkSeg = BendLineArr(i)

***--> Ideally, I would get the bend note info associated to the bend line i here <--- ***
            boolstatus = swSkSeg.Select4(True, swSelData)
            boolstatus = swModel.SketchOffsetEntities2(Min / 1000, True, False)
      Next
End If

 

Thank you in advance!

Outcomes