Visual Studio Code Trick for Editing Posts!

How can Visual Studio Code make it easy to edit post processors?

Visual Studio Code is a code editor by Microsoft which has some handy tricks that can let us know which part of a post processor is doing what (side note – it makes a great general code editor too!) By adding an extension to Visual Studio that is designed for Fusion 360 as well as a few other UI tweaks to make things easier, we can easily use sample code provided by the extension to make sense of and edit our post processor.

CRITICAL Setting Change:

By default, VS Code tries to remember past versions which can result in the wrong code being posted, despite re-running your Fusion post processor. The fix is to follow this video to change the ‘hot exit’ setting.

Installation and Setup

1.

Install Visual Studio Code. This is the software we’ll be using and adding on to for this workflow, so install it first. Visual Studio has a few different variants meant specifically for app and software development, so make sure you grab VS Code which is the general code editor. Keep track of where this installs so you can select it in Fusion later.

Click to expand image

2.

Add the Autodesk Fusion 360 Post Processor Utility extension to VS Code by clicking the gear in the bottom corner > extensions > and searching “HSM”. Then click on the correct extension and click install. Watch the video above for the settings we use, which you can edit by going to the gear at the bottom left > Settings > and search “HSM” at the top for related settings.

Click to expand image

3.

Add the nc-gcode extension to VS Code by clicking the gear in the bottom corner > extensions > and searching “nc”. Then click on the correct extension and click install. Note that this and the following add-on are not necessary, but we found make the process easier.

Click to expand image

4.

Again this step is optional, but we changed our color scheme. In the same extension search box, type “purple” and install “Shades of Purple” color scheme. Once downloaded you may have to manually set the color scheme, go to help > welcome > and select Shades of Purple from the drop down under color scheme.

Click to expand image

5.

This is where it helps to remember where you installed Visual Studio. We need to set this as our default post editor, so open Fusion and go to preferences. From here, click on manufacture and at the top you will see “External Editor” – click on this box and browse to where VS Code is installed. Now every time you post code from Fusion it should open in Visual Studio instead of WordPad (Fusion’s default).

6.

Once you have your post-processor edited, you need to export it as a .cps file to use in Fusion. To do this, press F1 on your keyboard and type “Download CNC exporting post” – this should auto-populate the command you’re looking for. Click on this result, and save your edited post processor wherever you like! In Fusion, choose this file you just saved as your post processor location to use it for your gcode.

Modifying A Fusion 360 Post Processor for Custom Tool Change Location – FF127
Post Processor Basics in Fusion 360
Machining a Motorcycle Triple Clamp!