Message 1 of 1
[Bug] Modify a sketchText with an empty string gives weird result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Here is a script that creates a sketchText object with an empty string (i.e. ''). Then it modifies the text inside the object.
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('', 1.0, adsk.core.Point3D.create(1.0, 1.0, 1.0))
sketchText = sketchTexts.add(sketchTextInput)
sketchText.text = 'example'
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Here is the result:
And when editing the sketch :
The height of the text should be 10mm but it is 38.344mm
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