TheSwamp

Code Red => ARX Programming => Topic started by: LE on December 21, 2005, 11:18:27 AM

Title: ClipBoard Functions
Post by: LE on December 21, 2005, 11:18:27 AM
There is now under the "downloads" [freeones] section a new ARX application that includes the following functions:

(SetClipboardText  [String])
(GetClipboardText)
(EmptyClipboard)

For AutoCAD 2004-2006 and Verticals.

ClipBoard.arx [67KB]

Quote
LUIS ESQUIVEL PROVIDES THIS PROGRAM "AS IS" AND WITH
ALL FAULTS. LUIS ESQUIVEL SPECIFICALLY DISCLAIMS ANY
IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE. LUIS ESQUIVEL DOES NOT WARRANT THAT
THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED
OR ERROR FREE.

http://www.geometricad.com

Best regards;
Luis.
Title: Re: ClipBoard Functions
Post by: Crank on December 21, 2005, 01:52:14 PM
(startapp "clipbrd")
Title: Re: ClipBoard Functions
Post by: LE on December 21, 2005, 02:15:13 PM
(startapp "clipbrd")

I do not understand.... ?

The idea is to provide to the end user these new functions and use them directly in their lisp routines, there is DOSlib tm by Dale Fugier, an excellent extended application, but most of the lisp programmers would prefer to have an small size 3d party app, and without the message loading... for the proprietary issue.

Have fun.
Title: Re: ClipBoard Functions
Post by: GDF on December 21, 2005, 03:07:31 PM
Thanks Luis.

I can make good use of your function.

I've added this to my mnl file:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; AutoLoad Clipboard Application ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; http://www.geometricad.com
;;; by Luis Esquivel
;;; ClipBoard Functions:
;;; Usage: (SetClipboardText <String>)
;;; Usage: (GetClipboardText)
;;; Usage: (EmptyClipboard)
(defun ARCH:ClipBoard  ()
  (cond ((>= (distof (substr (getvar "acadver") 1 4)) 16.0)
         (if (not (member "clipboard.arx" (arx)))
           (arxload (findfile (strcat ARCH#SUPF "V_16/clipboard.arx")))))
        )
  (princ))


Gary
Title: Re: ClipBoard Functions
Post by: LE on December 21, 2005, 09:37:14 PM
Thanks Luis.

I can make good use of your function.


You are welcome, and that's the idea.
Title: Re: ClipBoard Functions
Post by: LE on December 21, 2005, 09:41:44 PM
ClipBoard Functions C++ project solution [open source], may be available if required, for future or previous release version's of AutoCAD.

supportATgeometricadDOTcom

Regards.
Title: Re: ClipBoard Functions
Post by: Mark on December 22, 2005, 06:29:56 PM
The idea is to provide to the end user these new functions and use them directly in their lisp routines ...

slaps forehead Doh, now I get it!

Many thanks Luis, very  :kewl:
Title: Re: ClipBoard Functions
Post by: LE on December 22, 2005, 07:01:11 PM
Here are some little sample on how to use the functions:

Code: [Select]
;; to set some text to the clipboard
_$ (SetClipboardText "This is a way to sent into the ClipBoard some text data")
T

;; here we can get the text inside the clipboard, coming from any application
_$ (setq string (GetClipboardText))
"This is a way to sent into the ClipBoard some text data"

;; this will empty the clipboard coming from any application
_$ (EmptyClipBoard)

T

HTH
Title: Re: ClipBoard Functions
Post by: Mark on December 23, 2005, 12:31:38 PM
Man that works like a charm Luis. Muchas gracias mi amigo.  :-)
Title: Re: ClipBoard Functions
Post by: LE on December 23, 2005, 01:02:14 PM
Man that works like a charm Luis. Muchas gracias mi amigo.  :-)

 :-)
Title: Re: ClipBoard Functions
Post by: LE3 on November 05, 2010, 12:05:20 PM
Never uploaded the source code for these functions, and before the code it is lost, here it is just in case:

Code: [Select]
//-----------------------------------------------------------------------------
//----- acrxEntryPoint.h
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"

//-----------------------------------------------------------------------------
#define szRDS _RXST("LESQ")

//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class Cclipboard17App : public AcRxArxApp {

public:
Cclipboard17App () : AcRxArxApp () {}

virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
// TODO: Load dependencies here

// You *must* call On_kInitAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;

acutPrintf(_T("\n\nClipBoard Functions:"));
acutPrintf(_T("\nUsage: (SetClipboardText <String>)"));
acutPrintf(_T("\nUsage: (GetClipboardText)"));
acutPrintf(_T("\nUsage: (EmptyClipboard)\n\n"));

return (retCode) ;
}

virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
// TODO: Add your code here

// You *must* call On_kUnloadAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;

// TODO: Unload dependencies here

return (retCode) ;
}

virtual void RegisterServerComponents () {
}

public:

// ----- ads_setclipboardtext symbol (do not rename)
static int ads_setclipboardtext(void)
{
struct resbuf *rb=acedGetArgs();
LPCTSTR pszText;
// temp string just for testing
CString tmp;

// get the argument
if (rb && (rb->restype==RTSTR)){
pszText=rb->resval.rstring;
rb=rb->rbnext;
tmp=pszText;
}
...

The complete source code below for download:
Title: Re: ClipBoard Functions
Post by: Pad on November 05, 2010, 12:27:43 PM
Hi LE

could you upload the arx as well please.
the http://www.geometricad.com/ site seems to be no longer.

Thanks
P
Title: Re: ClipBoard Functions
Post by: LE3 on November 05, 2010, 12:36:45 PM
I will... also the version for AutoCAD 2010 and 2011... as soon as I can - and guess to upload also the visual studio solutions - so anyone here can make his/her own builds. 


could you upload the arx as well please.
Title: Re: ClipBoard Functions
Post by: LE3 on November 05, 2010, 12:42:05 PM
Here they are the full source code (including the Visual Studio Solutions inside the zip for 16&17) and the binaries for AutoCAD 16, 17 and 18 - later today will post the 18 too.

HTH

Note: Win32 versions only (included now the 18 version for AutoCAD 2010-2011 and verticals):
Title: Re: ClipBoard Functions
Post by: Pad on November 05, 2010, 01:10:57 PM
great thanks!
Title: Re: ClipBoard Functions
Post by: LE3 on November 05, 2010, 03:54:33 PM
Added x64 binaries for versions 17 and 18 only (not tested)