Skip to content

Getting started with Intellij IDEA (Windows)

Ben Gruver edited this page Feb 17, 2019 · 3 revisions

This describes how to configure Intellij IDEA and set up a new project that uses fscad.

  1. First, install fscad as an add-in in Fusion 360.

  2. Clone the fscad repository to a directory on your local machine, or download a source archive and extract it to a new directory.

  3. Start IDEA and select "Configure->Plugins" in the lower right corner of the Welcome screen.

  4. Click the "Browse repositories" button, and install the "Python Community Edition" and "Fusion 360 Scripting" plugins.

  5. Exit from the Browser repository and Plugins windows, and then click "Restart" when prompted to restart IDEA.

  6. Once IDEA restarts, select "Create New Project" on the right hand side of the Welcome screen.

  7. Select the "Python" project type on the left hand side, and check the checkbox next to "Fusion 360 Support" on the right hand side, and click "Next".

  8. Enter the project name and location, and click "Finish".

  9. Once the main IDEA window opens with the new project, go to File -> Project Structure.

  10. Select "Facets" in the left hand side, and then choose the "Fusion 360 Support" facet for the project.

  11. The Fusion 360 Executable field should have the path to the Fusion 360 executable on your computer. If it does not, you'll need to find the location and enter the full path here. This will typically be something like "C:\Users<user>\AppData\Local\Autodesk\webdeploy\production<guid>\Python\python.exe".

    There may be multiple guid directories in the production directory. If so, there should be only 1 that actually has a Fusion360.exe executable. Just look through them all until you find it.

  12. Make a note of the path here. You'll need it to setup the python sdk below.

  13. Select "SDKs" in the left hand side, and then click the "+" icon at the top, and choose "Python SDK".

  14. Select "System Interpreter" on the left hand side, and browse to the python.exe included in Fusion 360s installation. You can start from the path from steps 9/10. E.g. if your Fusion360.exe executable path was C:\Users\user\AppData\Local\Autodesk\webdeploy\production\1460235013ebd0c1ef7542ea7ef3e87a095972d9\Fusion360.exe, then the python executable should be at C:\Users\user\AppData\Local\Autodesk\webdeploy\production\1460235013ebd0c1ef7542ea7ef3e87a095972d9\Python\python.exe.

  15. Click "ok" to create the new sdk.

  16. Select "Project" in the left hand side of the "Project Structure" window.

  17. Select the newly created python sdk in the "Project SDK" field.

  18. Click "apply" to apply the changes.

  19. Select "Modules" in the left hand side of the "Project Structure" window.

  20. Select the "Dependencies" tab, and click on the "+" icon on the right hand side, and select "JARs or directories".

  21. Select the fscad directory from step 1 and click "OK".

  22. Select "Classes" in the "Choose Categories of Selected Files" dialog that pops up.

  23. Click "Apply" and then "OK" in the "Project Structure" dialog to apply the changes and close the dialog.

  24. Right click on your project in the left hand project structure pane, and choose "New -> Python file", and enter the name of your script. e.g. "design.py".

  25. You can use the following as a starter script.

    import adsk.core, adsk.fusion
    from fscad import *
    
    def design():
        sphere = Sphere(1)
        sphere.create_occurrence(True, scale=.1)
    
    def run(_):
        run_design(design, message_box_on_error=False, document_name=__name__)
  26. Start Fusion 360 if it isn't already.

  27. Open your design.py script in IDEA, and right click in the editor pane, and select "Run in Fusion 360".

  28. There should be a new tab in Fusion 360 with the objects created from the design script.

Clone this wiki locally