- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.