Executing Fusion command depending on context from external script

Executing Fusion command depending on context from external script

Anonymous
Not applicable
878 Views
2 Replies
Message 1 of 3

Executing Fusion command depending on context from external script

Anonymous
Not applicable

After looking through the API documentation and viewing many video's I was encouraged to write my questions to this forum. Here we go: sorry that I could not easily locate this information.

I am looking for a way to add a configurable keyboard (Touch Portal, see https://www.touch-portal.com/ ) for Fusion 360. You more or less would get the LCD buttons on a tablet, much like a 3Dconnexion Spacemouse Enterprise (though better, as for Fusion this mouse does not change buttons on context, like it does for NX e.g.).

I already extracted the necessary icons (thousands of .png files) from the runtime resources, so I can build pages with buttons.

For this to work I need two functionalities:
- Awareness of the context that fusion 360 is in to know which commands are applicable: solid/surface/mesh/sheet metal/sketch and  Create/prepare/modify/assemble/assemble/construct

- A manner to execute an external script or means to send keystrokes to Fusion 360 to execute a command "as if" a shortcut key is pressed. Touch portal CAN send keystrokes to Fusion: shortcuts work, but many commands will not have shortcuts. 

for the first: creating a file on disk whenever the context changes would be nice, e.g. when a transition occurs between Solid and sketch (but also surface/mesh/sheet metal tools). Where could this be integrated in the scripting environment?

for the second: Could I send a keystroke to Fusion upon which a script is executed? Ideally taking into account parameters that I provide? If a parameter cannot be provided, I could provide the command to use in a text file.

 

There was a way to "list" all possible commands from a script, but I need to locate this again. I link to this would be helpful.

Any hints and tips would be appreciated. Once finished I will make this available for anyone to use (no guarantees on timing though).

 

ruudrademaker_0-1626026289121.png

 

0 Likes
879 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
-edit- I found that I could list all Control ID's through the sample script.
Line 7234: Control ID: FusionCreateNewComponentCommand
Line 7247: Control ID: SketchCreate
Line 7260: Control ID: TSplineBaseFeatureCreationCommand
Line 7273: Control ID: PushDeriveCommand
Line 7286: Control ID: SeparatorAfter_PushDeriveCommand
Line 7290: Control ID: Extrude
Line 7303: Control ID: Revolve

etc.... So I assume I can easily run these commands, provided I can trigger the python script to tun from external.
Message 3 of 3

m.tozzi91
Participant
Participant

Hi

have u get it Running? 
i‘m new to touch panel and would like to add the functions from 3d connexion space mouse pro.

0 Likes