<?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 Anti-Aliasing effect in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8875943#M13957</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to toggle the state of the Anti-Aliasing effect with the API ?&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="fusion-360-anti-aliasing.png" style="width: 388px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/651598iCD28325FD0932BDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="fusion-360-anti-aliasing.png" alt="fusion-360-anti-aliasing.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 09:48:31 GMT</pubDate>
    <dc:creator>JeromeBriot</dc:creator>
    <dc:date>2019-06-27T09:48:31Z</dc:date>
    <item>
      <title>Anti-Aliasing effect</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8875943#M13957</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to toggle the state of the Anti-Aliasing effect with the API ?&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="fusion-360-anti-aliasing.png" style="width: 388px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/651598iCD28325FD0932BDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="fusion-360-anti-aliasing.png" alt="fusion-360-anti-aliasing.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:48:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8875943#M13957</guid>
      <dc:creator>JeromeBriot</dc:creator>
      <dc:date>2019-06-27T09:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Anti-Aliasing effect</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8880693#M13958</link>
      <description>&lt;P&gt;You can try below script to do that&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;context = adsk.core.NamedValues.create()&lt;BR /&gt;cmdIDName = adsk.core.ValueInput.createByString(“ViewMSAAOnCommand”)&lt;BR /&gt;context.add(“CmdId”,cmdIDName)&lt;BR /&gt;cmdDef = ui.commandDefinitions.itemById(“ViewDisplayCommand”) cmdDef.execute(context)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only problem with this code is it does not update Fusion UI means check box is not updated in UI but it certainly take effect on display. Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2019 09:29:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8880693#M13958</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2019-06-29T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Anti-Aliasing effect</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8880926#M13959</link>
      <description>&lt;P&gt;Great! Thank you &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1639694"&gt;@goyals&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To activate the anti-aliasing:&lt;/P&gt;&lt;PRE&gt;context = adsk.core.NamedValues.create()
cmdIDName = adsk.core.ValueInput.createByString('ViewMSAAOnCommand')
context.add('CmdId', cmdIDName)
cmdDef = ui.commandDefinitions.itemById('ViewDisplayCommand')
cmdDef.execute(context)&lt;/PRE&gt;&lt;P&gt;To desactivate the anti-aliasing:&lt;/P&gt;&lt;PRE&gt;context = adsk.core.NamedValues.create()
cmdIDName = adsk.core.ValueInput.createByString('ViewMSAAOffCommand')
context.add('CmdId', cmdIDName)
cmdDef = ui.commandDefinitions.itemById('ViewDisplayCommand')
cmdDef.execute(context)&lt;/PRE&gt;&lt;P&gt;Is there a possibility to get the current state of the anti-aliasing effect. So I can restore it to its original state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2019 14:37:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8880926#M13959</guid>
      <dc:creator>JeromeBriot</dc:creator>
      <dc:date>2019-06-29T14:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Anti-Aliasing effect</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8881833#M13960</link>
      <description>&lt;P&gt;Here's a different approach that lets you get the current state of the Anti-Alias setting and set it to whatever value you want.&amp;nbsp; Whatever change you make is also reflected in the UI.&amp;nbsp; It uses the fact that ALL commands are exposed through the API and this command happens to be represented in the UI as a list control.&amp;nbsp; This uses the API functionality of the list control to get a specific item in the list, check to see if it is checked or not and change its state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;def run(Context):
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface

        # Get the "Effects" command.
        effectsCmdDef = ui.commandDefinitions.itemById('ViewEffectCommand')
        
        # Get the control definition associated with the command.
        effectsCntrlDef = adsk.core.ListControlDefinition.cast(effectsCmdDef.controlDefinition)
        
        # Iterate through the items in the list to find the one for "Anti-Aliasing".
        # !!! This will only work in an English version of Fusion.
        listItem = adsk.core.ListItem.cast(None)
        antiAlias = adsk.core.ListItem.cast(None)
        for listItem in effectsCntrlDef.listItems:
            if listItem.name == 'Anti-Aliasing':
                antiAlias = listItem
                break

        if antiAlias:
            if antiAlias.isSelected:
                ui.messageBox('Anti-Aliasing is on.  Turning off.')
                antiAlias.isSelected = False
            else:
                ui.messageBox('Anti-Aliasing is off.  Turning on.')
                antiAlias.isSelected = True
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 01:32:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8881833#M13960</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-07-01T01:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Anti-Aliasing effect</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8882179#M13961</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;. That's exactly what I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the complete test for all languages supported by Fusion 360:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if listItem.name in {'Anti-Aliasing', 'アンチエイリアシング', '抗锯齿'}:&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 08:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/anti-aliasing-effect/m-p/8882179#M13961</guid>
      <dc:creator>JeromeBriot</dc:creator>
      <dc:date>2019-07-01T08:15:38Z</dc:date>
    </item>
  </channel>
</rss>

