Author Topic: Drag and Drop  (Read 3094 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
Drag and Drop
« on: August 02, 2006, 03:50:35 PM »
I have the following bit of code to allow drag and drop from my detail viewer program into autocad.

Code: [Select]
// use my new cool looking custom cursor
Cursor.Current = eCursor;
string sTemp = viewer.DrawingFile;
System.Windows.Forms.DataObject dataObject = new System.Windows.Forms.DataObject();

// set the data to filedrop passing a single element array of strings
dataObject.SetData(System.Windows.Forms.DataFormats.FileDrop, new string[] { sTemp });

// Place the data onto the system clipboard
System.Windows.Forms.Clipboard.SetDataObject(dataObject, true);
viewer.DoDragDrop(dataObject, System.Windows.Forms.DragDropEffects.Copy);

The program is setup to work from details that reside on the users local drive and our details that reside on our web site. It works okay locally and on some machines over the web.

I get an *invalid* file name or invalid version from the insert command in autocad during the drop on some machines in our office. (I'm letting autocad handle the entire drop event as I have no target code written, the above code only copies to the clipboard (I think).

Anyway, autocad maons that the file is invalid and points to the temporary internet files directory where my file name exists with a size of 0kb. So, I assume that the download is not working. I can't figure out whether it's something in WindowsXP security, or IE security or my code.

Strangely enough, it appears to be the same problem that Autodesk's Idrop is having. Autodesk appears to have dropped (pun intended) this technology as there are several questions regarding this in the idrop discussion over there not getting answered. The problem is, there is one idiot Person who keeps addressing this over there that the version of the drawing is not correct, which is BS. Autocad just cannot insert a drawing that doesn't exist...

I was trying to avoid writing any autocad code for this so I don't have to specify a version to work with.

If I can't figure out what is happening, I'll have to write my own download/insert/delete hack *maon*..

Any ideas?
« Last Edit: August 02, 2006, 03:54:00 PM by Draftek »