<?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: How do change an orientation of operation by Python? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347341#M8756</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh, Ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When to use toolpath template, "flip" can change false to true but an axis is not be able to change.&lt;BR /&gt;If I copy to another CAM with an operation that changed "Z axis" (or "X axis") and flip, the following warning will be displayed. And “Z-axis” to be empty.&lt;/P&gt;&lt;P&gt;"One or more operations that were moved or copied over have a manufacturing model that is different from the one referenced in the target setup.&lt;BR /&gt;All geometry selections associated with these operations have been cleared."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you know of any, when executing commandDefinition.execute of 'IronSetup', it can take NamedValues as an argument.&lt;BR /&gt;What can I specify for the key of this argument, or will the argument be ignored?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, traceback
def run(_):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        properties = adsk.core.NamedValues.create()
        value = adsk.core.ValueInput.createByString('axisZX')
        properties.add('wcs_orientation_mode', value)
        setupcommand = ui.commandDefinitions.itemById('IronSetup')
        setupcommand.execute(properties)
        commitcommand = ui.commandDefinitions.itemById('CommitCommand')
        commitcommand.execute()
        # A setup created but it ignored the argument.
    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>Fri, 28 May 2021 11:41:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-28T11:41:53Z</dc:date>
    <item>
      <title>How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10346845#M8752</link>
      <description>&lt;P&gt;I would like to change an orientation of drill operation by Python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to change a few below parameters.&lt;/P&gt;&lt;P&gt;-&amp;nbsp;overrideToolView: 'true'&lt;/P&gt;&lt;P&gt;-&amp;nbsp;view_orientation_mode: "'axesZX'"&lt;/P&gt;&lt;P&gt;-&amp;nbsp;view_orientation_flipZ: 'true'&lt;/P&gt;&lt;P&gt;- view_orientation_axisZ: 'true'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I got an error when change 'view_orientation_axisZ'.&lt;/P&gt;&lt;P&gt;The error said "can't change this value".&lt;/P&gt;&lt;P&gt;Is there a way that to select YZPlane for axisZ ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My purpose is to set toolpaths for top, bottom, back, top, right and left in Python like sample.f3d.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, adsk.cam, os, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        doc = app.activeDocument
        products = doc.products
        cam = adsk.cam.CAM.cast(products.itemByProductType("CAMProductType"))

        setups = cam.setups
        setup = setups[0]
        overrideToolView = operation.parameters.itemByName('overrideToolView')
        overrideToolView.expression = 'true'
        mode = operation.parameters.itemByName('view_orientation_mode')
        mode.expression = "'axesZX'"
        flipz = operation.parameters.itemByName('view_orientation_flipZ')
        flipz.expression = 'true'
        axisx = operation.parameters.itemByName('view_orientation_axisX')
        axisx.expression = 'true'
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 May 2021 08:08:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10346845#M8752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-28T08:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347163#M8753</link>
      <description>&lt;P&gt;Hi @Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the parameter name was 'view_orientation_flipX', there was no error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check the parameter name by moving the mouse cursor to the corresponding part in the GUI and displaying the tooltip while holding down the Shift key.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 419px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/924201i1C1CFCED648924F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 10:16:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347163#M8753</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-05-28T10:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347193#M8754</link>
      <description>Hi, &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt; .&lt;BR /&gt;Thank you for reply!&lt;BR /&gt;&lt;BR /&gt;Sorry for the lack of explanation.&lt;BR /&gt;I want to rotate the z axis by 90 degrees, but with flip, it rotates 180 degrees.&lt;BR /&gt;If it turns 180 degrees I will not be able to set the toolpaths the side of the part.</description>
      <pubDate>Fri, 28 May 2021 10:31:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347193#M8754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-28T10:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347232#M8755</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need to set the "Z Axis" and "X Axis", but I don't think it is currently possible to set them via the API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't use Fusion360CAM, so I don't know much about it, but the most efficient way to work with it might be to create a toolpath template in advance and call it up.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=MFG-TEMPLATE-LIBRARY-SELECTION" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=MFG-TEMPLATE-LIBRARY-SELECTION&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Toolpath templates can also be called from the API.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-AEF0708D-B657-4E9F-9032-4535E0D1C417" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-AEF0708D-B657-4E9F-9032-4535E0D1C417&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 10:48:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347232#M8755</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-05-28T10:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347341#M8756</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh, Ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When to use toolpath template, "flip" can change false to true but an axis is not be able to change.&lt;BR /&gt;If I copy to another CAM with an operation that changed "Z axis" (or "X axis") and flip, the following warning will be displayed. And “Z-axis” to be empty.&lt;/P&gt;&lt;P&gt;"One or more operations that were moved or copied over have a manufacturing model that is different from the one referenced in the target setup.&lt;BR /&gt;All geometry selections associated with these operations have been cleared."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you know of any, when executing commandDefinition.execute of 'IronSetup', it can take NamedValues as an argument.&lt;BR /&gt;What can I specify for the key of this argument, or will the argument be ignored?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, traceback
def run(_):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        properties = adsk.core.NamedValues.create()
        value = adsk.core.ValueInput.createByString('axisZX')
        properties.add('wcs_orientation_mode', value)
        setupcommand = ui.commandDefinitions.itemById('IronSetup')
        setupcommand.execute(properties)
        commitcommand = ui.commandDefinitions.itemById('CommitCommand')
        commitcommand.execute()
        # A setup created but it ignored the argument.
    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>Fri, 28 May 2021 11:41:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10347341#M8756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-28T11:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10351307#M8757</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is very little information about "NamedValues".&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have tried to create a setup in the past, specifying the model.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/create-new-cam-setups/m-p/10215806" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/create-new-cam-setups/m-p/10215806&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is not the preferred way, but I can think of no other way to achieve something that is not provided by the API.&lt;BR /&gt;And it is very difficult to develop.&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 13:31:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10351307#M8757</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-05-30T13:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do change an orientation of operation by Python?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10352013#M8758</link>
      <description>&lt;P&gt;I see.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try it on the assumption that it is not the recommended way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for showing me about it.&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 23:54:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-do-change-an-orientation-of-operation-by-python/m-p/10352013#M8758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-30T23:54:32Z</dc:date>
    </item>
  </channel>
</rss>

