Message 1 of 1
[Bug] Create a SketchText with negative angle returns "invalid input angle"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Here is an example that should create a text rotated by -90° in a sketch:
import adsk.core, traceback # pylint: disable=import-error
import math
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
design = app.activeProduct
rootComp = design.rootComponent
sketches = rootComp.sketches
xyPlane = rootComp.xYConstructionPlane
sketch = sketches.add(xyPlane)
sketchTexts = sketch.sketchTexts
sketchTextInput = sketchTexts.createInput('example', 1.0, adsk.core.Point3D.create(1.0, 1.0, 1.0))
sketchTextInput.angle = -math.pi / 2
sketchText = sketchTexts.add(sketchTextInput)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
The code fails by returning the error "invalid input angle".
The documentation of the angle property should also mention that the value must be in radian and not in degree.
This is not obvious because it's the opposite in the dialog in Fusion 360.
Thank you.
Jérôme Briot, Freelance engineer - Mechanical design and prototyping
3D Print Plus / Pro | IDF Import | GitHub To Fusion 360 | Tube Bending Data Exchanger | Slice Data Export
Memory Used | Basic Calculator | Check Computer Specifications | Import spline from any CSV file