<?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: CylindricalJointMotion returns wrong limits value in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/cylindricaljointmotion-returns-wrong-limits-value/m-p/7548641#M17217</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reporting the issue to us. I logged it as&amp;nbsp;UP-37251 in our internal bug system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 07:44:45 GMT</pubDate>
    <dc:creator>marshaltu</dc:creator>
    <dc:date>2017-11-16T07:44:45Z</dc:date>
    <item>
      <title>CylindricalJointMotion returns wrong limits value</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/cylindricaljointmotion-returns-wrong-limits-value/m-p/7548473#M17216</link>
      <description>&lt;P&gt;Hi T_F360,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During some venturous exercise I have stumbled across some strange behaviour of&amp;nbsp; CylindricalJointMotion API.&amp;nbsp; It took me quite a wwwwhile to trace it to the joint limits returning method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the sample design test file:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;#------------------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;#Author-MichaelT&lt;/P&gt;
&lt;P&gt;#Description-CylinderJointTest&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import adsk.core, adsk.fusion, adsk.cam, traceback&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;def run(context):&lt;/P&gt;
&lt;P&gt;ui = None&lt;/P&gt;
&lt;P&gt;try:&lt;/P&gt;
&lt;P&gt;app = adsk.core.Application.get()&lt;/P&gt;
&lt;P&gt;ui = app.userInterface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;product = app.activeProduct&lt;/P&gt;
&lt;P&gt;design = adsk.fusion.Design.cast(product)&lt;/P&gt;
&lt;P&gt;rootComp = design.rootComponent&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;builtInJoints = rootComp.asBuiltJoints&lt;/P&gt;
&lt;P&gt;cylindricalJoint = builtInJoints.itemByName( 'CylindricalJoint' )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#Deep check !!!&lt;/P&gt;
&lt;P&gt;if ( cylindricalJoint.name == 'CylindricalJoint' &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;cylindricalMotion = cylindricalJoint.jointMotion&lt;/P&gt;
&lt;P&gt;rotation_Limits = cylindricalMotion.rotationLimits&lt;/P&gt;
&lt;P&gt;slide_Limits = cylindricalMotion.slideLimits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if ( rotation_Limits.isMaximumValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;limRotMax = rotation_Limits.maximumValue&lt;/P&gt;
&lt;P&gt;if ( rotation_Limits.isMinimumValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;limRotMin = rotation_Limits.minimumValue&lt;/P&gt;
&lt;P&gt;if ( rotation_Limits.isRestValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;restRot = rotation_Limits.restValue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if ( slide_Limits.isMaximumValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;limSlideMax = slide_Limits.maximumValue&lt;/P&gt;
&lt;P&gt;if ( slide_Limits.isMinimumValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;limSlideMin = slide_Limits.minimumValue&lt;/P&gt;
&lt;P&gt;if ( slide_Limits.isRestValueEnabled &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;restSlide = slide_Limits.restValue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (limRotMax == None or&lt;/P&gt;
&lt;P&gt;limRotMin == None or&lt;/P&gt;
&lt;P&gt;restRot == None or&lt;/P&gt;
&lt;P&gt;limSlideMax == None or&lt;/P&gt;
&lt;P&gt;limSlideMin == None or&lt;/P&gt;
&lt;P&gt;restSlide == None &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;ui.messageBox('Can not find the CylindricalJoint ')&lt;/P&gt;
&lt;P&gt;else:&lt;/P&gt;
&lt;P&gt;messageStr = 'CylindricalJoint limit values:\n'&lt;/P&gt;
&lt;P&gt;messageStr += '\tlimRotMax = {:g} rad \n'.format( limRotMax)&lt;/P&gt;
&lt;P&gt;messageStr += '\tlimRotMin = {:g} rad \n'.format( limRotMin)&lt;/P&gt;
&lt;P&gt;messageStr += '\trestRot = {:g} rad\n\n'.format( restRot )&lt;/P&gt;
&lt;P&gt;messageStr += '\tlimSlideMax = {:g} cm\n'.format( limSlideMax )&lt;/P&gt;
&lt;P&gt;messageStr += '\tlimSlideMin = {:g} cm\n'.format( limSlideMin )&lt;/P&gt;
&lt;P&gt;messageStr += '\trestSlide = {:g} cm\n'.format( restSlide )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ui.messageBox( messageStr )&lt;/P&gt;
&lt;P&gt;else:&lt;/P&gt;
&lt;P&gt;ui.messageBox('Can not find the CylindricalJoint ')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;except:&lt;/P&gt;
&lt;P&gt;if ui:&lt;/P&gt;
&lt;P&gt;ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;#------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;One would expect &amp;nbsp;(based on user interface input values) that the rotation limits returned &amp;lt; &lt;FONT face="symbol"&gt;-p, +p&lt;/FONT&gt; &amp;gt; … Instead we got values, which correspond to the&lt;FONT color="#FF0000"&gt; slider’s&lt;/FONT&gt; limit values ???&lt;/P&gt;
&lt;P&gt;I am attaching the .py &amp;amp; .f3d files&amp;nbsp; … to commemorate my misfortune … or mine inability to understand the FAPI correctly.&lt;/P&gt;
&lt;P&gt;… and also screencast …&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;MichaelT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. The system does not allow me to attach *.py file so it is pasted instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="84a00b80-83b9-4515-87e5-4464ecc35e4f" class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/84a00b80-83b9-4515-87e5-4464ecc35e4f" width="640" height="650" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Nov 2017 05:52:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/cylindricaljointmotion-returns-wrong-limits-value/m-p/7548473#M17216</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2017-11-16T05:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: CylindricalJointMotion returns wrong limits value</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/cylindricaljointmotion-returns-wrong-limits-value/m-p/7548641#M17217</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reporting the issue to us. I logged it as&amp;nbsp;UP-37251 in our internal bug system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 07:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/cylindricaljointmotion-returns-wrong-limits-value/m-p/7548641#M17217</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2017-11-16T07:44:45Z</dc:date>
    </item>
  </channel>
</rss>

