SketchText examples not working correctly, text height always 10mm

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to create text on a sketch using the API. The text gets created, but the height of the text always stays at 10mm. To recreate this issue just execute SketchText.py from the examples.
The SketchText.py example creates text using the following line:
#create the text input
sketchTextInput = sketchTexts.createInput2('Multiline Text', 1.5)
createInput2 is defined as followed:
def createInput2(self, formattedText, height):
"""
Creates a SketchTextInput object that is used to define the additional input to create text. The SketchTextInput object is equivalent to the Sketch Text dialog in that it collects all of the input required to create sketch text. You must call setAsFitOnPath, setAsAlongPath, or setAsMultiLine methods to define one of the three types of text and can use other and define any setAs Once the properties of the SketchTextInput object have been defined, use the add method to create the sketch text.
formattedText : The text used for the sketch text. This is a simple string as no additional formatting is currently supported.
height : The height of the text in centimeters.
Returns a SketchTextInput object that can be used to set additional formatting and is used as input to the add method.
"""
return SketchTextInput()
So the example should make the text 1.5cm high, which it does not do, the text is always 10mm high. I even tried to edit the text height after the SketchTextInput object is created. The SketchTextInput class has a height property which should be able to adjust the text height. I inserted the following line into the example:
sketchTextInput.height = 2.0
The text height did not change from 10mm. The text height can be edited manually in Fusion, but as I place hundreds of texts, doing so would be quite tortuous.
Am I doing anything wrong or is the height adjustment of text bugged in the API?
Is there a way to fix this locally on my machine prior to the release of a bugfix? I need that feature to work basically yesterday...