Not my area of expertise but as no-one else is replying.
I think this is a task for API fusion...
Now my coding is very off but based off what I've learned through coding over the years from school is something like:
Attempt 30/06/2025
import adsk.core, adsk.fusion, traceback
def run(context):
app = adsk.core.Application.get()
ui = app.userInterface
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
viewport = app.activeViewport
# Create section analysis on front (XZ) plane
plane = root.xZConstructionPlane
section = design.analysisManager.sectionAnalyses.add(
design.analysisManager.sectionAnalyses.createInput(plane))
# Settings
folder = 'C:/Temp/' # Make sure this folder exists (Here you actually need to make a folder called this... or a folder of your chopice but the C;/temp would need to be smth else in that case.)
steps = 50 # Number of images
move = 1.0 # Distance between slices
for i in range(steps):
# Move section forward
t = adsk.core.Matrix3D.create()
t.translation = adsk.core.Vector3D.create(0, 0, i * move)
section.transform = t
# Save image
filename = f'{folder}slice_{i:03d}.png'
viewport.saveAsImageFile(filename, 1280, 720)
ui.messageBox('✅ Done! All images saved.')
Now everything I've written above is very tempermental, and say miraculously it all works, because I don't even know if I've imported all the right Fusion files needed for this as this is only 10 minutes of research and if I was seriously making a code like this for API I would spend a lot longer to find which FUSION API's need to be imported in for this specific task... and say you got this to work. you need a good computer for this to work as it's taking a lot of scs at once
at the point where it says in range(steps) as the in range will keep repeating whatever value steps is. So if your computer isn't great trhen I would advice you trialing and erroring till you find your computer's limit starting with 3 scs.
smth like this for example:
Attempt 02/07/2025
def run(context):
app = adsk.core.Application.get()
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
view = app.activeViewport
section = design.analysisManager.sectionAnalyses.add(
design.analysisManager.sectionAnalyses.createInput(root.xZConstructionPlane))
for i in range(3):
mat = adsk.core.Matrix3D.create()
mat.translation = adsk.core.Vector3D.create(0, 0, i * 5)
section.transform = mat
view.saveAsImageFile(f'C:/Temp/mini_{i}.png', 800, 600)
I just want to say this, if you do work API, I can only advice for Python all those other scripts in the API section like java script, I couldn't help you there srry, I don't know the first thing about Java, only python.
I hope it helps, I just want to say trust the second piece of code more as I had help making this. While this isn't really what I specialise in as I work more with modelling and simulation tests and electrics, I hoped it helped!
Sleepy regards
Ricky