AutoHotkey Community

It is currently May 26th, 2012, 7:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: June 5th, 2009, 12:51 pm 
Offline

Joined: September 24th, 2004, 4:42 pm
Posts: 22
Hi, I've problems accessing ClipboardAll.
This is an example code:

Code:
b=0
a=
c=
#NumpadDiv:: aa()

aa()
{
global
if (b)
{
a := ClipBoardAll
Clipboard :=
Clipboard := c
}
else {
c := ClipBoardAll
Clipboard :=
Clipboard := a
}
b := !b
}


Here, I can switch between the two clipboards. It works for text, ArchiCAD data, and image (that is, binary data).

But under AutoCAD, I have an error message when trying to insert the modified clipboard:

Cannot insert AutoCAD drawing file as OLE object.

Furthermore, if I switch back to the other clipboard, it inserts the drawing data.

If I ^C + ^/ + ^/ + ^V (copy, change clipboards twice, paste) then it inserts the right drawing data.

That is: the last copied clipboard data remains accessible despite of deleting/restoring, but none of the others.


Any idea of avoiding this?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 1:31 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Have you tried to clear the a & c vars, it might remember old data (previous), and perhaps introduce a clipwait?

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 3:19 pm 
Offline

Joined: September 24th, 2004, 4:42 pm
Posts: 22
Clearing variables did not help, and I don't understand why to ClipWait (should I wait till Clipboard is full/empty?).

I did some tries an AutoCAD's Paste Special detected 'bad' clipboard data as Bitmap. When I inserted this way, it pasted the appropriate selection's bitmap.

This can be ad AutoCAD bug and I don't know how to avoid it.

Otherwise, the same happens if I ^V and paste into a Folder (making a 'scrap' file) then copy the scrap and try to paste into AutoCAD.

Maybe the AutoCAD uses clipboard a special way, putting the only image of selection to there and storing drawing object somewhere else ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 3:46 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
a) Clipwait after Clipboard := a or c

b) It may very well be autocad, but haven't you provide the solution
with ^C + ^/ + ^/ + ^V, e.g. send ^c^/^/^v?

c) A long shot: why not save the clipboardall data to a file and read it back, does that work? See http://www.autohotkey.com/docs/commands/FileRead.htm with *c option to readline a clipboard data file

if abc don't work I don't know a solution

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 6:01 pm 
Offline

Joined: September 24th, 2004, 4:42 pm
Posts: 22
b) This method brings up only the last stored clipboard content, and not the previous ones. I'm afraid of manipulating only a bitmap image at the clipboard (or the part of the clipboard autohotkey reaches) while the memory stores the real clipboard content stays unchanged when I change clipboard.

I don't know OLE well, but this would be useful when pasting an AutoCAD drawing in an Office doc, for example: the office sees an easy bitmap, not a difficult to display vectored drawing.

Otherwise, as I searched a bit the web, there are programs and scripts manipulating AutoCAD's clipboard without obvious signs of being designed specially for AutoCAD.

I'll check the two other things, thx.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 1:02 pm 
c) makes exactly the same error message. :(


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, bobbysoon, Google Feedfetcher, joetazz, krajan, over21, RaptorX, rbrtryn, SKAN and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group