Hi Experts ๐
I'm just a new bie. I've made a simple list box with some text entries. I can drag from any node to Acad's Drawing area and drop it. And without writing any code to capture Drop event, same text is written there in Top Left corner of Drawing area.
I want to Catpure this Drop even of Acad Drawing area. I will then be able to use Jig classes to add my own entities.
I tried Application.DoDragDrop() method and invoke DragTarget.OnDrop() but confused very much ๐
Any help would be really appreciated.
Thanks a bunch.
Solved! Go to Solution.
Solved by augusto.goncalves. Go to Solution.
Hi,
When you start the drag, call
Application.DoDragDrop(sourceControl, dataObject, .....)
Then you need to create a class that implements DropTarget which the OnDrop method, this among others, get the data passed on the second parameter of DoDragDrop
e.Data.GetData(typeof(YouDataType))
Also convert the point to AutoCAD coordinates with
Editor ed = AppAutoCAD.DocumentManager.MdiActiveDocument.Editor;
int vport = (short)AppAutoCAD.GetSystemVariable("CVPORT");
Point3d insertPoint = ed.PointToWorld(new Point(e.X, e.Y), vport);
Hope this help.
Regards,
Thanks a bunch for your reply. I did something similar while experimenting with some sample code.
Can't find what you're looking for? Ask the community or share your knowledge.