<?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 onExecute fired when moved project, I want to cancel processing in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9668936#M11090</link>
    <description>&lt;P&gt;I noticed onExecute event fired when I move a project with taking out command GUI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I pushed the OK button, I want to run [OK] processing.&lt;BR /&gt;When I movied project, I want to run [cancel] processing.&lt;/P&gt;&lt;P&gt;However, I think that I cannot distinguish me with the argument of onExecute.&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="eventArgs_when_[OK]pressed.png" style="width: 325px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802446i900C1B06C377F3A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="eventArgs_when_[OK]pressed.png" alt="eventArgs_when_[OK]pressed.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eventArgs_when_moved_project.png" style="width: 331px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802447i85A62170EA3D6BDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="eventArgs_when_moved_project.png" alt="eventArgs_when_moved_project.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(The left image is OK pressed eventArgs, the right when moved project. I think same two)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;class CommandCreatedHandler(adsk.core.CommandCreatedEventHandler):

    def __init__(self):
        super().__init__()

    def notify(self, args):
        cmd = adsk.core.Command.cast(args.command)

        onExecute = ExecuteHandler()
        cmd.execute.add(onExecute)
        _handlers.append(onExecute)

        # omit other code

class ExecuteHandler(adsk.core.CommandEventHandler):

    def __init__(self):
        super().__init__()

    def notify(self, args):
        eventArgs = adsk.core.CommandEventArgs.cast(args)  # &amp;lt;- Dump this

        # [OK] processing
        # omit other code&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Mon, 03 Aug 2020 02:13:58 GMT</pubDate>
    <dc:creator>Daisuke.Inokuma1</dc:creator>
    <dc:date>2020-08-03T02:13:58Z</dc:date>
    <item>
      <title>onExecute fired when moved project, I want to cancel processing</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9668936#M11090</link>
      <description>&lt;P&gt;I noticed onExecute event fired when I move a project with taking out command GUI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I pushed the OK button, I want to run [OK] processing.&lt;BR /&gt;When I movied project, I want to run [cancel] processing.&lt;/P&gt;&lt;P&gt;However, I think that I cannot distinguish me with the argument of onExecute.&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="eventArgs_when_[OK]pressed.png" style="width: 325px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802446i900C1B06C377F3A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="eventArgs_when_[OK]pressed.png" alt="eventArgs_when_[OK]pressed.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eventArgs_when_moved_project.png" style="width: 331px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802447i85A62170EA3D6BDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="eventArgs_when_moved_project.png" alt="eventArgs_when_moved_project.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(The left image is OK pressed eventArgs, the right when moved project. I think same two)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;class CommandCreatedHandler(adsk.core.CommandCreatedEventHandler):

    def __init__(self):
        super().__init__()

    def notify(self, args):
        cmd = adsk.core.Command.cast(args.command)

        onExecute = ExecuteHandler()
        cmd.execute.add(onExecute)
        _handlers.append(onExecute)

        # omit other code

class ExecuteHandler(adsk.core.CommandEventHandler):

    def __init__(self):
        super().__init__()

    def notify(self, args):
        eventArgs = adsk.core.CommandEventArgs.cast(args)  # &amp;lt;- Dump this

        # [OK] processing
        # omit other code&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 02:13:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9668936#M11090</guid>
      <dc:creator>Daisuke.Inokuma1</dc:creator>
      <dc:date>2020-08-03T02:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: onExecute fired when moved project, I want to cancel processing</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9669145#M11091</link>
      <description>&lt;P&gt;What do you mean by "move project"? Can you exemplify how you do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try setting cmd.&lt;A href="http://help.autodesk.com/cloudhelp/ENU/Fusion-360-API/files/Command_isExecutedWhenPreEmpted.htm" target="_blank"&gt;isExecutedWhenPreEmpted&lt;/A&gt; = False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 06:39:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9669145#M11091</guid>
      <dc:creator>thomasa88</dc:creator>
      <dc:date>2020-08-03T06:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: onExecute fired when moved project, I want to cancel processing</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9669189#M11092</link>
      <description>&lt;P&gt;Sorry to noisy word.&lt;BR /&gt;In other word, changing current project.&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="rapture_20200803154952.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802502iC5719981D41951E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="rapture_20200803154952.png" alt="rapture_20200803154952.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; Try setting cmd.&lt;A href="http://help.autodesk.com/cloudhelp/ENU/Fusion-360-API/files/Command_isExecutedWhenPreEmpted.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;isExecutedWhenPreEmpted&lt;/A&gt; = False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it and solved it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your valuable answer!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 07:18:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/onexecute-fired-when-moved-project-i-want-to-cancel-processing/m-p/9669189#M11092</guid>
      <dc:creator>Daisuke.Inokuma1</dc:creator>
      <dc:date>2020-08-03T07:18:57Z</dc:date>
    </item>
  </channel>
</rss>

