DragDropToAutoCAD from a listview

Started by Fred Tomke, May 15, 2008, 12:49:31 AM

Previous topic - Next topic

Fred Tomke

Hello,

what type coordinates are given by DragDropToAutoCAD-event? I thought that were UCS-coordinates but testing with 5.0.0.15 DEU on Map 2009 they have their origin on viewports's upper left corner. I do not know if the coordinates are DCS-coordinates so I can convert them by using trans-function. In ObjectDCL that were UCS coordinates.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Fred, those should be screen coordinates relative to the top left corner of the screen. As best I can tell, this behavior is identical to the original ObjectDCL code.

Fred Tomke

Hm,
as I wrote I thought that could be screen coordinates (DCS). But using trans-function I had no success. Is there a good solution to get the right coordinate of active coordinate system?

Does anybody have experiences with it?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Fred Tomke

Hello Owen,

I had a quick check. I used DragDropToAutoCAD in ObjectDCL from a tree and I get UCS-coordinates. Maybe there is a different handling between listview and tree? I don't know...

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

It's possible that the treeview was different. In the case of passing UCS coordinates, how would you know which viewport the coordinates are from?  It seems to me there would need to be a viewport number in addition to the coordinates.

owenwengerd

I've now changed the code to pass both UCS coordinates and a viewport number for the DragnDropToAutoCAD event. Please check this out in Alpha 15 and let me know whether it works as you expect.

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Fred Tomke

Hello Owen,

just a question for my knowledge: do you rewrite the code for listview and tree for this event dragdroptoautocad twice or is it the same code?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

For the treeview and listview it is the same code, but some other controls still use the old drag and drop code (also changed to now pass UCS coordinates and a viewport number).

Fred Tomke

Thank you, Owen.

BTW. I've found out that dragging a file (LSP, ARX, DWG) from Windows Explorer into the drawing area of AutoCAD causes the call of DragDropToAutoCAD, too, when a palette (maybe with dockable, modeless forms, too, I didn't test it). The normal workflow (loading a lisp, an arx or adding the dropped dwg as a block) only works properly after closing the palette. Is this wanted?

Steps to reproduce:
- Open AutoCAD
- Load the project from http://www.opendcl.com/forum/index.php?action=dlattach;topic=325.0;attach=389 and the latest lisp http://www.opendcl.com/forum/index.php?action=dlattach;topic=325.0;attach=394. May be you have to drag and drop the palette into the middle of window (I've forgotten the right word for the opposite of "anchor").
- Call command LAF
- Drop a listview  item to AutoCAD. An alert is shown.
- Now try to drag a dwg file from Windows Explorer to AutoCAD (into the modelspace). The same alert will be shown.
- Close the palette. Try to drag a dwg file from Windows Explorer to AutoCAD (into the modelspace). The file is going to be inserted into the drawing.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

I believe this is fixed in Alpha 16.