<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sweep with Guide Rail using API ?? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3524498#M135702</link>
    <description>&lt;P&gt;This should get you going, it will do your first sweep feature :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub SweepFeature()

'reference the part doc
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

'reference to the sketches
Dim oSketches As PlanarSketches
Set oSketches = oPartDoc.ComponentDefinition.Sketches

'get the TOOL 1 sketch
Dim oSketch As PlanarSketch
Set oSketch = oSketches.Item("TOOL 1")

' Create a profile from oSketch (TOOL 1)
Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

'get the PATH sketch
Dim oSketch2 As PlanarSketch
Set oSketch2 = oSketches.Item("PATH")

'get the first line in the sketch
Dim oSketchLine1 As SketchLine
Set oSketchLine1 = oSketch2.SketchLines.Item(1)

'set oSketchLine1 as the path
Dim oPath As Path
Set oPath = oPartDoc.ComponentDefinition.Features.CreatePath(oSketchLine1)

'get the RAIL 1 sketch (a 3D sketch in this case, not a planar sketch)
Dim oSketches3D As Sketches3D
Set oSketches3D = oPartDoc.ComponentDefinition.Sketches3D
Dim oSketch3D As Sketch3D
Set oSketch3D = oSketches3D.Item("RAIL 1")

'get the first spline in the sketch
Dim oSketchSpline As SketchSpline3D
Set oSketchSpline = oSketch3D.SketchSplines3D.Item(1)

'set the spline as the guide path
Dim oGuide As Path
Set oGuide = oPartDoc.ComponentDefinition.Features.CreatePath(oSketchSpline)

'do the sweep feature with Path and Guide Rail
Dim oSweep As SweepFeature
Set oSweep = oPartDoc.ComponentDefinition.Features.SweepFeatures.AddUsingPathAndGuideRail(oProfile, oPath, oGuide, PartFeatureOperationEnum.kCutOperation, SweepProfileScalingEnum.kNoProfileScaling)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you search in the API help ( ? &amp;gt; Additional Resources &amp;gt; Programming Help ) for 'sweep' you will find some help in there. Theres also some sample code in the help to create a sweep feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jul 2012 08:37:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-07-03T08:37:59Z</dc:date>
    <item>
      <title>Sweep with Guide Rail using API ??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3521910#M135700</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are developing an equation driven 3d spline using VBA.&lt;/P&gt;&lt;P&gt;It generates a 3D spline, guide rail, and tool profile, but we're having trouble figuring out how to do&amp;nbsp;the actual "sweep with guide rail" using the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is an .ipt of the shapes our program is generating automatically. &amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is we are having to manually create the sweep after the geometry is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we automate the sweep with guide rail process? &amp;nbsp;Can someone point me in the right direction on how to do something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2012 17:36:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3521910#M135700</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-29T17:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sweep with Guide Rail using API ??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3521914#M135701</link>
      <description>&lt;P&gt;BTW still using Inventor 2011&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2012 17:38:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3521914#M135701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-29T17:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sweep with Guide Rail using API ??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3524498#M135702</link>
      <description>&lt;P&gt;This should get you going, it will do your first sweep feature :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub SweepFeature()

'reference the part doc
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

'reference to the sketches
Dim oSketches As PlanarSketches
Set oSketches = oPartDoc.ComponentDefinition.Sketches

'get the TOOL 1 sketch
Dim oSketch As PlanarSketch
Set oSketch = oSketches.Item("TOOL 1")

' Create a profile from oSketch (TOOL 1)
Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

'get the PATH sketch
Dim oSketch2 As PlanarSketch
Set oSketch2 = oSketches.Item("PATH")

'get the first line in the sketch
Dim oSketchLine1 As SketchLine
Set oSketchLine1 = oSketch2.SketchLines.Item(1)

'set oSketchLine1 as the path
Dim oPath As Path
Set oPath = oPartDoc.ComponentDefinition.Features.CreatePath(oSketchLine1)

'get the RAIL 1 sketch (a 3D sketch in this case, not a planar sketch)
Dim oSketches3D As Sketches3D
Set oSketches3D = oPartDoc.ComponentDefinition.Sketches3D
Dim oSketch3D As Sketch3D
Set oSketch3D = oSketches3D.Item("RAIL 1")

'get the first spline in the sketch
Dim oSketchSpline As SketchSpline3D
Set oSketchSpline = oSketch3D.SketchSplines3D.Item(1)

'set the spline as the guide path
Dim oGuide As Path
Set oGuide = oPartDoc.ComponentDefinition.Features.CreatePath(oSketchSpline)

'do the sweep feature with Path and Guide Rail
Dim oSweep As SweepFeature
Set oSweep = oPartDoc.ComponentDefinition.Features.SweepFeatures.AddUsingPathAndGuideRail(oProfile, oPath, oGuide, PartFeatureOperationEnum.kCutOperation, SweepProfileScalingEnum.kNoProfileScaling)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you search in the API help ( ? &amp;gt; Additional Resources &amp;gt; Programming Help ) for 'sweep' you will find some help in there. Theres also some sample code in the help to create a sweep feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2012 08:37:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3524498#M135702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-03T08:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sweep with Guide Rail using API ??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3544884#M135703</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a bunch, that worked out great! &amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you know how to go about doing a circular pattern of the swept features? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2012 15:03:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/3544884#M135703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-19T15:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sweep with Guide Rail using API ??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/5983419#M135704</link>
      <description>&lt;P&gt;Invertor 2016 AddUsingPathAndGuideRail in vba no longer working correctly.&lt;/P&gt;&lt;P&gt;It work great in 2014 but not in 2016.&lt;/P&gt;&lt;P&gt;Please help me, we just upgraded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 20:31:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sweep-with-guide-rail-using-api/m-p/5983419#M135704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-11T20:31:34Z</dc:date>
    </item>
  </channel>
</rss>

