<?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 Error when reading rotationValue in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9798797#M10466</link>
    <description>&lt;P&gt;I am trying to change the angel of a simple revolution as BuiltIn joint like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent

        occ = root.occurrences.itemByName("MyComponent:1")     
        ui.messageBox(occ.name)
        driveJoint = occ.component.asBuiltJoints.itemByName("Rev7")

        revMotion = adsk.fusion.RevoluteJointMotion.cast(driveJoint.jointMotion)
        somevar = revMotion.rotationValue
        revMotion.rotationValue = somevar
        ui.messageBox(revMotion.rotationValue)
    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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that I always get an error when trying to read the value of `rotationValue` like in this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; revMotion.rotationValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;---------------------------
Fusion 360
---------------------------
Failed:
Traceback (most recent call last):
  File "C:/Users/XXX/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/Simulator/Simulator.py", line 22, in run
    somevar = revMotion.rotationValue
  File "C:/Users/XXX/AppData/Local/Autodesk/webdeploy/production/e93c21ea16478b49c4dee1f65accf1a11ae6ef96/Api/Python/packages\adsk\fusion.py", line 50025, in _get_rotationValue
    return _fusion.RevoluteJointMotion__get_rotationValue(self)
RuntimeError: 2 : InternalValidationError : axis

---------------------------
OK   
---------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me to get rid of this error? I cannot understand totally why this is happening..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is getting a relative motion, so just to increase the current angel like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; revMotion.rotationValue =&amp;nbsp;revMotion.rotationValue + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 22:26:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-12T22:26:54Z</dc:date>
    <item>
      <title>Error when reading rotationValue</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9798797#M10466</link>
      <description>&lt;P&gt;I am trying to change the angel of a simple revolution as BuiltIn joint like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent

        occ = root.occurrences.itemByName("MyComponent:1")     
        ui.messageBox(occ.name)
        driveJoint = occ.component.asBuiltJoints.itemByName("Rev7")

        revMotion = adsk.fusion.RevoluteJointMotion.cast(driveJoint.jointMotion)
        somevar = revMotion.rotationValue
        revMotion.rotationValue = somevar
        ui.messageBox(revMotion.rotationValue)
    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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that I always get an error when trying to read the value of `rotationValue` like in this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; revMotion.rotationValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;---------------------------
Fusion 360
---------------------------
Failed:
Traceback (most recent call last):
  File "C:/Users/XXX/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/Simulator/Simulator.py", line 22, in run
    somevar = revMotion.rotationValue
  File "C:/Users/XXX/AppData/Local/Autodesk/webdeploy/production/e93c21ea16478b49c4dee1f65accf1a11ae6ef96/Api/Python/packages\adsk\fusion.py", line 50025, in _get_rotationValue
    return _fusion.RevoluteJointMotion__get_rotationValue(self)
RuntimeError: 2 : InternalValidationError : axis

---------------------------
OK   
---------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me to get rid of this error? I cannot understand totally why this is happening..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is getting a relative motion, so just to increase the current angel like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; revMotion.rotationValue =&amp;nbsp;revMotion.rotationValue + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 22:26:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9798797#M10466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-12T22:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error when reading rotationValue</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9799095#M10467</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Isn't driveJoint set to None?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;driveJoint = occ.joints.itemByName ("Rev7")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;How about changing to?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 04:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9799095#M10467</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2020-10-13T04:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error when reading rotationValue</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9799288#M10468</link>
      <description>&lt;P&gt;Hello, actually noy because I am able to move the joint when I write an explicit&amp;nbsp;value to the rotationValue, but reading it causes the error.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 07:03:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9799288#M10468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-13T07:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error when reading rotationValue</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9801291#M10469</link>
      <description>&lt;P&gt;I ran the following code with the model data in the attachment.&lt;BR /&gt;I couldn't reproduce the situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent

        occ = root.occurrences.itemByName("MyComponent:1")     
        ui.messageBox(occ.name)
        driveJoint = occ.joints.itemByName("Rev7")

        revMotion = adsk.fusion.RevoluteJointMotion.cast(driveJoint.jointMotion)
        somevar = revMotion.rotationValue
        revMotion.rotationValue = somevar
        ui.messageBox(str(revMotion.rotationValue))
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 00:54:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/error-when-reading-rotationvalue/m-p/9801291#M10469</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2020-10-14T00:54:33Z</dc:date>
    </item>
  </channel>
</rss>

