How to get Bend added automatically

How to get Bend added automatically

Anonymous
Not applicable
506 Views
3 Replies
Message 1 of 4

How to get Bend added automatically

Anonymous
Not applicable

I am working in Sheet metal enviroment, where I am creating a sweep, giving a profile and 'L'Shaped path.

Using same (following) code to prepare the path. In one case its adding a fillet at the corner in the path, but in the other, its not adding so. Why? What could be the reason. Actually, I want Bend to get added all the time, consistently. Anything to do with overall part dimensions relative to Bend-Radius?

 

SweepWithFilletedPath.png

 

SweepWithLinearPath.png

 

       Private Function CreatePathForFlange(ByVal oPl As Inventor.Polyline3d, ByVal normal As Vector, ByVal awayDir As Vector, ByVal offsetdistance As Double, ByVal heightdistance As Double) As Inventor.Path

            Dim point1 As Point = oPl.PointAtIndex(1)
            Dim point2 As Point = oPl.PointAtIndex(2)
            Dim point4 As Point = oPl.PointAtIndex(3)


            '                                                    pt3
            '                                                    /|
            '                                                   / |
            '                                                  /  |
            '                                                 /   |pt2
            '                                                /   /
            '                                               pt4 /
            '                                                | /        
            '                                   <-- uv3      |/
            '                            pt5 -------------- pt1
            '                             |
            '                             |
            '                   uv4 |     |
            '                       v     |
            '                             pt8
            '
            Dim uv3 As UnitVector = normal.AsUnitVector
            Dim planarOffsetVector As Vector = uv3.AsVector
            planarOffsetVector.ScaleBy(offsetdistance * 3)

            Dim point5 As Point = point1.Copy()
            point5.TranslateBy(planarOffsetVector) ' TRANSLATE by Offset distance

            Dim uv4 As UnitVector = awayDir.AsUnitVector 
            Dim vertticalHeightVector As Vector = uv4.AsVector
            vertticalHeightVector.ScaleBy(heightdistance)

            Dim point8 As Point = point5.Copy()
            point8.TranslateBy(vertticalHeightVector)

            Dim wpt1 As WorkPoint = m_compDef.WorkPoints.AddFixed(point1, True)
            Dim wpt5 As WorkPoint = m_compDef.WorkPoints.AddFixed(point5, True)
            Dim wpt8 As WorkPoint = m_compDef.WorkPoints.AddFixed(point8, True)

            Dim oSketch3d As Sketch3D = m_compDef.Sketches3D.Add
            Dim skln1 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(wpt1, wpt5)
            Dim skln2 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(skln1.EndSketchPoint, wpt8)

            Dim oPath As Inventor.Path = m_compDef.Features.CreatePath(skln1)
            CreatePathForFlange = oPath
        End Function
0 Likes
Accepted solutions (1)
507 Views
3 Replies
Replies (3)
Message 2 of 4

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

What happens when you add the sweep through the UI? Is the bend always automatically added then?

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 4

Anonymous
Not applicable

To address this inconsistent behaviour I am adding a Bend myself, as follows:

 

            Dim skln1 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(wpt1, wpt5, False)
            Dim skln2 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(skln1.EndSketchPoint, wpt8, False)
            Dim skarc As SketchArc3D = oSketch3d.SketchArcs3D.AddAsBend(skln1, skln2, m_bendradius) 

Seems to work ok, when there is enough space for bend to get created, else errors out.

 

For now, this looks ok, right?

0 Likes
Message 4 of 4

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Well, if it works consistently then I guess it's OK.



Adam Nagy
Autodesk Platform Services