Author Topic: Dynamic Align Text to Curve { with Reactors }  (Read 28803 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #15 on: November 16, 2009, 03:03:58 PM »
Thanks mate  :-)

I have updated the code in the first post to include your suggestion - you will find the setting just underneath the header text.

I have also fixed a few more bugs - particularly those occuring when you trying to undo the updated text alignment - this version should be slightly more stable.

Enjoy,

Lee

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #16 on: November 16, 2009, 03:30:34 PM »
Thank you for that, I do have a few more suggestions, if I have the time today I might try to tackle them:
  • Being able to insert more than one instance of the text item without having to restart the command (on the same object)
  • Related to the feature above: Being able to type something like C for change object to select a new object
  • Also related: Being able to type something like T to select or type new text to use without needing to restart the command

We quite often will go through and add all of our text at once, so these items would make the workflow much faster for us, just a thought.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #17 on: November 16, 2009, 03:38:08 PM »
Some nice ideas, thanks :-)

But this would mean a restructure of the whole first section of the program - only for the gain of not having to repeat the command (right click on my CAD), and I have already incorporated the default text that will remember the last entered text (which does improve workflow slightly)... but if I have time after incorporating the other ideas I have in mind for this program, I may consider it.

Thanks for the suggestions and comments, I appreciate it and am glad you like the program.

Lee

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #18 on: November 16, 2009, 08:01:35 PM »
Ok, a quick update to Version 1.6, this version should work in all UCS  ;-)

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #19 on: November 16, 2009, 08:03:07 PM »
Ok, after a bit of working on it, I got it, you can insert multiple pieces of text, you can also select a new curve by pressing N when inserting text and you can type or select new text by pressing T while inserting text.

It seems to all work fairly well, but I am sure there are better ways to do this.

I change the command name to IT, because I am changing the behavior of the function and some authors prefer that and also to prevent a version conflict. Lee, please feel free to change it back or to ask me to if you want, I just don't want to cause anyone any offense. As I said before, this is our preferred workflow here, so getting it working this way was something that made sense for us.

Please note that mine was based off of version 1.5, as 1.6 was posted while I was typing this, so it may not work in all UCS.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #20 on: November 16, 2009, 08:09:09 PM »
Chris,

Feel free to modify my code to suit your needs - it is freeware after all. But I do thank you for changing the filename to prevent clashes with users expecting different results.

I haven't perused your code in great detail, but it looks like you have made my text/curve selections sub functions and call them through the main GrRead loop. I personally don't like to use "flags" to exit loops, but that is just my personal peference, and I'm sure others will differ.

Glad you could make use of it,

Lee

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #21 on: November 17, 2009, 10:58:02 AM »
Yeah, I agree, it was just the fast way to get it up and running for my users, they love the idea of having the text move when our linework changes. I am going to continue to work on it to make it better and more stable, as well as incorporate your latest version of course. Any suggestions for improvement on the code are more than welcome of course, as I said, you know a great deal more than I do about LISP.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #22 on: November 17, 2009, 11:28:50 AM »
Thanks Chris -

I do have a few ideas that I am working on, and there is a major bug that I will have to fix - which will mean a restructure of the xData.

But I shall work on it later tonight  :-)

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #23 on: November 17, 2009, 03:05:24 PM »
I am curious, what is the major bug? I haven't come across it yet I suppose, but I would like to know, so that if it might impact my users I can tell them.

Also, I have incorporated the code that works with any ucs, as well as added these features that I needed to the code that I posted earlier:
  • Being able to set the layer that you want the text to be drawn on, you can optionally use the object's layer name and append on to it. (And most of the common related settings)
  • Being able to set the text style that you want to use (and most of the common related settings)
  • Being able to set the text height that you want to use
  • Being able to set Annotative text
  • Will restore the text height and size when finished
I also cleaned up my code a bit, although I do still use the loop with a flag, as I am not quite sure how else to accomplish the same effect at the moment. And of course, feel free to use or modify any of the code that you might want, all I ask is credit in the remarks as appropriate.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #24 on: November 17, 2009, 03:25:55 PM »
The major bug is the fact that if two different Text objects are aligned with varying offset/perpendicularity, when updated, they will be aligned to the last used offset/perpendicularity setting.

I have been working on the code though, and will post the update soon (I also have another thing to add first)  ;-)

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #25 on: November 17, 2009, 03:36:53 PM »
Ok, that explains why I haven't seen it, in general our text will be drawn with a 0 offset and not perpendicular, but it is nice to have the option when needed.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #26 on: November 17, 2009, 03:44:53 PM »
I have updated the code in the first post to include a "logo", when using the DTRemove function - showing the user which text/objects are aligned  8-)



Enjoy!

Lee

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #27 on: November 17, 2009, 05:01:43 PM »
Ok, I think this is close to being completely clean of bugs - I have updated the code in the first post to Version 1.8.

This Version will now correctly re-align text when objects are updated - using the perpendicularity and offset distance that the user originally specified.

Please Note:-
All text that has been aligned using previous Versions of this program will need to be re-aligned, use DTRemove, then DTCurve to re-align the text. This is due to a re-structuring of the xData stored in the object.


Let me know if you find any further bugs  8-)

Lee

cmwade77

  • Swamp Rat
  • Posts: 1206
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #28 on: November 17, 2009, 06:11:57 PM »
O.k., I found a bug that hopefully has a fairly simple fix, the text on vertical lines faces the wrong direction. (See attached screen shot) The text should be rotated 180 degrees.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Dynamic Align Text to Curve { with Reactors }
« Reply #29 on: November 17, 2009, 06:18:54 PM »
Ahh, this bug only occurs when the text is aligned with zero offset, hence no definite normal vector to determine the orientation of the text - I shall look into it  :-)