StripMtext v5.0

StripMtext v5 Copyright© Steve Doman and Joe Burke 2010

StripMtext is an AutoLISP program that runs inside AutoCAD 2000 and above and enables the AutoCAD user to quickly remove unwanted Mtext formatting embedded in Mtext, Mleaders, Dimensions, Tables, and Multiline Attributes.

Below are a few screen demonstrations of StripMtext in action.  Thanks to Lee Mac for making the demos.

Download StripMtext v5.0c
AutoCAD for Mac users: Sorry but StripMtext can not run on Mac systems.

If you cant see image, right click and follow link

Please right click here and follow link

Please right click here and follow link

Please right click here and follow link

About these ads

33 thoughts on “StripMtext v5.0

  1. Pingback: MText – Back to Basics | Dirt Modelers

  2. Hi,
    I work at a consulting firm and we use MS Visio to draw our single line schematics and then saveas to dwg and import them into our CAD drawings. The only downside to this is that all of the mtext has overrides on color and height. So I’m trying to use your lisp routine and it’s not working :-s
    Most of the mtext contents will look somehting like \C7;\H.063321545;TEXT . There is one piece of mtext that the routine does work on however and the only difference on the contents is that this piece is surrounded by { } brackets for some reason.
    Is there something that I am doing wrong? Are those brackets always supposed to be there? PLS help :)
    -Jason

    • Hi Jason,

      Thanks for the message. I’m am always interested in fixing any problem user’s experience using StripMtext. I assume you are familiar with using AutoCAD commands and have viewed the demo on this blog for instruction on how to use StripMtext.

      The curly brackets are Mtext formatting characters which group a block of text which formatting is applied. They are very common and probably supposed to be there.

      StripMtext works by searching and removing specific formatting codes per AutoCAD’s Mtext formatting rules. My guess is that when Visio converts the file into DWG, the formatting codes Visio is using are not strictly following AutoCAD’s rules. However, if AutoCAD is rendering the formatting okay, then there may be some undocumented formatting syntax which I am unaware of.

      They best way for me to help is to run some test on a drawing created by Visio that contains Mtext. Please send a DWG to the email address shown on my about page. I can’t promise a quick fix. But I’ll do my best to help.

      Thanks,
      Steve

  3. Sorry to say that but StripMtext v5.0b just doesn’t work with Autocad 2000 (Polish version). When I say work, I think that all functions and procedures works according to author ideas. I have Acad2000 Polish version with full express tools. Whenever I try to run by “smt” or “stripmtext” I get error about bad string in ssget.
    I tried it on trial version Acad 2006 (full functionality, polish language version) and got this error too. Under 2006 I workaround the problem preparing own lsp script and trying to run SMT in script mode. It was for short while so I did only what I needed, and I didn’t dig in it to solve the problem completely. But I still only a beginner in lisp language.
    After some examinations I found that line: (if (and (setq ss (ssget “:L” ssfilter) … is sth that my Acad2000 can’t swallow. In help there is no info about “:L” switch.
    After removed “:L” it started to work but I don’t know if it is working according to author idea. Is it possible to make this script to fully work with 2000?
    Best regards.

  4. thank you so much for your tool

    I am still a dinosaur using r2000, but having to interface with others using much more recent versions. your tool has helped me with funny mtext formatting from other’s files.

  5. Pingback: ACAD: Убираем лишнее форматирование текста | Блог «НПО Прометей»

    • Спасибо, что написали ваш блог статью, чтобы помочь пользователям AutoCAD узнать о StripMtext.
      -Стив

      Thank you for writing your blog article to help AutoCAD users learn about StripMtext.
      -Steve

  6. Hello,
    I have downloaded this program because it is a great need for me but when i go to use it this comes up:

    stripMtext error: cannot load dcl file “stripmtext[3].dcl”

    I am using AutoCAD Architecture 2011….does your program work for this version? If so, is there anyway I can fix this error?

    • Hi Eeb Stder,

      You are using a very old version. I recommend downloading the latest version available by clicking on the link way above that says: “Download StripMtext v5.0c”.

  7. I have used StripMtext for many years and it has been very helpful. I recently received a DWG file that I believe came from Visio and StripMtext5.0c is not able to remove all of the formatting from the text. The text height formatting persists after running the lsp. Any thoughts?

    -Ethan

    • Hi Ethan,

      Thanks for the report. Please send a small sample drawing showing before and after resuls. I will do some testing as soon as possible. My email address is shown on the “about” page.

      Steve Doman

  8. Hi, I’ve downloaded the lsp file and loaded it via appload yet StripMText is not a command in my Autocad drawing. The appload status bar says that the lsp was loaded successfully. I am running Auto cad 2013 on a mac but am admittedly inexperienced in Autocad and primarily use Rhino.

    Any ideas on why the command is not available?

    Thank you for your time,

    Jackson

    • Hi Jackson,

      The reason the command is not available is because StripMtext is coded in VisualLisp and utilizes Windows specific functions, which are not available in AutoCAD for Mac.

      It might be possible to create a new Mac version of StripMtext, but since I have neither a Mac or AutoCAD for Mac, I am able to even try.

      There are other ways to remove Mtext formatting. AutoCAD has a method to remove formatting, albeit one mtext object at a time. Open the Mtext object in the Mtext Editor. Select all of the text in the editor, then right click and a menu will pop up with an option to remove formatting. This works for AutoCAD for Windows. Not sure about the Mac version.

      Thanks for the question. I’m sure other Mac users will appreciate this information. And I’m sorry for the really late reply. Been offline.

      Steve

  9. Hello,

    From what I’ve read this lsp file seems like it is exactly what I need. I have downloaded and loaded it into AutoCAD MEP 2013. When I call the “stripmtext” command, I am able to select the objects, but then the following message appears:

    Error in dialog file
    “C:\Users\MMOSBA~1\AppData\Local\Temp\SMT005.tmp”, line 2:
    warning: redefining object.
    Symbol: “stripmtext”.

    After clicking OK, the following message appears

    Error in dialog file
    “C:\Users\MMOSBA~1\AppData\Local\Temp\SMT005.tmp”, line 2:
    syntax error.
    Symbol: “stripmtext”.

    And then after clicking OK one more time, the following message appears:

    StripMText Error:
    Cannot load DCL file:
    C:\Users\MMOSBA~1\AppData\Local\Temp\SMT005.tmp

    The “SMT005″ changes each time I try the command (ie – next time I try, it will be SMT006).

    Any help you may be able to offer is greatly appreciated.

    Best regards,
    Michael

    • Hi Michael,

      The SMT###.tmp files are temporary files that the StripMtext program creates each time the program is invoked. The temporary file contains code to draw a dialog box on the screen for the user to enter options. In StripMtext, this dialog displays format removal options. When StripMtext ends, it deletes the temporary file.

      I suspect that for some reason this temporary file has failed to be created. But it might be something else. Lets first rule out file making by checking if you have read and write access to your temp folder. Please do the following:

      (1) Reboot
      (2) Start AutoCAD and load StripMtext
      (3) Run StripMtext. When the error message is displayed, copy the path and file name.
      (4) Start Notepad and open the file name obtain from step 3.
      (5) If the file can be opened, try typing a few characters anywhere in the text and then save the file to a new unique file name and close the file. (You can type any characters anywhere in the file. We just want to make a change in the file and see it it can be written to disk.)

      Where you able to open the file, edit it, and save it?

      (6) Open the file you just saved. Are you changes present?

      If all the above steps are successful, then you must have read and write access. So next step is to please send me a copy of one of the unedited temp files for examining. Also please include which version of Windows you are running. My email address is on my About page.

      Thank you,
      Steve

  10. Hi Steve,
    Thank you very much for your great and useful utility!

    I use v5-0c.
    If it is executed against an annotative object in a paper space, the errors result:
    **The command is only allowed in model space**
    Object name: XXXXXXXX
    Unknown command: “SMT”. Press F1 for help.
    Unknown command: “ADD”. Press F1 for help.
    Unknown command: “1:1″. Press F1 for help.
    Unknown command: “SMT”. Press F1 for help.

    This will loop for each processed object.
    This is caused by line 1089: (command “._objectscale” ename “” “_Add” x “”)

    It is indeed should not be called in paper space.
    This could be fixed by adding the following function:

    (defun IsPaperSpace ( / active-document)
    (setq active-document (vla-get-ActiveDocument (vlax-get-acad-object)))
    (if (= (vla-get-ActiveSpace active-document) acPaperSpace) ;; A layout is active?
    (if (= (vla-get-MSpace active-document) :vlax-false) ;; Are we not in model space?
    T
    )
    )
    )

    and adding one more condition to (and) in lines 1080-1083 to become this:

    ((and
    (not (IsPaperSpace))
    (IsAnnotative ename)
    (setq sclst (GetAnnoScales ename))
    )

    Thank you!

    • Hi Mike,

      Thank you for the bug report and suggested solution.

      I know you’ve waited a long time for a reply. I’ve been busy remodeling my home and haven’t had a chance to code. But today I had a chance and can now say that an update is imminent. Please standby while we test the code.

      Thanks again.
      Steve

  11. Pingback: AutoCAD tip - fixing corrupt text

  12. Hi Steve Doman and Joe Burke. My greatest respects and thanks to you, I can only appreciate the beautiful minds you have. This is a serious programmer engineering piece of art. Personally I do program in VLISP, but not to that level, that´s the reason I´m amazed.
    Yours Sincerely
    Antonio Ruiz Romero – México

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s