Code Library
Fusion 360 APIPythonFusion 360 · bundled Python interpreterMIT licenseIntermediate

Parametric mounting plate generator (Fusion 360 Python)

The blog's hello-world plate sketches a rectangle and extrudes it. This is the finished version: same idea, plus corner fillets and an array of mounting holes, all driven by the handful of numbers at the top of the script. Change the width, height, hole layout, or fillet radius and re-run — no re-modeling.

Before you run it

  • Fusion 360, run from Utilities → Add-Ins → Scripts and Add-Ins (Shift+S) → Create
  • An empty or new design — the script models into the active document's root component

The code

GitHub
"""Generate a parametric mounting plate: width x height x thickness,
an array of through-holes, and optional corner fillets.

Run from Utilities -> Add-Ins -> Scripts and Add-Ins (Shift+S).
Edit the constants below, then run.
"""

import traceback

import adsk.core
import adsk.fusion

WIDTH, HEIGHT, THICK = 80.0, 50.0, 6.0    # mm
CORNER_FILLET = 4.0                       # mm, 0 to skip
HOLE_DIA = 5.0                             # mm
# (x, y) from the plate's corner, mm
HOLE_POSITIONS = [(8, 8), (72, 8), (8, 42), (72, 42)]


def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent

        # 1. outline + extrude
        sketch = root.sketches.add(root.xYConstructionPlane)
        sketch.sketchCurves.sketchLines.addTwoPointRectangle(
            adsk.core.Point3D.create(0, 0, 0),
            adsk.core.Point3D.create(WIDTH / 10, HEIGHT / 10, 0),
        )
        prof = sketch.profiles.item(0)
        extrude = root.features.extrudeFeatures.addSimple(
            prof,
            adsk.core.ValueInput.createByReal(THICK / 10),
            adsk.fusion.FeatureOperations.NewBodyFeatureOperation,
        )
        body = extrude.bodies.item(0)

        # 2. corner fillets
        if CORNER_FILLET > 0:
            edges = adsk.core.ObjectCollection.create()
            for edge in body.edges:
                # the four vertical corner edges all measure exactly the plate thickness
                if abs(edge.length - THICK / 10) < 1e-5:
                    edges.add(edge)
            if edges.count:
                fillets = root.features.filletFeatures
                fillet_input = fillets.createInput()
                fillet_input.addConstantRadiusEdgeSet(
                    edges, adsk.core.ValueInput.createByReal(CORNER_FILLET / 10), True
                )
                fillets.add(fillet_input)

        # 3. mounting holes
        hole_sketch = root.sketches.add(root.xYConstructionPlane)
        for x, y in HOLE_POSITIONS:
            hole_sketch.sketchCurves.sketchCircles.addByCenterRadius(
                adsk.core.Point3D.create(x / 10, y / 10, 0), (HOLE_DIA / 2) / 10
            )
        for i in range(hole_sketch.profiles.count):
            hole_prof = hole_sketch.profiles.item(i)
            root.features.extrudeFeatures.addSimple(
                hole_prof,
                adsk.core.ValueInput.createByReal(THICK / 10),
                adsk.fusion.FeatureOperations.CutFeatureOperation,
            )
    except:
        if ui:
            ui.messageBox(f"Failed:\n{traceback.format_exc()}")

What you get

What you get

An 80x50x6mm plate body in the active design, with 4mm corner
fillets and four 5mm mounting holes at (8,8) (72,8) (8,42) (72,42) -
ready to dimension, pattern, or export straight to STEP/STL.

How it works

  • The plate itself is the same sketch-then-extrude pattern as the blog's hello-world example — outline on xYConstructionPlane, extrude to a new body. Everything after this is what makes it a real part instead of a toy.
  • Corner fillets are found by edge length, not by picking specific edges: a plain rectangular extrusion's four vertical edges all measure exactly the plate thickness, which is a cheap, reliable way to grab "the four corners" without needing named references to geometry Fusion generated for you.
  • Holes are cut from a second sketch on the same base plane as the plate, extruded through the full thickness with CutFeatureOperation — same plane, same distance, opposite intent (NewBodyFeatureOperation built it, CutFeatureOperation removes from it).
  • One sketch, multiple circles, one loop over hole_sketch.profiles — Fusion turns each closed circle into its own profile automatically, so four holes cost one extra loop, not four repeated blocks.

Gotchas & honest limits

  • Corner-fillet-by-edge-length is a simple, effective trick for a plain rectangle — it breaks on any outline where more than four edges share the plate's thickness as their length (a slotted or stepped shape, for instance).
  • This cuts through-holes with a plain sketch + extrude. For real mounting holes with proper counterbore/countersink and a hole callout in drawings, Fusion's dedicated HoleFeatures API is the production-correct tool — this script's approach is the simple version.
  • All dimensions are millimeters divided by 10 to match the Fusion API's internal centimeter unit — the same gotcha as the blog's toy plate, just applied to five numbers instead of three.
  • Hole positions are measured from the plate's own corner (0,0) — mirror or rotate them yourself if your plate isn't symmetric.

Goes deeper

Want this adapted to your shop — or built into a real tool?

Samples are the free 80%. The last 20% is the part I do for a living.

Get in touch
Home
Blog
Tools
Code
Email
LinkedIn
Résumé