many thanks for the quick answer - I really appreciate it!
In the meantime, I spend some more time on this issue and implemented your advice.
I created this test code with joined circles, in case anyone else needs an example to test their basic code.
Have a good weekend and best regards!
Test Code:
"""This file acts as the main module for this script."""
import traceback
import adsk.core
import adsk.fusion
# import adsk.cam
# Initialize the global variables for the Application and UserInterface objects.
app = adsk.core.Application.get()
ui = app.userInterface
def run(_context: str):
"""This function is called by Fusion when the script is run."""
try:
# Your code goes here.
doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
design = app.activeProduct
# Get the root component of the active design.
rootComp = design.rootComponent
# Create a new sketch on the xy plane.
sketches = rootComp.sketches
xyPlane = rootComp.xYConstructionPlane
sketch1 = sketches.add(xyPlane)
sketch2 = sketches.add(xyPlane)
sketch3 = sketches.add(xyPlane)
sketch4 = sketches.add(xyPlane)
# Circels in sketch.
circles_sketch1 = sketch1.sketchCurves.sketchCircles
circles_sketch2 = sketch2.sketchCurves.sketchCircles
circles_sketch3 = sketch3.sketchCurves.sketchCircles
circles_sketch4 = sketch4.sketchCurves.sketchCircles
circle1 = circles_sketch1.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), 10)
circle2 = circles_sketch2.addByCenterRadius(adsk.core.Point3D.create(10, 0, 0), 10)
circle3 = circles_sketch3.addByCenterRadius(adsk.core.Point3D.create(25, 0, 0), 10)
circle4 = circles_sketch4.addByCenterRadius(adsk.core.Point3D.create(0, 15, 0), 15)
t = 1
t_wall = 0.5
extrudeFeatures = rootComp.features.extrudeFeatures
distance = adsk.core.ValueInput.createByReal(t)
isFullLength = True
operation = adsk.fusion.FeatureOperations.NewBodyFeatureOperation
wallLocation = adsk.fusion.ThinExtrudeWallLocation.Center
wallThickness = adsk.core.ValueInput.createByReal(t_wall)
profile_part1 = sketch1.profiles.item(0)
profile_part2 = sketch2.profiles.item(0)
profile_part3 = sketch3.profiles.item(0)
profile_part4 = sketch4.profiles.item(0)
# Define the required input
input = extrudeFeatures.createInput(profile_part1, operation)
input.setThinExtrude(wallLocation, wallThickness)
input.setSymmetricExtent(distance, isFullLength)
extrudeFeatures.add(input)
input2 = extrudeFeatures.createInput(profile_part2, operation)
input2.setThinExtrude(wallLocation, wallThickness)
input2.setSymmetricExtent(distance, isFullLength)
extrudeFeatures.add(input2)
input3 = extrudeFeatures.createInput(profile_part3, operation)
input3.setThinExtrude(wallLocation, wallThickness)
input3.setSymmetricExtent(distance, isFullLength)
extrudeFeatures.add(input3)
input4 = extrudeFeatures.createInput(profile_part4, operation)
input4.setThinExtrude(wallLocation, wallThickness)
input4.setSymmetricExtent(distance, isFullLength)
extrudeFeatures.add(input4)
# Have the two bodies selected.
targetBody = rootComp.bRepBodies.item(0) # The first body is the part boundary
tools = adsk.core.ObjectCollection.create()
j = 1 # Start from the second body
while j <= rootComp.bRepBodies.count-2:
tools.add(rootComp.bRepBodies.item(j))
j += 1
# toolBody = rootComp.bRepBodies.item(1) # The body to subtract
# toolBody2 = rootComp.bRepBodies.item(2) # The body to subtract
# Define the required inputs and create te combine feature.
combineFeatures = rootComp.features.combineFeatures
input: adsk.fusion.CombineFeatureInput = combineFeatures.createInput(targetBody, tools)
input.isNewComponent = False
input.isKeepToolBodies = False
input.operation = 0
combineFeature = combineFeatures.add(input)
# Intersect the combined Voronoi body with the part boundary
combineFeatures = rootComp.features.combineFeatures
targetBody_boundary = rootComp.bRepBodies.item(0) # The first body is the part boundary
tools_boundary = adsk.core.ObjectCollection.create()
tools_boundary.add(rootComp.bRepBodies.item(1)) # Add the combined Voronoi body
input: adsk.fusion.CombineFeatureInput = combineFeatures.createInput(targetBody_boundary, tools_boundary)
input.isNewComponent = False
input.isKeepToolBodies = False
input.operation = 0
combineFeature = combineFeatures.add(input)
except: #pylint:disable=bare-except
# Write the error message to the TEXT COMMANDS window.
app.log(f'Failed:\n{traceback.format_exc()}')