Shaded/Wireframe Shortcut Macro

Shaded/Wireframe Shortcut Macro

Anonymous
Not applicable
11,454 Views
9 Replies
Message 1 of 10

Shaded/Wireframe Shortcut Macro

Anonymous
Not applicable
 
Could someone please help me with a Macros to toggle between Shaded view and Wireframe view with a shortcut key? 
 
wireframe.png
0 Likes
Accepted solutions (1)
11,455 Views
9 Replies
Replies (9)
Message 2 of 10

marshaltu
Autodesk
Autodesk

Hello,

 

Unfortunately there was no API to support setting shortcut key. I would like to recommend you log a request in our ideastation and then our product management team could review the requirement and other users could also vote on that.

 

http://forums.autodesk.com/t5/ideastation-request-a-feature-or/idb-p/125

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes
Message 3 of 10

ekinsb
Alumni
Alumni
Accepted solution

As Marshal said, Fusion doesn't currently support custom shortcut keys, from either from the user-interface or the API.

 

It's not a shortcut key, but I wrote a simple add-in that creates a new button next to the "Display Settings" command that toggles the display between wireframe and shaded.  You can get the add-in here.

 

ToggleDisplay.png

 

After a bit of research it looks like it might be possible to catch the keyboard events at a low level and react to that, which would essentally allow you to implement shortcut keys on your own.  Here's one post I found that discusses this, (http://stackoverflow.com/questions/9817531/applying-low-level-keyboard-hooks-with-python-and-setwind... However, this is Windows specific.  There were also some posts for OSX, but it looks like it would have to be a different implementation for Windows and Mac.

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 4 of 10

Anonymous
Not applicable

Hi @ekinsb!

Perfect, it can be used with autohotkey and gives the wanted result.

 

Autohotkey code:

 

F1::
IfWinActive, Autodesk Fusion 360 
{
  Send, s
  SendInput toggle{Enter}
  return
}

By pressing F1 it toogle view. 

 

 

Thank you for your add-in, I accepted your post as solution.

 

Sure it requires a builtin customizable shortcut feature in fusion 360.

0 Likes
Message 5 of 10

lian_xie
Contributor
Contributor

Hi Brian,

Is it possible to create an Add-In for Inventor to toggle the display settings?

If so, could you please show an example?

Thanks a lot, Lian

0 Likes
Message 6 of 10

Anonymous
Not applicable

Hello,

 

İ have a problem like this.

I want to display a sphere at wireframe mode but the program does not do it as desired.  when I want to the sphere more detailed, program displays just a  circle. How can I solve this problem?

Please help me, thanks.

0 Likes
Message 7 of 10

Anonymous
Not applicable

okey, i  solved it. 🙂

0 Likes
Message 8 of 10

polygrinder
Enthusiast
Enthusiast

Brian,

 

This is a great Add In. However, I am wanting to be able to toggle between "Shaded" and "Shaded with Wireframe". I tried to modify your Add in to but to no avail. I just don't have the coding knowledge. Would it be too much to ask for you to modify and post a version that would accomplish that task.

 

Thanks,

Micheal

0 Likes
Message 9 of 10

Anonymous
Not applicable

What is the icon at the end? It looks like a white sideways christmas tree.

0 Likes
Message 10 of 10

Anonymous
Not applicable

In case you're still wondering about turning on hidden edges with Brian's add-in, change the if statement in MyCommandCreatedHandler.notify to:

 

        if currentStyle == 2:
            # Set to wireframe.
            app.activeViewport.visualStyle = 1
        else:
            # Set to shaded with visible edges.
            app.activeViewport.visualStyle = 2 # Is actually shaded with visible edges only.

The comments might be completely meaningless, as the docs are wrong and this was figured out with trial and error. Broken docs here: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-b821dca0-874b-49ca-8c37-59f7b22bfc6f

0 Likes