KRBeckman Posted March 11, 2010 Posted March 11, 2010 Is there a way to paste a string of text from a program like Excel into the command line while a command is active while within a running lisp. Example, I would like to create a line of text, "BBD-1230-G" as a TEXT, and do so only typing in one command. Something like this: (defun c:pastetext () (command "_.-text" '(0 0 0) 1 0 pastefunction) (princ)) Quote
KRBeckman Posted March 11, 2010 Author Posted March 11, 2010 seriously? man, i wanna just delete this post and pretend it never happend. Quote
KRBeckman Posted March 11, 2010 Author Posted March 11, 2010 its not working, probably something simple... (command "_.-PN" ctrl-v "0,0" "0" (command "")) What am i doing wrong? Quote
KRBeckman Posted March 11, 2010 Author Posted March 11, 2010 The company I work for uses a third party software called Project Matrix to manage/distribute thier 2-D and 3-D symbols. The command to insert a symbol is "PN" to use the dialog box or "-PN" to use the command line. It works alot like insert. First it asks for the part number (what I want to paste from an excel spreadsheet), then insertion point (90% of the time is (0,0,0), finally rotation angle (also 90% of the time its 0), then it askes for a second insertion point, which I don't want to do, so I cancel the command with "(command "") ***but now that i think of it a "" will do just fine. (command "_.-PN" ctrl-v "0,0" "0" "") Quote
Lee Mac Posted March 11, 2010 Posted March 11, 2010 Ctrl-V is a keystroke, and will be treated just as any other symbol. Your example used text, so I suggested Ctrl-V to insert the text into AutoCAD. Quote
Lee Mac Posted March 11, 2010 Posted March 11, 2010 Perhaps take a look at this function by the great MP: ;; MP (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 ) Quote
KRBeckman Posted March 11, 2010 Author Posted March 11, 2010 Ctrl-V is a keystroke, and will be treated just as any other symbol. Your example used text, so I suggested Ctrl-V to insert the text into AutoCAD. I was just about to reply and ask if this is what the confusion was... Perhaps take a look at this function by the great MP: Code: ;; MP(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) This works perfectly. Thanks again man. Quote
Lee Mac Posted March 11, 2010 Posted March 11, 2010 This works perfectly. Thanks again man. No worries Quote
alanjt Posted March 12, 2010 Posted March 12, 2010 Not that MP's function doesn't fit the bill, and it does quite well, but I wanted to mention that dos_lib has a Copy and Paste to Clipboard function. 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.