TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on May 19, 2022, 09:55:43 AM

Title: VLisp alternative to dos_clipboard
Post by: domenicomaria on May 19, 2022, 09:55:43 AM
is there anyone who knows an alternative to dos_clipboard
in pure VLisp ?
Title: Re: VLisp alternative to dos_clipboard
Post by: mhupp 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
Title: Re: VLisp alternative to dos_clipboard
Post by: JohnK 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.
Title: Re: VLisp alternative to dos_clipboard
Post by: domenicomaria 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.
Title: Re: VLisp alternative to dos_clipboard
Post by: domenicomaria 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. . .
Title: Re: VLisp alternative to dos_clipboard
Post by: Lee Mac 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 (http://lee-mac.com/password.html) program - all of these techniques are based on methods demonstrated by the late great MP.
Title: Re: VLisp alternative to dos_clipboard
Post by: domenicomaria on May 20, 2022, 12:16:52 PM
...vlax-release-object...

ok

thank you
Title: Re: VLisp alternative to dos_clipboard
Post by: rkmcswain 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.