thomasa88 / ParametricText

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

Are new line breaks / carriage returns supported? #31

Closed edwardhorsford closed 2 years ago

edwardhorsford commented 2 years ago

I'm trying to insert a force line break / new line / carriage return as part of the dynamic text. I've tried \r and \n to no avail. Is it possible to do this?

thomasa88 commented 2 years ago

Hi @edwardhorsford . I have been pondering how to do this in a clean way. Right now, I went for {_.newline}.

What do you think?

Please try this beta release: https://github.com/thomasa88/ParametricText/releases/tag/v2.3.0-beta.1

image

edwardhorsford commented 2 years ago

Hi @thomasa88 - thank you for looking in to this.

I think what you're suggesting solves my direct need - though I wonder if it could be done more simply. Rather than the box being a text input, could it be a text area that supports users directly typing carriage returns / line breaks? The box could increase in height when this happens.

(I have no idea what Fusion360 lets plugins do so perhaps this isn't possible).

thomasa88 commented 2 years ago

Sorry for the late reply. My Fusion projects are in a bit of a slowdown currently.

A multiline edit sounds like a good solution, but I will put it in the redesign pile in #32 .

I think it should be solvable either using the new HTML controls support (HTML inside a dialog) or by having the actual entry be done below the table of parameters. A third alternative is a dialog fully created in HTML, but I think it requires more work (like was done in https://github.com/thomasa88/VerticalTimeline (abandoned)).

thomasa88 commented 2 years ago

Current implementation published as Release 2.3.0. https://github.com/thomasa88/ParametricText/releases/tag/v2.3.0 Should appear in the Autodesk store in a few weeks.

Nicer solution will be considered in #32 .

edwardhorsford commented 2 years ago

Thanks so much @thomasa88! Will look out for it.