Jump to content

Recommended Posts

Posted

I call up an existing block of MTEXT. The style and font are both simplex. When I paste new text from a notepad file the editor changes the size and font. This is getting to be a big headache. Does anyone know how to fix this?

 

image.thumb.png.efd4e5d196ed8facb27867cce77592e7.png

Posted

I'm assuming its the new Notepad and not the one from 1995. it defaults to copy text with formatting. You have three options.

You can change the default font and size in notepad settings, disable formatting also in settings ,or  use Ctrl + Shift + V to paste as plain text. there also might be a right click paste as plain text option.

 

image.png.2b868273510ff3a6853c4b47c33d9196.png

  • Like 1
Posted

Turning off formatting seems to have worked. Thanks.

Posted (edited)

A snippet here, this appears to set clipboard text to plain text - removes formatting (fonts etc).

 

(defun c:TXTCBNF ( / htmlfile result ) ; TXT: text, CB: Clip Board, NF: No Format
  ;; Set clipboard text to no format
  (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'getData "Text"))
  (vlax-release-object htmlfile)

  ;; Put no format text into clipboard
  (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" result)
  (vlax-release-object htmlfile)
  (princ)
)

 

Always many ways to do the same thing!

If you are OK to do LISPs else just ask

 

 

(A part of a larger LISP of mine, so think this works... but it might not - my one puts in some thoughts between grabbing the clip board text and resetting it such as mm2 goes to 'squared', some company texts to upper case if not and so on)

 

Edited by Steven P
  • Like 1
  • Agree 1
Posted

Thanks, I'll give it a try.

 

 

 

4 hours ago, Steven P said:

A snippet here, this appears to set clipboard text to plain text - removes formatting (fonts etc).

 

(defun c:TXTCBNF ( / htmlfile result ) ; TXT: text, CB: Clip Board, NF: No Format
  ;; Set clipboard text to no format
  (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'getData "Text"))
  (vlax-release-object htmlfile)

  ;; Put no format text into clipboard
  (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" result)
  (vlax-release-object htmlfile)
  (princ)
)

 

Always many ways to do the same thing!

If you are OK to do LISPs else just ask

 

 

(A part of a larger LISP of mine, so think this works... but it might not - my one puts in some thoughts between grabbing the clip board text and resetting it such as mm2 goes to 'squared', some company texts to upper case if not and so on)

 

 

  • Like 1
Posted

You posted this in the AutoCAD LT Forum, are you using AutoCAD LT?

 

Can you post the notepad .txt file and the .dwg?

  • Like 1
Posted

I am using AutoCad LT. I don't recall which drawing it was. If I come across it again I'll upload it.

Thanks.

Posted

What year AutoCAD LT, I believe only LT 2024 and newer can use LISP?

  • Like 1
Posted

That's my fault, I didn't read the topic header so offered a LISP... even at LT2024 I am not sure this would work - it isn't so great with 'VL' functions

Posted
On 4/21/2026 at 5:12 AM, SLW210 said:

What year AutoCAD LT, I believe only LT 2024 and newer can use LISP?

2025

Posted (edited)

@bustr Autodesk in there wisdom introduced lisp in LT2024 as so many other CAD programs have it, so competition was knocking. But and a big but they did not include everything as pointed out by @Steven P there is some documentation about what is missing, mainly in the VL commands. For me "get-application" is a real big one as stops you talking to Excel directly.

 

I use Bricscad and as far as I can tell has a full implementation. May need to check their "Lite" version but have not heard of anything missing.

Edited by BIGAL
  • Like 1

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...