MTEXT command line exit

MTEXT command line exit

nnguyenETKNW
Participant Participant
3,162 Views
5 Replies
Message 1 of 6

MTEXT command line exit

nnguyenETKNW
Participant
Participant

Hi everyone,

 

I'm wondering if it possible to close MTEXT without using the Enter key, Esc Key, CTRL+Enter or anything like that.

 

I'm pasting several ID values using MTEXTlines from excel, however when I paste the entire column the MTEXT fills up everything in the single MTEXT rather than end and create a new MTEXT.

 

For example the Excel cell would have: 

= "-mtext "&K2&","&L2&" "&M2&","&N2&" "&D2&""&E2&" "&A1&""&A2

 

Which then the command would look like:

-mtext x1,y1 x2,y2 NAME## ID##

 

But because I can't seem to end the MTEXT without the Enter Key the rest of the subsequent excel cells flood the first MTEXT.

 

Is there a way for me to get MTEXT to operate in the manner I'd like?

 

PS. same issue when using Concatenate

 

 

 

 

 

0 Likes
Accepted solutions (1)
3,163 Views
5 Replies
Replies (5)
Message 2 of 6

gotphish001
Advisor
Advisor

I'm not 100% on what you are asking because I don't use excel like that. I've only played around with that aspect a couple times. If you mouse click outside of the mtext it will close it too. Not sure if that is what you are after.



Nick DiPietro
Cad Manager/Monkey

0 Likes
Message 3 of 6

nnguyenETKNW
Participant
Participant

Thanks for the reply,

 

Mouse clicks won't do for my application.

 

I'll try to better explain what I'm doing.

 

Imagine if I had to make a large number of rectangles (all different sizes). The sizes are already listed in an excel file which I can manipulate to give me a bunch of command line codes to print all the rectangles on my screen (a few addition excel logic to have them evenly spaced).

 

The excel output would look something like this:

rectangle x1,y1 x2,y2

rectangle x3,y3 x4,y4

rectangle x5,y5 x6,y6

.

.

.

etc

 

I'm able to copy the entire column, paste it into the command line in ACAD and have a bunch of rectangles printed out.

 

Now I want to label each of these rectangle I just created, I can create a bunch of MTEXT commands the same way using the same excel BUT I need to be able to exit each MTEXT before entering the next.

 

Right now I would have to copy each line, paste, hit enter, then copy the next line, paste and hit enter etc.

 

I would like to be able to copy the entire column and paste once like I can with the rectangles.

 

Hope that helps.

 

0 Likes
Message 4 of 6

john.vellek
Alumni
Alumni

Hi @nnguyenETKNW,

 

I am curious if you could using DTEXT instead of MTEXT.  DTEXT should allow you to enter the label, confirm the data with and ENTER and then close with another ENTER.

 

YOu could even convert the text to Mtext after the fact using the Express Tool txt2mtxt

 

If this doesn't work, then I think you might be looking at the need to put this into a Lisp routine.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 5 of 6

leeminardi
Mentor
Mentor
Accepted solution

The following may seem a bit convoluted but it will work.  Since space characters do special things in AutoCAD and quote marks have special meaning in the Excel concatenate function, I've used the ASCII code char(32) for spaces and char(34) for quotes. Some streamlining may be possible,

 

Copy and paste column G2 down into the AutoCAD command line.

mt1.JPG

The full content of cell G2 is:

=CONCATENATE("(command ",CHAR(34),"-mtext",CHAR(34)," ",CHAR(34),A2,",",B2,CHAR(34),CHAR(32),CHAR(34),C2,",",D2,CHAR(34)," ",CHAR(34),E2,CHAR(34),CHAR(32),CHAR(34),CHAR(34),")")

You can fill G2 down for as many lines of text that you have.

mt2.JPG

 

lee.minardi
Message 6 of 6

nnguyenETKNW
Participant
Participant

That's the winner!

 

Convoluted is fine since it's in Excel. This was exactly what I needed to make it work, thank you so much!


Cheers,

0 Likes