AutoCAD/MTEXT routine

Advertisement


Question

MTEXT
Good day sir. My question is about mtext. I have attached a
screenshot of what i want to happen. these are labels of a
single line diagram of substations that i am currently
working on. I have to edit it one by one manually and there
are so many of them.

Is there a script or lisp to change the content in figure 1
(which is an mtext) to be like in figure 2? what i did was
edit the text (figure 1) and change it manually. The thing
is that i will do this for the rest of them (and its a 1000
or more)which is time consuming.

What i want sir is to have a script that when i click figure
1,  it automatically change to figure 2. is this possible?

In my point of view, its really hard (having no knowledge in
programming). I used google to find answers to my question
but unfortunately to no avail. So i look for forums and i
bump into this site. I hope that my querry will have a
positive result.

Thank you in advance sir and more power. God Bless.

Answer
Yes this is possible to do.  I would recommend using a block with two attributes for the replacment though.
I am here to help others write lisp code, not to write it for you. This is more work than I am available for as a volunteer. If you were to write it yourself, some of the functions you use would be entsel, entget, assoc, substr, and command which are available in the autolisp function reference. If you were to start reading about these you will see I have laid out some of the path for you.
    Questioner's Rating
    Rating(1-10)Knowledgeability = 10Clarity of Response = 10Politeness = 10
    Commentthanks for the preply sir. i will look into what you hae started for me to follow. thank you very much.


  • Add to this Answer
  • Ask a Question

Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.