Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text in moved sketch does not update (RuntimeError: 2 : InternalValidationError) #61

Open
Andrew553328 opened this issue Feb 9, 2024 · 5 comments
Labels
bug Something isn't working upstream Problem in upstream project

Comments

@Andrew553328
Copy link

Hello Thomas :)

Describe the bug
Text does not update when moved off Z=0, dwg on xy plane

To Reproduce
Steps to reproduce the behavior:

  1. create any text on xy plane
  2. use Fx to create a parameter to change. I use the .comment
  3. use Tx to select the text
  4. you will find the text updates correctly
  5. HOWEVER, move the text to 5mm above the xy plane plane and update fails without error

My application is this:
I produce a set of planar parts from one parametric model, the parts are altered by a python script.
I only want one part to have a label.
As the parts are 3d printed the text is elevated to the part thickness as separate bodies ( enabling color change )

@Andrew553328 Andrew553328 added the bug Something isn't working label Feb 9, 2024
@thomasa88
Copy link
Owner

thomasa88 commented Feb 11, 2024

Reproduced in ParametricText 2.3.3.

  1. New document
  2. Create the parameter a' with the comment ccc`.
  3. Create a sketch with a text.
  4. Assign {a.comment} using "Change Text Parameters".
  5. Text is updated.
  6. Use "Move" command to move the sketch.
  7. Change the text parameter text to {a.comment}A
  8. Text is not updated.
  9. Error in console (Ctrl+Alt+C, Py mode, write 1):
Copy this message by taking a screenshot. Describe what you did to get this error or record a video.

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

Fusion 360 v. 2.0.18220
\\vboxsvr\thomas\my_src\fusion360\ParametricText\thomasa88lib\events.py failed: 

Traceback (most recent call last):
  File "//vboxsvr/thomas\my_src/fusion360/ParametricText\thomasa88lib\events.py", line 142, in catcher
    func(args)
  File "//vboxsvr/thomas/my_src/fusion360/ParametricText/ParametricText.py", line 631, in map_cmd_execute_handler
    save(cmd)
  File "//vboxsvr/thomas/my_src/fusion360/ParametricText/ParametricText.py", line 668, in save
    update_texts(texts=texts)
  File "//vboxsvr/thomas/my_src/fusion360/ParametricText/ParametricText.py", line 1333, in update_texts
    text_updated = set_sketch_text(sketch_text, evaluate_text(text, sketch_text, next_version))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "//vboxsvr/thomas/my_src/fusion360/ParametricText/ParametricText.py", line 728, in set_sketch_text
    sketch_text.text = text
    ^^^^^^^^^^^^^^^^
  File "/packages\adsk\fusion.py", line 86683, in _set_text
    return _fusion.SketchText__set_text(self, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : res

This looks like an internal Fusion error when trying to set the text 🤔.

Interesting that Fusion does not show the button to save the current placement of things.

The only workaround I can offer at the moment is that you don't move the sketch, but instead create it in the correct place from the start or offset any extrude made from it.

@thomasa88 thomasa88 added the upstream Problem in upstream project label Feb 11, 2024
@thomasa88 thomasa88 changed the title ParametricText Text in moved sketch does not update (RuntimeError: 2 : InternalValidationError) Feb 11, 2024
@Andrew553328
Copy link
Author

Andrew553328 commented Feb 11, 2024 via email

@Andrew553328
Copy link
Author

Hello Thomas :)

Im nearly there.
I successfully change the shape of a part via a python script
I can change text via fx using the mouse
when i change the text via script the entry in the fx table is changed but the text remains unchanged in the drawing.

parametrictext.py does not register fx changes by script ( is there a change flag inside the fx function ?)

Regards Andrew

@thomasa88
Copy link
Owner

thomasa88 commented Feb 14, 2024

Hi, I think you might to look at this: #54 (comment)

edit: Btw, if you are creating simple shapes OpenSCAD could be a good fit for your designs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Problem in upstream project
Projects
None yet
Development

No branches or pull requests

2 participants