| View previous topic :: View next topic |
| Author |
Message |
Hülyesamu
Joined: 24 Sep 2004 Posts: 22
|
Posted: Fri Jun 05, 2009 11:51 am Post subject: ClipboardAll doesn't work well for AutoCAD |
|
|
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 |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
Hülyesamu
Joined: 24 Sep 2004 Posts: 22
|
Posted: Fri Jun 05, 2009 2:19 pm Post subject: |
|
|
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 |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Fri Jun 05, 2009 2:46 pm Post subject: |
|
|
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 |
|
 |
Hülyesamu
Joined: 24 Sep 2004 Posts: 22
|
Posted: Fri Jun 05, 2009 5:01 pm Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Sun Jun 07, 2009 12:02 pm Post subject: |
|
|
c) makes exactly the same error message.  |
|
| Back to top |
|
 |
|