Jump to content

UnFormat.lsp does not work in Autocad 2021


Recommended Posts

Posted

I'll put this one here for later. 

 

I have a suspicion that the text is still there, just not visible - very small perhaps. This will show all the mtext values (first 256 characters anyway) in the drawing. Run it after your unformat just to confirm that the texts have been deleted or are just not visible.

 

(defun c:GrabTexts ( / MySS acount MyEnt)
  (setq myss (ssget "_X" '((0 . "mtext"))))
  (setq acount 0)
  (while (< acount (sslength myss))
    (setq Myent (ssname Myss acount))
    (princ "\n")(princ (assoc 1 (entget MyEnt)))
    (setq acount (+ acount 1))
  ) ; end while
)

 

  • Thanks 1
Posted
29 minutes ago, GLAVCVS said:

Write before (vla-put-textstring obj (vla-get-TextString obj)) this: (print (vla-get-TextString obj)), загрузите, запустите и опубликуйте скриншот того, что произошло в командной строке

 

PS: Also make sure you've closed all the parentheses in your Lisp expression: your last message seems to be missing a closing parenthesis.

 

((= otyp "MTEXT")(print (vla-get-TextString obj))(vla-put-TextString obj (supriFMT (vla-get-TextString obj)))) ; AcDbMText
It looks like it worked! Thank you all!
I'll test it again.

  • Like 1
Posted
34 minutes ago, GLAVCVS said:

Write before (vla-put-textstring obj (vla-get-TextString obj)) this: (print (vla-get-TextString obj)), загрузите, запустите и опубликуйте скриншот того, что произошло в командной строке

 

PS: Also make sure you've closed all the parentheses in your Lisp expression: your last message seems to be missing a closing parenthesis.

 

((= otyp "MTEXT")(print (vla-get-TextString obj))(vla-put-TextString obj (supriFMT (vla-get-TextString obj)))) ; AcDbMText
It looks like it worked! Thank you all!
I'll test it again.

But I still haven't figured out what the problem is...

  • Like 1
Posted
4 minutes ago, Nikon said:

... 

But I still haven't figured out what the problem is...

Maybe you deleted some parentheses when you removed the T argument.

Posted (edited)

No, I didn't understand why the first code didn't work.

Edited by Nikon
Posted
59 minutes ago, Steven P said:

I have a suspicion that the text is still there, just not visible - very small perhaps. This will show all the mtext values (first 256 characters anyway) in the drawing. Run it after your unformat just to confirm that the texts have been deleted or are just not visible.

 

(defun c:GrabTexts ( / MySS acount MyEnt)
  (setq myss (ssget "_X" '((0 . "mtext"))))
  (setq acount 0)
  (while (< acount (sslength myss))
    (setq Myent (ssname Myss acount))
    (princ "\n")(princ (assoc 1 (entget MyEnt)))
    (setq acount (+ acount 1))
  ) ; end while
)

GRABTEXTS

Writing on the command line:
(1 . )
(1 . )

Posted
1 hour ago, Nikon said:

No, I didn't understand why the first code didn't work.

It's simply that your version of LM:UnFormat (I don't know if it's the original or modified one) isn't compatible with some localized versions of AutoCAD.

Is your version of AutoCAD 2019 on the same PC as the 2021 version?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...