.NET

Reply
Active Contributor
farrukhw
Posts: 26
Registered: ‎05-07-2009
Message 1 of 3 (181 Views)
Accepted Solution

How to capture Drop even on Acad Drawing area from Listbox?

181 Views, 2 Replies
05-23-2012 11:32 PM

Hi Experts :smileyhappy:


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 :smileysad:

 

Any help would be really appreciated.

 

Thanks a bunch.

ADN Support Specialist
augusto.goncalves
Posts: 311
Registered: ‎04-30-2009
Message 2 of 3 (171 Views)

Re: How to capture Drop even on Acad Drawing area from Listbox?

05-24-2012 06:50 AM in reply to: farrukhw

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,

Regards,



Augusto Goncalves
Autodesk Developer Network
Active Contributor
farrukhw
Posts: 26
Registered: ‎05-07-2009
Message 3 of 3 (129 Views)

Re: How to capture Drop even on Acad Drawing area from Listbox?

06-29-2012 06:43 AM in reply to: augusto.goncalves

Thanks a bunch for your reply. I did something similar while experimenting with some sample code.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community