Hi,
The error you get is because the object "texts" of type "SketchTexts" doesn't have a property "profile".
The outlines of the text is available on SketchText.asCurves() method.
Here there is an example of a extruded text:
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
rootComp = adsk.fusion.Design.cast(app.activeProduct).rootComponent
sketches = rootComp.sketches
sketch: adsk.fusion.Sketch = sketches.add(rootComp.xYConstructionPlane)
sketch.name = 'texts'
skTexts = sketch.sketchTexts
txtInput = skTexts.createInput2("Test", 2)
txtInput.setAsMultiLine(adsk.core.Point3D.create(0,0,0),
adsk.core.Point3D.create(4,10,0),
adsk.core.HorizontalAlignments.CenterHorizontalAlignment,
adsk.core.VerticalAlignments.MiddleVerticalAlignment,
10)
skText = skTexts.add(txtInput)
hg = adsk.core.ValueInput.createByString("5 mm")
efInput = rootComp.features.extrudeFeatures.createInput(skText, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
extHh = adsk.fusion.DistanceExtentDefinition.create(hg)
efInput.setOneSideExtent(extHh, adsk.fusion.ExtentDirections.PositiveExtentDirection)
extrudedText = rootComp.features.extrudeFeatures.add(efInput)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Hope this help.
Regards,
Jorge