<?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: How is best to create a plane on a spline path? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5694412#M21075</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Michael,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please have a try to replace '&lt;STRONG&gt;plane1 = rootComp.ConstructionPlaneInput.setByDistanceOnPath.add(spline1,0)&lt;/STRONG&gt;'&amp;nbsp;with the following code&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; planeInput = rootComp.constructionPlanes.createInput() # you could also specify the occurrence in the parameter list&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; planeInput.setByDistanceOnPath(spline1, adsk.core.ValueInput.createByReal(0))&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; plane1 = rootComp.&lt;/SPAN&gt;&lt;SPAN&gt;constructionPlanes.add(planeInput)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Besides, loft feature hasn't been included in the API yet. Sorry for the&amp;nbsp;inconvenience.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Xiaohui&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2015 02:32:58 GMT</pubDate>
    <dc:creator>xiaohui.wang</dc:creator>
    <dc:date>2015-06-26T02:32:58Z</dc:date>
    <item>
      <title>How is best to create a plane on a spline path?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5694389#M21074</link>
      <description>&lt;P&gt;Hi! &amp;nbsp;I'm continuing to build out my fibonacci script. It takes input values now! &lt;SPAN style="line-height: 20px;"&gt;&amp;nbsp;I'm trying to make the program create a loft along a centerline but I'm getting stuck at creating the planes along the path I'll need to make loft profiles. &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: 20px;"&gt;Can you take a look at my code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what I'm working towards:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/175549i531D436380FC8DC0/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" alt="fib6.jpg" title="fib6.jpg" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import adsk.core, adsk.fusion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;app= adsk.core.Application.get()&lt;/P&gt;
&lt;P&gt;design = app.activeProduct&lt;/P&gt;
&lt;P&gt;ui = app.userInterface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#**Default User Inputs**&lt;/P&gt;
&lt;P&gt;steps = "5 cm" #How many steps of Fibonacci would you like to plot?&lt;/P&gt;
&lt;P&gt;#(Note, while the steps variable should be unitless, right now our API can't handle unitless number.&lt;/P&gt;
&lt;P&gt;#cm are the absolute units we use on the API side.)&lt;/P&gt;
&lt;P&gt;length = "3 cm" #How long is the first segment? (cm)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input = steps&lt;/P&gt;
&lt;P&gt;createInput = ui.inputBox('Enter Steps', 'Steps', input)&lt;/P&gt;
&lt;P&gt;if createInput[0]:&lt;/P&gt;
&lt;P&gt;(input, isCancelled) = createInput&lt;/P&gt;
&lt;P&gt;unitsMgr = design.unitsManager&lt;/P&gt;
&lt;P&gt;realSteps = unitsMgr.evaluateExpression(input, unitsMgr.defaultLengthUnits)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input = length&lt;/P&gt;
&lt;P&gt;createInput = ui.inputBox('Enter Length', 'Length', input)&lt;/P&gt;
&lt;P&gt;if createInput[0]:&lt;/P&gt;
&lt;P&gt;(input, isCancelled) = createInput&lt;/P&gt;
&lt;P&gt;realLength = unitsMgr.evaluateExpression(input, unitsMgr.defaultLengthUnits)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#Get root component&lt;/P&gt;
&lt;P&gt;rootComp = design.rootComponent&lt;/P&gt;
&lt;P&gt;#Create a new sketch on XY plane&lt;/P&gt;
&lt;P&gt;sketch = rootComp.sketches.add(rootComp.xYConstructionPlane)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Create an object collection for the points.&lt;/P&gt;
&lt;P&gt;points = adsk.core.ObjectCollection.create()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# R = total steps to be run thru the For loop&lt;/P&gt;
&lt;P&gt;R = int(realSteps - 2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#starting x and y coordiantes&lt;/P&gt;
&lt;P&gt;x = 0&lt;/P&gt;
&lt;P&gt;y = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#Create 1st coordinate&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#starting values for sequence&lt;/P&gt;
&lt;P&gt;fib = 1&lt;/P&gt;
&lt;P&gt;fib1 = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#Create 2nd coordinate&lt;/P&gt;
&lt;P&gt;x = 1 * realLength&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;ui.messageBox('x: ' + str(x))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#bins for shifting x and y coordinates&lt;/P&gt;
&lt;P&gt;Bin1 = range(0,R,4)&lt;/P&gt;
&lt;P&gt;Bin2 = range(1,R,4)&lt;/P&gt;
&lt;P&gt;Bin3 = range(2,R,4)&lt;/P&gt;
&lt;P&gt;Bin4 = range(3,R,4)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for i in range(R):&lt;/P&gt;
&lt;P&gt;fib2 = fib + fib1&lt;/P&gt;
&lt;P&gt;fib = fib1&lt;/P&gt;
&lt;P&gt;fib1 = fib2&lt;/P&gt;
&lt;P&gt;fibLength = fib*realLength #adds the scalar component to coordinates&lt;/P&gt;
&lt;P&gt;ui.messageBox('fiblength: ' + str(fibLength))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if i in Bin1:&lt;/P&gt;
&lt;P&gt;x = x&lt;/P&gt;
&lt;P&gt;y = y + fibLength&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;if i in Bin2:&lt;/P&gt;
&lt;P&gt;x = x - fibLength&lt;/P&gt;
&lt;P&gt;y = y&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;if i in Bin3:&lt;/P&gt;
&lt;P&gt;x = x&lt;/P&gt;
&lt;P&gt;y = y - fibLength&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;if i in Bin4:&lt;/P&gt;
&lt;P&gt;x = x + fibLength&lt;/P&gt;
&lt;P&gt;y = y&lt;/P&gt;
&lt;P&gt;points.add(adsk.core.Point3D.create(x,y,0))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Create the spline.&lt;/P&gt;
&lt;P&gt;sketch.sketchCurves.sketchFittedSplines.add(points)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;# Create the Planes for the loft&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;spline1 = sketch.sketchCurves.sketchFittedSplines.item(0)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;plane1 = rootComp.ConstructionPlaneInput.setByDistanceOnPath.add(spline1,0)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 02:01:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5694389#M21074</guid>
      <dc:creator>MichaelAubry</dc:creator>
      <dc:date>2015-06-26T02:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How is best to create a plane on a spline path?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5694412#M21075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Michael,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please have a try to replace '&lt;STRONG&gt;plane1 = rootComp.ConstructionPlaneInput.setByDistanceOnPath.add(spline1,0)&lt;/STRONG&gt;'&amp;nbsp;with the following code&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; planeInput = rootComp.constructionPlanes.createInput() # you could also specify the occurrence in the parameter list&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; planeInput.setByDistanceOnPath(spline1, adsk.core.ValueInput.createByReal(0))&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; plane1 = rootComp.&lt;/SPAN&gt;&lt;SPAN&gt;constructionPlanes.add(planeInput)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Besides, loft feature hasn't been included in the API yet. Sorry for the&amp;nbsp;inconvenience.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Xiaohui&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 02:32:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5694412#M21075</guid>
      <dc:creator>xiaohui.wang</dc:creator>
      <dc:date>2015-06-26T02:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: How is best to create a plane on a spline path?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5696018#M21076</link>
      <description>&lt;P&gt;Success! &amp;nbsp;Thanks so much. Your soluiton worked like a charm. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/175762i7E160337A731DF7E/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="plane on face.jpg" title="plane on face.jpg" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the warning that we don't have loft from the API yet. &amp;nbsp;Thats's okay. I'll just set the script up to get to that point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 01:37:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5696018#M21076</guid>
      <dc:creator>MichaelAubry</dc:creator>
      <dc:date>2015-06-27T01:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: How is best to create a plane on a spline path?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5700552#M21077</link>
      <description>&lt;P&gt;For those following the thread, here's what the final solution ended up as.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gallery Post: &lt;A href="https://fusion360.autodesk.com/projects/horn-of-fibonacci" target="_blank"&gt;https://fusion360.autodesk.com/projects/horn-of-fibonacci&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Code:&amp;nbsp;&lt;A href="https://github.com/MichaelAubry/Fusion360.git" target="_blank"&gt;https://github.com/MichaelAubry/Fusion360.git&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Video:&amp;nbsp;&lt;SPAN class="js-display-url"&gt;&lt;A class="twitter-timeline-link" dir="ltr" title="https://youtu.be/5wj6zj4-iB0" href="https://t.co/8GwMDvjkU5" target="_blank" rel="nofollow" data-expanded-url="https://youtu.be/5wj6zj4-iB0"&gt;youtu.be/5wj6zj4-iB0&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="js-display-url"&gt;Big thanks to Brian, Xiaohui,&lt;/SPAN&gt;&amp;nbsp;and Casey for helping with this!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 20:03:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-is-best-to-create-a-plane-on-a-spline-path/m-p/5700552#M21077</guid>
      <dc:creator>MichaelAubry</dc:creator>
      <dc:date>2015-06-30T20:03:28Z</dc:date>
    </item>
  </channel>
</rss>

