I already tried that, but accessing the splitBodies and splittingTool always results in an exception. While debugging, the value of these variables is always unknown (more precise: the Traceback is shown) in the Variable-View. All other values are readable and changable.
Here is a snipped of my code, I created a SelectionInput and added a "Features" selection filter in the CreateEventHandler. This code here is in the InputChangedHandler:
app = adsk.core.Application.get()
ui = app.userInterface
inputs = adsk.core.CommandInputs.cast(eventArgs.firingEvent.sender.commandInputs)
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
changedInput = eventArgs.input
if changedInput.id == 'selection':
selection = adsk.core.SelectionCommandInput.cast(inputs.itemById("selection"))
if selection.selection(0).entity.classType() == adsk.fusion.SplitBodyFeature.classType():
splitFeature = adsk.fusion.SplitBodyFeature.cast(selection.selection(0).entity)
print(splitFeature.name)
print(splitFeature.attributes)
print(splitFeature.splittingTool.classType()) # this throws exception based on non-existance of splittingTool
print("Ended")
And while rechecking and writing this post, I found my problem!
To be able to read the variables, I have to roll back the Timeline before the Feature I want to check...
Thanks
EDIT:
The SplitBodyFeature simply can handle a SketchLine as input, would be nice to add that to the Documentation. If the SketchLine is connected to other SketchLines, they are automatically used as a single Object by passing one of the line segments to the Feature. Currently I try to understand how to use unconnected (but start and endpoint of each line touches, visually connected) SketchLines, hence this is also possible in the UI but I could not finde the difference. They look the same (meaning I found no difference till now) but do different things.