Lisp Text2Mtext by Lee-Mac: With funtion keep origin location

Lisp Text2Mtext by Lee-Mac: With funtion keep origin location

Vuxvix
Advocate Advocate
1,246 Views
16 Replies
Message 1 of 17

Lisp Text2Mtext by Lee-Mac: With funtion keep origin location

Vuxvix
Advocate
Advocate

Hi!

Like title. Currently I am using this lisp to convert text to mtext.
The problem is that I need to specify a new position for "new mtext" from the selected multi-line "Dtext". I just want to keep the original position ( maybe follow firt line).

Also,to combine multiple Text into Mtext (based on limited distance), is it possible
Standard command: "Convert to Mtext" by Autocad; sometimes don't keep breakline.
Looking forward to getting help

0 Likes
Accepted solutions (1)
1,247 Views
16 Replies
Replies (16)
Message 2 of 17

komondormrex
Mentor
Mentor
Accepted solution

maybe that helps

 

 

0 Likes
Message 3 of 17

Vuxvix
Advocate
Advocate
hi!
Thanks for help, but something wrong with me.
load lisp with "error: malformed list on input. "

0 Likes
Message 4 of 17

komondormrex
Mentor
Mentor

your welcome. missed a bracket. updated.

0 Likes
Message 5 of 17

Vuxvix
Advocate
Advocate

I'm not sure if you tested lisp or not. But the above error is still there. I tried to check with visual lisp. looks like 1 more bracket is needed.
After that, lisp worked, but the result was not as expected. It creates a new mtext with a different size

0 Likes
Message 6 of 17

komondormrex
Mentor
Mentor

i thought i did, but seemed not thoroughly. check it now. attempt #3. 

0 Likes
Message 7 of 17

komondormrex
Mentor
Mentor

mystic is going in here. i attached lisp file.

Message 8 of 17

Vuxvix
Advocate
Advocate

Hi!
I tried with the sample file that I uploaded. Your lisp has random text breaks.
To solve the above problem i entered the value
defined Width ( and Height) of mtext to 0. Can you add or guide me to add this to lisp?

0 Likes
Message 9 of 17

komondormrex
Mentor
Mentor

i've updated the code with included setting of mtext width to 0 and also changing the method of gathering textstrings from dtexts (text_to_mtext (2)). you may try updated version or add line (vla-put-width Mtext_Object 0) right before (vlax-release-object Mtext_Object). that is close to the end of code.

Message 10 of 17

komondormrex
Mentor
Mentor

not that fast)

0 Likes
Message 11 of 17

Vuxvix
Advocate
Advocate

Thank you for taking the time to solve my problem。

0 Likes
Message 12 of 17

komondormrex
Mentor
Mentor

your welcome.

0 Likes
Message 13 of 17

Vuxvix
Advocate
Advocate
Hi!
Sorry for reaching out again. I have been frequently using your Lisp to edit recent drawings I received.
However, I am facing two issues and I hope you could assist me with them.
1- I am uncertain about the purpose of the 'Sort texts by Y' function button. Although it works fine with horizontal DTexts, when DTexts are placed vertically or at a custom angle, they rotate horizontally after the DTexts are combined.
2- I was wondering if it is possible to apply the selection from the previous use of 'Sort texts by Y' and not prompt for it again until I choose to change it?"
0 Likes
Message 14 of 17

komondormrex
Mentor
Mentor

hi!

well, it was originally supposed to combine horizontal texts, so the purpose of sorting by Y(.

i added remember for sorting by Y and also added for mtext to get rotation from first picked text, however all properties go to mtext from first picked text too.

updated lisp (2) goes above. 

Message 15 of 17

Vuxvix
Advocate
Advocate

I tested the updated lisp. When using lisp with vertical text. It will change their order. Attached file is an example。

0 Likes
Message 16 of 17

komondormrex
Mentor
Mentor

if dtext lines order in the drawing coincide with their appearance in dwg database and selection done with cw, for instance, then commented out line 85 will help, otherwise it won't. better solution in the latter case will be different method of selecting dtext lines.

Message 17 of 17

Vuxvix
Advocate
Advocate
thanks for information.
0 Likes