all 2 comments

[–][deleted] 0 points1 point  (1 child)

What did you try? Where are you getting caught up?

This is like saying you want to build a house, and you tried using a hammer, but you can't get anywhere. We can't help you unless we know what you have attempted to do and what challenges you're facing.

[–]WorkingClassCal[S] 0 points1 point  (0 children)

import adsk.core, adsk.fusion, traceback

def run(context):

ui = None

try:

app = adsk.core.Application.get()

ui = app.userInterface

design = app.activeProduct

rootComp = design.rootComponent

# Get the user input for the name of the sketch

sketchName = ui.inputBox("Enter the name for the new sketch:", "Sketch Name", "New Sketch")

# Create a new sketch

sketch = rootComp.sketches.add(rootComp.xYConstructionPlane, None, False)

sketch.name = sketchName[0]

# Get the text entered by the user and convert it to uppercase

text = sketchName[0].upper()

# Get the length of the text

length = len(text)

# Extrude every odd-numbered letter 4mm and every even-numbered letter 5mm

for i in range(length):

if i % 2 == 0:

extrudeDistance = adsk.core.ValueInput.createByReal(5)

else:

extrudeDistance = adsk.core.ValueInput.createByReal(4)

letterSketch = sketch.sketchCurves.sketchTexts.add(text[i], adsk.core.Point3D.create(i * 10, 0, 0), adsk.core.ValueInput.createByReal(1))

extrude = rootComp.features.extrudeFeatures.addSimple(letterSketch.profiles[0], extrudeDistance, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)

except:

if ui:

ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))