def demo_extrudeFeaturesTwoSidesExtent_add(rootComp: adsk.fusion.Design.rootComponent): # Have the profile and body selected. profile = _ui.selectEntity('Select a profile', 'Profiles').entity body = _ui.selectEntity('Select body to extrude to', 'Bodies').entity # Create a ToEntityExtentDefinition to define how the extrude will go up to the body. offset = adsk.core.ValueInput.createByString("2 mm") isChained = True sideOne = adsk.fusion.ToEntityExtentDefinition.create(body, isChained, offset) # Create a DistanceExtentDefinition ot define how the extrude will go a specific distance. distance = adsk.core.ValueInput.createByString("5 mm") sideTwo = adsk.fusion.DistanceExtentDefinition.create(distance) # Create the extrude input with extents to two sides. extrudeFeatures = rootComp.features.extrudeFeatures operation = adsk.fusion.FeatureOperations.NewBodyFeatureOperation input = extrudeFeatures.createInput(profile, operation) input.setTwoSidesExtent(sideOne, sideTwo) # Create the extrude feature. extrudeFeature = extrudeFeatures.add(input)