Author Topic: Upgraded Text 2 MText  (Read 22669 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Upgraded Text 2 MText
« on: September 27, 2009, 02:20:28 PM »
Text-2-MText Upgraded
Version 2.0




Program will allow the user to amalgamate several separate DTEXT & MTEXT entities into a single MTEXT entity, with all formatting kept in tact.

Text will take on the layer of the first text entity chosen (as in the txt2mtxt.lsp), but will keep its colour if not set to BYLAYER.

There are two modes: "Same Line" "New Line", which can be switched by pressing space between selections.

Shift-Clicking on Text will keep the original Text in place, and pressing "u" between selections will undo the previous selections.

Example:




Your thoughts are welcome  :-)

Code updated to Version 2.0

Code available here.
« Last Edit: November 14, 2010, 08:09:46 PM by Lee Mac »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Upgraded Text 2 MText
« Reply #1 on: September 27, 2009, 03:46:12 PM »
Interesting but no use for me in my environment.
I've reached the age where the happy hour is a nap. (ฐฟฐ)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #2 on: September 27, 2009, 04:16:08 PM »
Interesting but no use for me in my environment.

I wasn't sure how many people really use the txt2mtxt function, I just thought I'd toy with the idea as it suddenly came to me when I was playing around with your new toy  :-)

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #3 on: September 27, 2009, 05:50:34 PM »
I have updated the first post, you can switch modes by pressing space during text selection  :-)

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Upgraded Text 2 MText
« Reply #4 on: September 27, 2009, 08:16:16 PM »
wow ! Lee !!  I can't beleive it..

That was one of my project list !! OMG..
But you did better than i was thinking of..

Nice one !!

Yes, Me and some user here are interested about it. this will be very useful here.

Thanks for sharing. :-)
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #5 on: September 28, 2009, 05:04:18 AM »
wow ! Lee !!  I can't beleive it..

That was one of my project list !! OMG..
But you did better than i was thinking of..

Nice one !!

Yes, Me and some user here are interested about it. this will be very useful here.

Thanks for sharing. :-)

I thought that might be coming... we seem to come up with the same ideas quite frequently...   :wink:

Thanks Andrea  :-)

mkweaver

  • Bull Frog
  • Posts: 352
Re: Upgraded Text 2 MText
« Reply #6 on: September 29, 2009, 07:23:41 AM »
Just a preview of what I am working on currently - wasn't sure if it was worth continuing with...

(snippage)

Your thoughts are welcome  :-)

I can certainly use this.  Thanks for sharing!

Mike

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #7 on: September 29, 2009, 11:51:14 AM »
I can certainly use this.  Thanks for sharing!
Same here for me.  Thanks.

Two questions. 
One; could this be made to work on MText as well as Dtext?   I have a bunch of users that places little pieces of Mtext (objects)  :pissed: instead of placing all of them in one Mtext object.  It would save the step of exploding the objects to Dtext.

And two; what format code are using for "hard character return"?   When viewed in properties pallet it shows up as squares instead of "\P". 
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #8 on: September 29, 2009, 01:59:10 PM »
Just a preview of what I am working on currently - wasn't sure if it was worth continuing with...

(snippage)

Your thoughts are welcome  :-)

I can certainly use this.  Thanks for sharing!

Mike

Thanks Mike, not a problem  :-)

I can certainly use this.  Thanks for sharing!
Same here for me.  Thanks.

Two questions. 
One; could this be made to work on MText as well as Dtext?   I have a bunch of users that places little pieces of Mtext (objects)  :pissed: instead of placing all of them in one Mtext object.  It would save the step of exploding the objects to Dtext.

And two; what format code are using for "hard character return"?   When viewed in properties pallet it shows up as squares instead of "\P". 

One: You should be able to use it to amalgamate MTEXT & DTEXT into a single MTEXT entity, with all the formatting in tact  :wink:

Two: I use "\n" for the new line, but I shall look into "\P" instead.

Thanks Mr Krush :-)

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Upgraded Text 2 MText
« Reply #9 on: September 29, 2009, 02:06:38 PM »
One: You should be able to use it to amalgamate MTEXT & DTEXT into a single MTEXT entity, with all the formatting in tact  :wink:

*Matt runs off to Google "amalgamate"...* 
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #10 on: September 29, 2009, 02:22:16 PM »
One: You should be able to use it to amalgamate MTEXT & DTEXT into a single MTEXT entity, with all the formatting in tact  :wink:

*Matt runs off to Google "amalgamate"...* 
+ :-)
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #11 on: September 29, 2009, 02:24:52 PM »
 :-)  :-)

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #12 on: September 29, 2009, 02:43:18 PM »
One; could this be made to work on MText as well as Dtext?   I have a bunch of users that places little pieces of Mtext (objects)  :pissed: instead of placing all of them in one Mtext object.  It would save the step of exploding the objects to Dtext.
One: You should be able to use it to amalgamate MTEXT & DTEXT into a single MTEXT entity, with all the formatting in tact  :wink:

Returns the following at the command line when I go to select the second Mtext Object when in "NewLine" Mode.
Code: [Select]
Command: T2M
Initializing...
๘คบฐ`ฐบค๘  Text2MText2.lsp ~ Copyright ฉ by Lee McDonnell  ๘คบฐ`ฐบค๘
   ~ค~              ...Type "T2M" to Invoke...                ~ค~
Select Text:
๘๘ Current Mode: New Line ๘๘; error: An error has occurred inside the *error*
functionAutomation Error. Object was erased
Command:

I tried to watch it and see where it was breaking with the debug tools but the vlisp editor is always whited out. 
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #13 on: September 29, 2009, 03:30:12 PM »
I shall investigate Krushert - thanks for the feedback mate  :wink:

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #14 on: September 29, 2009, 03:43:17 PM »
Krushert,

I haven't been able to replicate your error when testing - but I have updated the code to make it slightly more robust - it may not fix the issue, but it should make the error more transparent.  :wink:

Lee

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #15 on: September 29, 2009, 04:13:53 PM »
Krushert,

I haven't been able to replicate your error when testing - but I have updated the code to make it slightly more robust - it may not fix the issue, but it should make the error more transparent.  :wink:

Lee
I shall test it again.  BRB
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #16 on: September 29, 2009, 04:33:49 PM »
Okay it works on MText ... If the Mtext is TopLeft justified.  Before I was selecting mtext with middle center justification and when selected, it error-ed on the third object selected.

Code: [Select]
Command: T2M

Select Text:
๘๘ Current Mode: New Line  ๘๘  [Space to Change]
** Error: Automation Error. [b]Object was erased [/b]**
Command:
Command:

Second thing, When error-ing, it did not erased the object that it created (I don't know if it is or is not supposed to erase but your error message says object erased.   :|)  And When error-ing, it creates a repeat of the text selected with in the object.   :|




I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #17 on: September 29, 2009, 04:39:00 PM »
Ahhh gotcha  8-)

I know what is happening  :evil:

Will be back with a bug fix shortly  :-)

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #18 on: September 29, 2009, 05:31:32 PM »
I have updated the code to Version 1.2, hopefully this resolves the alignment issues. I have also added code to keep the Text Height in tact - I get the feeling I am waging war on MText Formatting codes as far as keeping the formatting goes...  :|

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Upgraded Text 2 MText
« Reply #19 on: September 30, 2009, 12:43:21 AM »
What kind of text object is the "Hello, my name is:" one in the second gif?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #20 on: September 30, 2009, 07:47:17 AM »
What kind of text object is the "Hello, my name is:" one in the second gif?

MTEXT  :-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Upgraded Text 2 MText
« Reply #21 on: September 30, 2009, 08:27:59 AM »
What kind of text object is the "Hello, my name is:" one in the second gif?

MTEXT  :-)

The grips are quite different, is that what 2010 MText grips look like?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #22 on: September 30, 2009, 08:45:39 AM »
What kind of text object is the "Hello, my name is:" one in the second gif?

MTEXT  :-)

The grips are quite different, is that what 2010 MText grips look like?

Yup  :-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Upgraded Text 2 MText
« Reply #23 on: September 30, 2009, 08:48:09 AM »
What kind of text object is the "Hello, my name is:" one in the second gif?

MTEXT  :-)

The grips are quite different, is that what 2010 MText grips look like?

Yup  :-)
Wild. Ok, just wondering.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #24 on: September 30, 2009, 08:51:22 AM »
The "arrow" grips are so that you can quickly adjust the height and width of the text box - the arc also has the arrow grips, so you can adjust the radius and angle swept by the arc  :wink:

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #25 on: September 30, 2009, 10:11:01 AM »
I have updated the code to Version 1.2, hopefully this resolves the alignment issues. I have also added code to keep the Text Height in tact -

Works like a charm.  You keep producing this kind of stuff, I am going to have to create a folder in my lisp with your name on it and place it next to CAB's

I get the feeling I am waging war on MText Formatting codes as far as keeping the formatting goes...  :|
I would agree with that.  The few times I messed with text objects in my lisp, my exploded in size just to handle something that behind the scenes to the user.  But then again my code is big to begin with becuase I write with my kid's crayons. 

Thanks again for this nugget of gold.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Upgraded Text 2 MText
« Reply #26 on: September 30, 2009, 11:09:39 AM »
The "arrow" grips are so that you can quickly adjust the height and width of the text box - the arc also has the arrow grips, so you can adjust the radius and angle swept by the arc  :wink:
Nice new addition in 2010. It looked like a dynamic block, that's why I was confused.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #27 on: September 30, 2009, 11:43:02 AM »
Works like a charm.  You keep producing this kind of stuff, I am going to have to create a folder in my lisp with your name on it and place it next to CAB's

Excellent - thanks Krushert :-)

I think I have a folder of CAB's with a few sub-routines that I use in it... he gets onto all our computers  ;-)

I get the feeling I am waging war on MText Formatting codes as far as keeping the formatting goes...  :|
I would agree with that.  The few times I messed with text objects in my lisp, my exploded in size just to handle something that behind the scenes to the user.  But then again my code is big to begin with becuase I write with my kid's crayons. 

Thanks again for this nugget of gold.

I have seen the lengths that people such as Joe Burke and Tim Willey will go to to accomodate the codes in text explosions, and unformatting - but I just wish that MText used a different method to save its formatting and not mix it with the actual Text String that it contains...  :|


The "arrow" grips are so that you can quickly adjust the height and width of the text box - the arc also has the arrow grips, so you can adjust the radius and angle swept by the arc  :wink:
Nice new addition in 2010. It looked like a dynamic block, that's why I was confused.

I wasn't sure how many versions had that addition - having gone straight from ACAD 2004 to 2010 when I became a student, but I must admit, it is a great new feature they have added.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Upgraded Text 2 MText
« Reply #28 on: September 30, 2009, 05:55:38 PM »
just an idea suggestion....

maybe add a feature to allow user to Leave a copy of the selected text (maybe by pressing Shift Key)  ?
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #29 on: September 30, 2009, 06:21:34 PM »
just an idea suggestion....

maybe add a feature to allow user to Leave a copy of the selected text (maybe by pressing Shift Key)  ?

Nice idea Andrea, and not too difficult to incorporate also - what does everyone else think about this as an addition?

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Upgraded Text 2 MText
« Reply #30 on: September 30, 2009, 07:44:01 PM »
just an idea suggestion....

maybe add a feature to allow user to Leave a copy of the selected text (maybe by pressing Shift Key)  ?

Nice idea Andrea, and not too difficult to incorporate also - what does everyone else think about this as an addition?
One Yay from Me
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #31 on: October 01, 2009, 05:57:35 AM »
One Yay is enough for me   :wink:

First post updated to Version 1.3  :-)

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #32 on: October 01, 2009, 07:22:43 AM »
I got a bit carried away...  :-D

First post now updated to Version 1.4, with much needed bug fixes, and also the ability to Undo previous selections by pressing "u"  :-)

Aerdvark

  • Guest
Re: Upgraded Text 2 MText
« Reply #33 on: October 01, 2009, 07:56:34 AM »
Well Lee,

This one is great again.

Besides the use or function it must be said that it has a cool look HOW it works. The way it ads up the text is very charming.

Very good job indeed !!

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #34 on: October 01, 2009, 08:07:43 AM »
Thanks Marco  :-)

I'm glad you like it  :wink:

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #35 on: April 16, 2010, 06:01:11 AM »
After a few updates over at CADTutor regarding this program, I have updated the code to Version 1.7, changes noted.  :-)

Hangman

  • Swamp Rat
  • Posts: 566
Re: Upgraded Text 2 MText
« Reply #36 on: April 16, 2010, 12:54:56 PM »
HOLY COW !!
I am impressed !!
It'll take me ...  oh, the rest of my life to even come relatively close to this kind of programming (relative to the UNIVERSE).
Well Thank You Lee.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #37 on: April 16, 2010, 01:48:31 PM »
Thanks Hangman, I'm glad you like it  :-)

ljh19991220

  • Guest
Re: Upgraded Text 2 MText
« Reply #38 on: June 14, 2010, 01:10:35 AM »
Thanks for sharing :-D

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Upgraded Text 2 MText
« Reply #39 on: June 14, 2010, 03:21:14 AM »
Thanks for sharing :-D

You're welcome  :-)