I am writing a simple command, wish takes a profile and calls Extrude-with-Cut-boolean. For this the code I have written is:
def Execute(self, selectedProfile): if not isinstance(selectedProfile,adsk.fusion.Profile): return; app = adsk.core.Application.get(); doc = app.activeDocument d = doc.design rootComp = d.rootComponent extrudes = rootComp.features.extrudeFeatures extrudeInput = extrudes.createInput(selectedProfile, adsk.fusion.FeatureOperations.CutFeatureOperation) distance = adsk.core.ValueInput.createByReal(.5); extrudeInput.setDistanceExtent(False, distance); extrude = extrudes.add(extrudeInput)
But it fails saying that, 'No body to intersect/cut' was found. But I had drawn cut-profile-sketch on a face of a body. That body should have been the obvious choice to cut with the computed tool-body.
Interactively also it fails. After searching some posts here, it seems that its bit inconsistent. sometimes it works.
Any clues?
Solved! Go to Solution.
Solved by david_reaume. Go to Solution.
To perform a cut in the scenerio you're dealing with, you'll need a negative value for the distance. Choosing the cut operation does not automatically flip the positive direction of the extrude to point into the body to be cut.
So you should try:
distance = adsk.core.ValueInput.createByReal(-.5);
Happy Coding!
DaVeR
Can't find what you're looking for? Ask the community or share your knowledge.