Message 1 of 6
Drag drop item at specific point in AutoCad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I would like to use the behaviour of "drag and drop" into AutoCad (from a listbox in a form) at a specific point, I do not need to drop anything into AutoCad, I just need the exact point of the mouseposition converted to WCS in autocad.
the below code works, but i do not get the correct point in AutoCad.
Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor '---now i drop listbox-text in autocad, DoDragDrop(ListBox1.Text, DragDropEffects.Copy) Dim pt As Point3d = ed.PointToWorld(New Point(CInt(MousePosition.X), CInt(MousePosition.Y))) '---draw circle ModelspaceAdd(Teken.Cirkel(pt(0), pt(1), 100)) End Sub
(Maybe it is possible to just change the mouse-cursor, but it doesn't 'lock' the selected item in the listbox, as if it was dragged into the drawing.)
can somebody please help me?
kind regards,
Wouter de Haan