@Anonymous @goyals
I can confirm Antoine's assessment. You have only fixed the graphical bug. The original bug in this forum thread has not been fixed.
In fact, no property on a SketchText is settable if the font is an SHX font. Please see the attached video demonstrating this.
I have also attached the Design file that I used.
Fusion 360 2.0.9313
Active Plan: Fusion 360, Personal
Windows 10 (18363)
import adsk; app = adsk.core.Application.get(); text = app.activeProduct.rootComponent.sketches[0].sketchTexts[0]
text.text
TEXT
# Cannot change *ANY* property of the SketchText object
text.fontName = 'Arial'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/Thomas/AppData/Local/Autodesk/webdeploy/production/ca426f89300c9832c554fb1598dc1364864ea03e/Api/Python/packages\adsk\fusion.py", line 59183, in _set_fontName
return _fusion.SketchText__set_fontName(self, value)
RuntimeError: 3 : invalid input font name
text.text = 'new text'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/Thomas/AppData/Local/Autodesk/webdeploy/production/ca426f89300c9832c554fb1598dc1364864ea03e/Api/Python/packages\adsk\fusion.py", line 59161, in _set_text
return _fusion.SketchText__set_text(self, value)
RuntimeError: 3 : invalid input font name
text.isVerticalFlip = True
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/Thomas/AppData/Local/Autodesk/webdeploy/production/ca426f89300c9832c554fb1598dc1364864ea03e/Api/Python/packages\adsk\fusion.py", line 59244, in _set_isVerticalFlip
return _fusion.SketchText__set_isVerticalFlip(self, value)
RuntimeError: 3 : invalid input font name
text.textStyle = adsk.fusion.TextStyles.TextStyleBold
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/Thomas/AppData/Local/Autodesk/webdeploy/production/ca426f89300c9832c554fb1598dc1364864ea03e/Api/Python/packages\adsk\fusion.py", line 59205, in _set_textStyle
return _fusion.SketchText__set_textStyle(self, value)
RuntimeError: 3 : invalid input font name
text.height = 2.0
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/Thomas/AppData/Local/Autodesk/webdeploy/production/ca426f89300c9832c554fb1598dc1364864ea03e/Api/Python/packages\adsk\fusion.py", line 59153, in _set_height
return _fusion.SketchText__set_height(self, value)
RuntimeError: 3 : invalid input font name
# text.position can not be accessed at all, but that is another bug. Seems to be the same problem with .angle.
# https://forums.autodesk.com/t5/fusion-360-api-and-scripts/bug-sketchtext-position-gt-internalvalidationerror-fusiontext/td-p/9836589
# Internal ticket: FUS-74257