Author Topic: VLisp alternative to dos_clipboard  (Read 1123 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 723
VLisp alternative to dos_clipboard
« on: May 19, 2022, 09:55:43 AM »
is there anyone who knows an alternative to dos_clipboard
in pure VLisp ?

mhupp

  • Bull Frog
  • Posts: 250
Re: VLisp alternative to dos_clipboard
« Reply #1 on: May 19, 2022, 11:03:22 AM »
Code - Auto/Visual Lisp: [Select]
  1. (vlax-invoke (vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'setData "TEXT" STRING)

string = text string you want to copy to clipboard

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: VLisp alternative to dos_clipboard
« Reply #2 on: May 19, 2022, 11:28:12 AM »
Tony Tanzillo provided a nice reply on the subject here: https://www.theswamp.org/index.php?topic=44212.msg494844#msg494844

Even though he recommended against it, I use his methods posted. I also have it on my TODO to study his notes one day.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: VLisp alternative to dos_clipboard
« Reply #3 on: May 20, 2022, 05:54:49 AM »
Code - Auto/Visual Lisp: [Select]
  1. (vlax-invoke (vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'setData "TEXT" STRING)

string = text string you want to copy to clipboard

It works.

thank you so much.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: VLisp alternative to dos_clipboard
« Reply #4 on: May 20, 2022, 05:57:52 AM »
Tony Tanzillo provided a nice reply on the subject here: https://www.theswamp.org/index.php?topic=44212.msg494844#msg494844

Even though he recommended against it, I use his methods posted. I also have it on my TODO to study his notes one day.

it is necessary to study well, to understand well. . .

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: VLisp alternative to dos_clipboard
« Reply #5 on: May 20, 2022, 07:37:07 AM »
I would suggest releasing the objects from memory following evaluation, given that these originate outside of the AutoCAD object model and so it is generally recommended to release them explicitly using vlax-release-object. You may be interested in the copytoclipboard function I included as part of my novelty Password Generator program - all of these techniques are based on methods demonstrated by the late great MP.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: VLisp alternative to dos_clipboard
« Reply #6 on: May 20, 2022, 12:16:52 PM »
...vlax-release-object...

ok

thank you

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: VLisp alternative to dos_clipboard
« Reply #7 on: May 23, 2022, 01:02:27 PM »
Good topic all.

I know I did this years ago, now I need to go back and find that code and see how "I" did it.

lol.