<?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: I am isGrounded ... in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7172699#M17937</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We had a topic "Documents, Products, Components, Occurrences, and Proxies"(link as below) to explain why we need proxy in some case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, when users pick up a leaf node in the browser in Fusion 360, it implies users select an unique path in the assembly tree. We need provide a way to do that in API world.&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-88A4DB43-CFDD-4CFF-B124-7EE67915A07A" target="_blank"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-88A4DB43-CFDD-4CFF-B124-7EE67915A07A&lt;/A&gt;&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>Fri, 23 Jun 2017 01:52:19 GMT</pubDate>
    <dc:creator>marshaltu</dc:creator>
    <dc:date>2017-06-23T01:52:19Z</dc:date>
    <item>
      <title>I am isGrounded ...</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7169797#M17934</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am stumbled on the ground of perhaps only mine inability to understand the simplicity of F360 API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simple code:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;comp.occurrences.item(0).isGrounded = True&lt;/P&gt;&lt;P&gt;comp.occurrences.item(0).isLightBulbOn = False&lt;/P&gt;&lt;P&gt;comp.occurrences.item(1).isGrounded = False&lt;/P&gt;&lt;P&gt;comp.occurrences.item(1).isLightBulbOn = True&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;work as a charm but ... only for&amp;nbsp;&lt;SPAN&gt;isLightBulbOn functions. The&amp;nbsp;isGrounded property in F360 window is 'False' no matter what ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would welcome any enlightenment . How to ground&amp;nbsp;&amp;nbsp;comp.occurrences.item(0)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MichaelT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS.I am writing from the planet Earth so theoretically&amp;nbsp;should not be an issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 06:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7169797#M17934</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2017-06-22T06:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: I am isGrounded ...</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7170433#M17935</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There was a bug in the method. We should throw exception if clients are trying to set grounded property for an occurrence with relative path. For example: setting "Component3:1" grounded by "Component1:1" should fail.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution for you would be to create a proxy object for the kind of occurrence and then set grounded property by proxy object. Please refer to the sample codes.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-06-22 at 6.39.40 PM.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/370252i7478B7839F6EC3A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2017-06-22 at 6.39.40 PM.png" alt="Screen Shot 2017-06-22 at 6.39.40 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&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.item(0)
        comp = occ.component
        subOcc1 = comp.occurrences.item(0)
        subOcc1Proxy = subOcc1.createForAssemblyContext(occ)
        subOcc1Proxy.isGrounded = True       

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jun 2017 10:40:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7170433#M17935</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2017-06-22T10:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: I am isGrounded ...</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7170704#M17936</link>
      <description>&lt;P&gt;Thank you Mr Tu,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am isUngrounded ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I have seen your VERY SPEEDY response, I did some testing by moving the component I wanted to ground to the root level. In such arrangement, grounding was not a problem.&lt;/P&gt;
&lt;P&gt;After applying the patch you sent, I have had no problem to do the same, with the component at lower levels in the assembly.&lt;/P&gt;
&lt;P&gt;So your diagnosis was on the spot .... perhaps I was not only one which encountered such tricky situation :).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intuitively, grounding is a grounding no matter when and where: Bourbon Road in New Orlean, King Cross in Sydney or Prag in Warsaw ... I am talking about electricity ... of course.&lt;/P&gt;
&lt;P&gt;So hopefully, .... there is some way to implement it transparently (at the kernel level ) without changing API docs/references ...or even worse ... teaching Earth populus to do it by proxy ... unless there are reasons, I do not understand ... which is possible!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Regards&lt;/P&gt;
&lt;P&gt;MichaelT&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 12:44:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7170704#M17936</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2017-06-22T12:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: I am isGrounded ...</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7172699#M17937</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We had a topic "Documents, Products, Components, Occurrences, and Proxies"(link as below) to explain why we need proxy in some case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, when users pick up a leaf node in the browser in Fusion 360, it implies users select an unique path in the assembly tree. We need provide a way to do that in API world.&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-88A4DB43-CFDD-4CFF-B124-7EE67915A07A" target="_blank"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-88A4DB43-CFDD-4CFF-B124-7EE67915A07A&lt;/A&gt;&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>Fri, 23 Jun 2017 01:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7172699#M17937</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2017-06-23T01:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: I am isGrounded ...</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7172826#M17938</link>
      <description>&lt;P&gt;Thank you Mr Tu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is valuable reference ....&lt;/P&gt;
&lt;P&gt;Additional elaborations about the role of proxies can be found under the keyword 'Proxy' in 'Autodesk Inventor 2017 Help', which might help many others&amp;nbsp;finding themselves in the proximity of&amp;nbsp;F360 API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per my understanding, when I create (via API) component's occurrence, I give it in the process of successive steps the distinctive address path in the design. (yes?no?)&lt;/P&gt;
&lt;P&gt;So there is not a confusion about the identity of the particular reference ( which can be easily checked by &lt;EM&gt;"fullpathname"&lt;/EM&gt; property) and as such, there should be not confusion in the 'grounding' function.&lt;/P&gt;
&lt;P&gt;As a matter of fact one can not ground respective component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more thought ...&lt;/P&gt;
&lt;P&gt;Sometimes there is a confusion between a model and model's interface.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is particularly visible in F360 ... and somehow enforced by the&amp;nbsp;&lt;EM&gt;"InputMethod"&lt;/EM&gt; paradigm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;A model&lt;/EM&gt;&lt;/STRONG&gt; itself (this is a little bit philosophical) can exist without interfering with it user(s) .&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;model's interface&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;is the distinctive abstraction of an interaction with the model(s).&lt;/P&gt;
&lt;P&gt;Both are two different things ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Regards&lt;/P&gt;
&lt;P&gt;MichaelT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Still struggling with proxies &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 04:40:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/i-am-isgrounded/m-p/7172826#M17938</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2017-06-23T04:40:09Z</dc:date>
    </item>
  </channel>
</rss>

