Arc As Bend

Arc As Bend

Anonymous
Not applicable
455 Views
1 Reply
Message 1 of 2

Arc As Bend

Anonymous
Not applicable

Wish to create a sweep:

Profile: blue rectanlgle in the yellow workplane.
Guide Path: line from pt1 to pt5, arc from pt5 to pt7, line from pt7 to pt8.

I could create lines fine. Then for Arc3D, there were two options:
3Point: pt5-pt6-pt7. DID NOT WORK as the arc was not like a fillet.
ArcAsBlend: gave lines pt1-pt6 and pt6-pt8 as input. It created the arc but left some portion. Using this path I am not able to create the sweep.

 

Code below:

    Dim v3 As Vector = v1.CrossProduct(v2)
    Dim uv3 As UnitVector = v3.AsUnitVector
    uv3.AsVector.ScaleBy(offsetdistance)

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

    Dim point6 As Point = point5.Copy()
    point6.TranslateBy(uv3.AsVector) ' TRANSLATE one more time, just for some offset

    Dim point7 As Point = point6.Copy()
    uv1.AsVector.ScaleBy(m_bendradius) ' TRANSLATE same in the Perpendicular direction
    point7.TranslateBy(uv1.AsVector)

    Dim point8 As Point = point7.Copy()
    uv1.AsVector.ScaleBy(heightdistance) ' Go by Height distance
    point8.TranslateBy(uv1.AsVector)

 

    Dim wpt1 As WorkPoint = m_compDef.WorkPoints.AddFixed(point1)
    Dim wpt5 As WorkPoint = m_compDef.WorkPoints.AddFixed(point5)
    Dim wpt6 As WorkPoint = m_compDef.WorkPoints.AddFixed(point6)
    Dim wpt7 As WorkPoint = m_compDef.WorkPoints.AddFixed(point7)
    Dim wpt8 As WorkPoint = m_compDef.WorkPoints.AddFixed(point8)

 

    Dim oSketch3d As Sketch3D = m_compDef.Sketches3D.Add
    Dim skln1 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(wpt1, wpt6)
    Dim skln2 As SketchLine3D = oSketch3d.SketchLines3D.AddByTwoPoints(wpt6, wpt8)
    Dim skbend As SketchArc3D = oSketch3d.SketchArcs3D.AddAsBend(skln1, skln2, m_bendradius)

 

    Dim oPath As Inventor.Path = m_compDef.Features.CreatePath(skln1)

 

Picture attached

0 Likes
Accepted solutions (1)
456 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

AddByBend method should give you the desired result if the he both lines end points are merged.

I’ve slightly changed your code to get the correct profile:

Dim oLine1 As SketchLine3D
Set oLine1 = oSketch3d.SketchLines3D.AddByTwoPoints(oWorkPoint1, oWorkPoint2, False)
Dim oLine2 As SketchLine3D
Set oLine2 = oSketch3d.SketchLines3D.AddByTwoPoints(oLine1.EndSketchPoint, oWorkPoint3, False)
Dim oArc As SketchArc3D
Set oArc = oArcs3D.AddAsBend(oLine1, oLine2, "2 mm")

Bend.PNG

 

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network