AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ClipboardAll doesn't work well for AutoCAD

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Hülyesamu



Joined: 24 Sep 2004
Posts: 22

PostPosted: Fri Jun 05, 2009 11:51 am    Post subject: ClipboardAll doesn't work well for AutoCAD Reply with quote

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?
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Fri Jun 05, 2009 12:31 pm    Post subject: Reply with quote

Have you tried to clear the a & c vars, it might remember old data (previous), and perhaps introduce a clipwait?
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
Hülyesamu



Joined: 24 Sep 2004
Posts: 22

PostPosted: Fri Jun 05, 2009 2:19 pm    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Fri Jun 05, 2009 2:46 pm    Post subject: Reply with quote

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 Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
Hülyesamu



Joined: 24 Sep 2004
Posts: 22

PostPosted: Fri Jun 05, 2009 5:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Jun 07, 2009 12:02 pm    Post subject: Reply with quote

c) makes exactly the same error message. Sad
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group