COPY STRING FROM VARIABLE TO CLIPBOARD

COPY STRING FROM VARIABLE TO CLIPBOARD

etilley327KA
Advocate Advocate
1,280 Views
2 Replies
Message 1 of 3

COPY STRING FROM VARIABLE TO CLIPBOARD

etilley327KA
Advocate
Advocate

How do I copy a string from my variable to the clipboard for paste?

0 Likes
Accepted solutions (1)
1,281 Views
2 Replies
Replies (2)
Message 2 of 3

paullimapa
Mentor
Mentor

at AutoCAD command line:

command: (setq a "test string")

command: !a

command: "test string"

select & highlight the above and do Ctrl+C

Command: (startapp"notepad")

then in Notepad do Ctrl+V


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

Assuming YourVariableName is the variable that contains the string in question, a little Searching reveals several places with this who-would-have-guessed kind of structure:

 

(vlax-invoke
  (vlax-get
    (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow)
    'ClipBoardData
  )
  'SetData
  "Text"
  YourVariableName
)

 

That will put it in the clipboard directly from the variable contents, without your needing to pull it from the variable and Ctrl+C copy it.

Kent Cooper, AIA
0 Likes