Emmanuel Delay Posted October 14 Posted October 14 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
Steven P Posted October 14 Posted October 14 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
Steven P Posted October 14 Posted October 14 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
fuccaro Posted October 14 Posted October 14 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
Emmanuel Delay Posted October 14 Author Posted October 14 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
Steven P Posted October 14 Posted October 14 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
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.