<?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: Sketches go to axis in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993456#M3550</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the problem is with the sketch you pass as parameter to the function.&lt;/P&gt;&lt;P&gt;Which sketch it is?&amp;nbsp; It is xZPlane based sketch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you replace it by a&amp;nbsp;xYPlane based sketch your function will work OK.&lt;/P&gt;&lt;P&gt;But if you still need to use the current sketch, you might need to convert the points to the sketch geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem comes from the fact that the points are placed with world geometry values and the sketch treat them as being local geometry (the internal geometry within the sketch).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Jorge Jaramillo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2023 00:11:36 GMT</pubDate>
    <dc:creator>Jorge_Jaramillo</dc:creator>
    <dc:date>2023-08-17T00:11:36Z</dc:date>
    <item>
      <title>Sketches go to axis</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993334#M3549</link>
      <description>&lt;P&gt;I am a newbie to Fusion 360 but not to programming.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears that my sketches are not going in the right direction and y and z coordinates are transposed.&lt;/P&gt;&lt;P&gt;Take this simple example script:&lt;/P&gt;&lt;PRE&gt;def demo_Lines_addTwoPointRectangle(sketch: adsk.fusion.Sketch):
    &lt;SPAN&gt;# Define two points&lt;/SPAN&gt;
    pointOne = adsk.core.Point3D.create(0, 0, 0)
    pointTwo = adsk.core.Point3D.create(5, 15, 0)

    &lt;SPAN&gt;# Create the rectangle using the points&lt;/SPAN&gt;
    rectangles = sketch.sketchCurves.sketchLines 
    rectangle = rectangles.addTwoPointRectangle(pointOne, pointTwo)&lt;BR /&gt;&lt;BR /&gt;The rectangle is drawn towards the negative z direction even though both points have zero for z dimesion?&lt;BR /&gt;The point marked in the diagram is actually (5,0,-15)cm as noted at the bottom right of the UI.&lt;BR /&gt;Can someone please point me where my 'fundamental' mistake is coming from?&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 14:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993334#M3549</guid>
      <dc:creator>kabanda</dc:creator>
      <dc:date>2023-05-27T14:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sketches go to axis</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993456#M3550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the problem is with the sketch you pass as parameter to the function.&lt;/P&gt;&lt;P&gt;Which sketch it is?&amp;nbsp; It is xZPlane based sketch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you replace it by a&amp;nbsp;xYPlane based sketch your function will work OK.&lt;/P&gt;&lt;P&gt;But if you still need to use the current sketch, you might need to convert the points to the sketch geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem comes from the fact that the points are placed with world geometry values and the sketch treat them as being local geometry (the internal geometry within the sketch).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Jorge Jaramillo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 00:11:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993456#M3550</guid>
      <dc:creator>Jorge_Jaramillo</dc:creator>
      <dc:date>2023-08-17T00:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sketches go to axis</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993513#M3551</link>
      <description>&lt;P&gt;Yes, if I replace it with xYPlane the results appear correctly for that plane but I am not sure at what point in my script I made it impossible to honour the xZPlane since I want the sketch on that plane. There is nothing else in the script (which is only drawing this sketch) which has changed the sketche's orientation with respect to the world co-ordinate system. The sketch is in rootComp?&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 17:50:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993513#M3551</guid>
      <dc:creator>kabanda</dc:creator>
      <dc:date>2023-05-27T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sketches go to axis</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993945#M3552</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    pointOne = sketch.modelToSketchSpace(adsk.core.Point3D.create(0, 0, 0))
    pointTwo = sketch.modelToSketchSpace(adsk.core.Point3D.create(5, 15, 0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each sketch has its own coordinate system, and all geometry within the sketch is based on this coordinate system. When you create a sketch, you don't have any control over the orientation of the sketch, and Fusion does whatever it does. This is the same as in the UI. However, when interactively drawing geometry, it doesn't matter what the coordinates are since you are typically constraining relative to other geometry.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 00:55:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/11993945#M3552</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2023-05-28T00:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sketches go to axis</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/12007328#M3553</link>
      <description>Thanks Brian,&lt;BR /&gt;That's helped.</description>
      <pubDate>Fri, 02 Jun 2023 14:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketches-go-to-axis/m-p/12007328#M3553</guid>
      <dc:creator>kabanda</dc:creator>
      <dc:date>2023-06-02T14:25:18Z</dc:date>
    </item>
  </channel>
</rss>

