Emmanuel Delay Posted Monday at 08:52 AM Share Posted Monday at 08:52 AM Is there a way to paste text from the clipboard, and make it lose any text formating? And have it fill a (m)text that I select or entmake... I'm tired of right click mouse -> paste special -> without formatting ... a lisp command would suit me better Quote Link to comment Share on other sites More sharing options...
Steven P Posted Monday at 09:02 AM Share Posted Monday at 09:02 AM This is the basics, copy to clipboard, copy from clipboard ;;Copy text to clipboard ;; (vlax-invoke (vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'setData "TEXT" --MYTEXTSTRING-- ) ;;(vlax-release-object html) ;;and release the object ;;Get text from clipboard ;;(vlax-invoke (vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'getData "TEXT" ) ;;(vlax-release-object html) and put together in a LISP, set clip board text and get clip board text (defun SetClipBoardText ( MyText / htmlfile result ) (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" Mytext) (vlax-release-object htmlfile) (princ) ) (defun GetClipBoardText ( / htmlfile result ) (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'getData "Text")) (vlax-release-object htmlfile) result ) 1 Quote Link to comment Share on other sites More sharing options...
Emmanuel Delay Posted Monday at 09:08 AM Author Share Posted Monday at 09:08 AM Perfect. Thanks Quote Link to comment Share on other sites More sharing options...
Steven P Posted Monday at 10:02 AM Share Posted Monday at 10:02 AM not a problem, I like it when I have the snippets to copy and paste, a useful one to keep handy for so many things Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Monday at 12:04 PM Share Posted Monday at 12:04 PM In the old times I used to paste the text in Notepad, from there copy-paste in AutoCAD Mtext. All formatting was lost. 1 Quote Link to comment Share on other sites More sharing options...
Emmanuel Delay Posted Monday at 12:29 PM Author Share Posted Monday at 12:29 PM 25 minutes ago, fuccaro said: In the old times I used to paste the text in Notepad, from there copy-paste in AutoCAD Mtext. All formatting was lost. Same here Quote Link to comment Share on other sites More sharing options...
Steven P Posted Monday at 01:34 PM Share Posted Monday at 01:34 PM 1 hour ago, fuccaro said: In the old times I used to paste the text in Notepad, from there copy-paste in AutoCAD Mtext. All formatting was lost. The above should do the same - I use it all the time, mostly PDF mark ups, copy to clip board then a LISP txtCBTT (txt, Clip Board To Text) or txtCBNew to paste with no formatting into the drawing - I got annoyed with copy-paste to notepad being soooo slow 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.