Author Topic: how do I add a variable to the windows clipboard?  (Read 15036 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: how do I add a variable to the windows clipboard?
« Reply #15 on: December 07, 2015, 04:02:06 PM »
Why use any library? To leverage the expertise and efforts of others to increase productivity and efficiency. I've no reservations nor shame recommending Dale's work to others; none. If a "casual programmer" can't learn how to fix code thru discussion forums and their own dogged determination and ingenuity then they shouldn't be writing code projects or companies rely upon.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ymg

  • Guest
Re: how do I add a variable to the windows clipboard?
« Reply #16 on: December 07, 2015, 04:42:59 PM »
Another option is Gille Chanteau's "LispExtension" which can be downloaded from: gileCAD

Adds the following command to Autolisp:
  • gc-Brep
  • gc-CopyToClipboard
  • gc-TextFromClipboard
  • gc-GetFileDlg
  • gc-GetFolderDlg
  • gc-InputBox
  • gc-MessageBox
  • gc-GetStrippedMtextString
  • gc-VpFreeze
  • gc-VpLayerOverride
  • gc-VpLayerRemoveAll
  • gc-VpThaw
  • gc-VpThawAll
  • gc-XlRead
  • gc-XlWrite

ymg

guitarguy1685

  • Mosquito
  • Posts: 2
Re: how do I add a variable to the windows clipboard?
« Reply #17 on: May 24, 2017, 11:49:52 AM »
Just download DOSLIb from www.mcneel.com and use the dos_clipboard function.

I downloaded this library.  So to be sure, I would need to install this on everyone's computer.  I read the install notes and I guess I can set it up in the startup file.

guitarguy1685

  • Mosquito
  • Posts: 2
Re: how do I add a variable to the windows clipboard?
« Reply #18 on: May 24, 2017, 12:06:52 PM »
[/code]
Code: [Select]
;;  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
)

Be sure not to get a pie in your face :wink:

LM you're everywhere! Bless your soul.  Anyways what's the purpose the 2nd code? It just returns the text from clipboard.  Would this be to us internally in another lisp?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: how do I add a variable to the windows clipboard?
« Reply #19 on: May 24, 2017, 01:11:20 PM »
LM you're everywhere! Bless your soul.  Anyways what's the purpose the 2nd code? It just returns the text from clipboard.  Would this be to us internally in another lisp?

For example, if a program is perhaps expecting the user to copy data to the clipboard from another application, the function can then obtain such data for use in the program.