thomasa88 / ParametricText

Fusion 360™ add-in for creating Text Parameters in sketches.
MIT License
75 stars 5 forks source link

Text disappears when updated by ParametricText #24

Closed thomasa88 closed 1 year ago

thomasa88 commented 3 years ago

Describe the bug Text parameter disappears when ParametricText updates it. The sketch is there but the text seems to have zero size.

To Reproduce Steps to reproduce the behavior:

  1. Open attached file
  2. Make the parametric text update: change value or save to make a new version
  3. The version text inside the cap disappears.

Expected behavior Text should update the value. Size should remain the same.

Screenshots Before: image After: image

Software

negative_height_bug.zip

thomasa88 commented 3 years ago

It turns out that the Text1-Height parameter is negative: image

The value should be 8 mm!

The text height workaround triggers this error when trying to write back the height after testing for presence of the bug. The same would happen if it tried to restore the height of a modified text:

ParametricText v 2.2.0-beta.1 error: 3 : invalid input height

Copy this message by taking a screenshot. Describe what you did to get this error or record a video.

--------------------------------------------------

Fusion 360 v. 2.0.10253
H:\my_src\fusion360\ParametricText\thomasa88lib\events.py failed: 

Traceback (most recent call last):
  File "H:/my_src/fusion360/ParametricText\thomasa88lib\events.py", line 142, in catcher
    func(args)
  File "H:/my_src/fusion360/ParametricText/ParametricText.py", line 1352, in update_cmd_execute_handler
    update_texts(*async_update_queue_.get())
  File "H:/my_src/fusion360/ParametricText/ParametricText.py", line 1312, in update_texts
    text_updated = set_sketch_text(sketch_text, evaluate_text(text, sketch_text, next_version))
  File "H:/my_src/fusion360/ParametricText/ParametricText.py", line 717, in set_sketch_text
    sketch_text.text = text
  File "/packages\adsk\fusion.py", line 62798, in _set_text
    return _fusion.SketchText__set_text(self, value)
RuntimeError: 3 : invalid input height

Workaround: Edit the sketch text manually to correct the parameter. Nothing needs to be done. Just Edit the text, confirm that the height is correct and press Ok.