<?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 [Bug] Create a SketchText with negative angle returns &amp;quot;invalid input angle&amp;quot; in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-create-a-sketchtext-with-negative-angle-returns-quot-invalid/m-p/9502057#M11810</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example that should create a text rotated by -90° in a sketch:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import adsk.core, traceback # pylint: disable=import-error

import math

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface

        design = app.activeProduct

        rootComp = design.rootComponent

        sketches = rootComp.sketches
        xyPlane = rootComp.xYConstructionPlane
        sketch = sketches.add(xyPlane)

        sketchTexts = sketch.sketchTexts

        sketchTextInput = sketchTexts.createInput('example', 1.0, adsk.core.Point3D.create(1.0, 1.0, 1.0))

        sketchTextInput.angle = -math.pi / 2
        
        sketchText = sketchTexts.add(sketchTextInput)       

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code fails by returning the error "invalid input angle".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-42f5b551-e23b-43d2-8d60-b326634856d6" target="_blank" rel="noopener"&gt;The documentation of the angle property&lt;/A&gt; should also mention that the value must be in radian and not in degree. &lt;BR /&gt;This is not obvious because it's the opposite in the dialog in Fusion 360.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 08 May 2020 15:06:16 GMT</pubDate>
    <dc:creator>JeromeBriot</dc:creator>
    <dc:date>2020-05-08T15:06:16Z</dc:date>
    <item>
      <title>[Bug] Create a SketchText with negative angle returns "invalid input angle"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-create-a-sketchtext-with-negative-angle-returns-quot-invalid/m-p/9502057#M11810</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example that should create a text rotated by -90° in a sketch:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import adsk.core, traceback # pylint: disable=import-error

import math

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface

        design = app.activeProduct

        rootComp = design.rootComponent

        sketches = rootComp.sketches
        xyPlane = rootComp.xYConstructionPlane
        sketch = sketches.add(xyPlane)

        sketchTexts = sketch.sketchTexts

        sketchTextInput = sketchTexts.createInput('example', 1.0, adsk.core.Point3D.create(1.0, 1.0, 1.0))

        sketchTextInput.angle = -math.pi / 2
        
        sketchText = sketchTexts.add(sketchTextInput)       

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code fails by returning the error "invalid input angle".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-42f5b551-e23b-43d2-8d60-b326634856d6" target="_blank" rel="noopener"&gt;The documentation of the angle property&lt;/A&gt; should also mention that the value must be in radian and not in degree. &lt;BR /&gt;This is not obvious because it's the opposite in the dialog in Fusion 360.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 15:06:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-create-a-sketchtext-with-negative-angle-returns-quot-invalid/m-p/9502057#M11810</guid>
      <dc:creator>JeromeBriot</dc:creator>
      <dc:date>2020-05-08T15:06:16Z</dc:date>
    </item>
  </channel>
</rss>

