<?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 Runtime Error 5: Path is tangent to profile When Extruding rotated Component in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6057155#M20297</link>
    <description>&lt;P&gt;I'm trying to extrude from a sketch that belongs to a component that has a non-standard origin&lt;/P&gt;&lt;P&gt;The origin has the y and z axes switched and is translated &amp;lt;1,1,1&amp;gt;. This is shown in the figure below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this code to create the extrusion and get the error posted below:&lt;/P&gt;&lt;PRE&gt;boltComp = self.RWO
        boltSketches = boltComp.sketches
#        reportMessageBox("building bolt", ("random"))
        xyPlane = boltComp.xYConstructionPlane
        planes = boltComp.constructionPlanes
        planeInput = planes.createInput()
        #offset plane example
        offsetValue = adsk.core.ValueInput.createByReal(0);
        planeInput.setByOffset(xyPlane, offsetValue)
        plane = planes.add(planeInput)
        sketch = boltSketches.add(plane)    
        center = boltComp.originConstructionPoint.geometry
        vertices = []
        for i in range(0, 6):
            vertex = adsk.core.Point3D.create(center.x + (self.hDiameter/2) * math.cos(math.pi * i / 3), center.y + (self.hDiameter/2) * math.sin(math.pi * i / 3),0)
            vertices.append(vertex)
        for i in range(0, 6):
            sketch.sketchCurves.sketchLines.addByTwoPoints(vertices[(i+1) %6], vertices[i])
        extrudes = boltComp.features.extrudeFeatures
        prof = sketch.profiles[0]
        extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        distance = adsk.core.ValueInput.createByReal(self.hHeight)
        extInput.setDistanceExtent(True, distance)
        headExt = extrudes.add(extInput)&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/220565iB64C3FAFE6EB5AA5/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="cpature.PNG" title="cpature.PNG" border="0" /&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/220566iBF76C16967539421/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="error.PNG" title="error.PNG" border="0" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2016 21:50:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-25T21:50:16Z</dc:date>
    <item>
      <title>Runtime Error 5: Path is tangent to profile When Extruding rotated Component</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6057155#M20297</link>
      <description>&lt;P&gt;I'm trying to extrude from a sketch that belongs to a component that has a non-standard origin&lt;/P&gt;&lt;P&gt;The origin has the y and z axes switched and is translated &amp;lt;1,1,1&amp;gt;. This is shown in the figure below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this code to create the extrusion and get the error posted below:&lt;/P&gt;&lt;PRE&gt;boltComp = self.RWO
        boltSketches = boltComp.sketches
#        reportMessageBox("building bolt", ("random"))
        xyPlane = boltComp.xYConstructionPlane
        planes = boltComp.constructionPlanes
        planeInput = planes.createInput()
        #offset plane example
        offsetValue = adsk.core.ValueInput.createByReal(0);
        planeInput.setByOffset(xyPlane, offsetValue)
        plane = planes.add(planeInput)
        sketch = boltSketches.add(plane)    
        center = boltComp.originConstructionPoint.geometry
        vertices = []
        for i in range(0, 6):
            vertex = adsk.core.Point3D.create(center.x + (self.hDiameter/2) * math.cos(math.pi * i / 3), center.y + (self.hDiameter/2) * math.sin(math.pi * i / 3),0)
            vertices.append(vertex)
        for i in range(0, 6):
            sketch.sketchCurves.sketchLines.addByTwoPoints(vertices[(i+1) %6], vertices[i])
        extrudes = boltComp.features.extrudeFeatures
        prof = sketch.profiles[0]
        extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        distance = adsk.core.ValueInput.createByReal(self.hHeight)
        extInput.setDistanceExtent(True, distance)
        headExt = extrudes.add(extInput)&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/220565iB64C3FAFE6EB5AA5/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="cpature.PNG" title="cpature.PNG" border="0" /&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/220566iBF76C16967539421/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="error.PNG" title="error.PNG" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 21:50:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6057155#M20297</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-25T21:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error 5: Path is tangent to profile When Extruding rotated Component</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6057254#M20298</link>
      <description>&lt;P&gt;I'm able to reproduce the problem you've reported.&amp;nbsp; It's a bug in the API.&amp;nbsp; I've reported it so we can work on fixing it.&amp;nbsp; It's specific to the orientation of your&amp;nbsp;occurrence.&amp;nbsp; When I first tested it it was working ok but I had an arbitrary orienation for my occurrence and when I repositioned to the&amp;nbsp;orientation you described the problem occurred.&amp;nbsp; I actually found another problem too where the construction plane being created is not oriented correctly.&amp;nbsp; We'll get that fixed too.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 22:42:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6057254#M20298</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2016-02-25T22:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error 5: Path is tangent to profile When Extruding rotated Component</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6058238#M20299</link>
      <description>&lt;P&gt;A temporary solution that worked for me was to only rotate the component after fully creating the design. This problem was specific to the orientation but the extrusion was always angled relative to the document space rather than the component.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 14:25:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/runtime-error-5-path-is-tangent-to-profile-when-extruding/m-p/6058238#M20299</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-26T14:25:31Z</dc:date>
    </item>
  </channel>
</rss>

