Bend Edge Length Issue (incorrect value)

Bend Edge Length Issue (incorrect value)

Koeppel
Advocate Advocate
539 Views
3 Replies
Message 1 of 4

Bend Edge Length Issue (incorrect value)

Koeppel
Advocate
Advocate

I have some code that finds the length of a bend and it works great until there is a cut operation that passes through the edge of the part and through the bend.  When this cut exists the systems recognizes the single bend 2 times which is fineand it should, just that it should also then be able to determine the length of each segment.  It appears to be providing the length of the first segment twice.  Has anyone found a way to get either the segmented lengths or the length of the bend without the cut?  I need a total length and the code below gives wrong data for the one edge length.   the attached file shows what I mean.

 

idea's or suggestions?

 

Sub Bends()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim smComp As SheetMetalComponentDefinition
Set smComp = oDoc.ComponentDefinition
Dim oFlat As FlatPattern
Set oFlat = smComp.FlatPattern

Dim oBend As FlatBendResult
For Each oBend In oFlat.FlatBendResults
    If oBend.IsOnBottomFace = True Then
        Dim oEdge As Edge
        Set oEdge = oBend.Edge
   
        Dim dMin As Double
        Dim dMax As Double
        Dim dSingleLength As Double
        Call oEdge.Evaluator.GetParamExtents(dMin, dMax)
        Call oEdge.Evaluator.GetLengthAtParam(dMin, dMax, dSingleLength)
   
        MsgBox dSingleLength
    End If
Next
End Sub

 

Scott

0 Likes
540 Views
3 Replies
Replies (3)
Message 2 of 4

alewer
Advocate
Advocate

I can't open your part (I'm on 2010 x64 SP3), but I can sometimes replicate this with the attached part.  I don't know the exact cause, but if I supress/unsupress Rectangular Pattern 1, change sketch geometry, etc, I can get the behavior you describe.  This smells like a bug to me.

 

As a workaround, you might use properties of SheetMetalComponentDefinition.Bends, but this is not as straightforward as FlatPattern.BendResults.

0 Likes
Message 3 of 4

alewer
Advocate
Advocate

Also, my suggested workaround will not include any cosmetic bend lines created in the flat pattern.

0 Likes
Message 4 of 4

Koeppel
Advocate
Advocate

That does work, thanks.  But now I miss out on the flat pattern info such as the bend direction and.  Hopefully this gets fixed.  We are trying to program parts ahead of time and need to know the direction the angle and the bend length all at once.  It is all there just not working correctly.

 

Thanks for your workaround.

0 Likes