+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Senior Member
    Using
    Map 3D 2007
    Join Date
    Sep 2009
    Posts
    142

    Default Convert mouse coordinates to drawing coordinates

    Registered forum members do not see this ad.

    Hi what'd like to do is to manipulate drawing objects in the drawing in real time with constant user input. I'don't want to perform a simpla move or rotation, but much more complicated changes to the drawing objects involved.

    The main point is that the user has to see the effect in the drawing of every little mouse movement immmediately. That's why I need to somehow from the position of the cursor in the drawing window get the corresponding coordinates in drawing units.

    I've tried

    Code:
    Private Declare Function GetCursorPos Lib "user32" _
    (lpPoint As POINTAPI) As Long
    but I couldn't even manage to correlate the returned coordinates with the bounds of a form, not to mention drawing units.

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,375

    Default

    Can you give us an example of what one of those "more complicated changes to the drawing objects" might be?

    Isn't "every little mouse movement" already conveyed to the user in the system tray via the coordinates (Relative, Absolute or Geographic) that are displayed there?

    Shouldn't the user be drawing everything in full size?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Senior Member
    Using
    Map 3D 2007
    Join Date
    Sep 2009
    Posts
    142

    Default

    The coordinates are not needed for the user, but for the macro to make the neccessary changes to the objects.

    But if there's a way to get the coordinates from the system tray that would be much better since then I don't have to bother with the mouse input.

  4. #4
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    I'm not sure anyone entirely understands what you're after, or what you are trying to do.
    The main point is that the user has to see the effect in the drawing of every little mouse movement immmediately.
    That happens anyway. Doesn't matter what you're doing, you see it as it happens. Maybe you could explain better what it is you want?
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

  5. #5
    Senior Member
    Using
    Map 3D 2007
    Join Date
    Sep 2009
    Posts
    142

    Default

    I don't understand what you don't understand. I need the position of the pointer inside the model view in drawing units, I can't explain it any better than that.

    I wish to create a macro that updates drawing objects while taking the cursor position into account.

    For example the mouse moves 10 drawing units to the east, then move entity A 10 units north and move entity B 5 units east, and rotate entity C by 5 degrees. Or whatever. The exact modifications are not important I just invented these numbers.

  6. #6
    Senior Member
    Using
    Map 3D 2007
    Join Date
    Sep 2009
    Posts
    142

    Default

    Anyway since I couldn't find a solution in reasonable time, I went with an easier solution for the original problem that doesn't involve the mouse coordinates, but I'm still interested if there's a way to get this information.

  7. #7
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by M76 View Post
    Anyway since I couldn't find a solution in reasonable time, I went with an easier solution for the original problem that doesn't involve the mouse coordinates, but I'm still interested if there's a way to get this information.
    While the topics are slightly different, this thread *may* provide at least a partial solution.

    HTH
    Last edited by BlackBox; 26th Aug 2011 at 12:08 pm.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  8. #8
    Senior Member
    Using
    Map 3D 2007
    Join Date
    Sep 2009
    Posts
    142

    Default

    grread does exactly what I wanted, its not vba but that's no problem

  9. #9
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by M76 View Post
    grread does exactly what I wanted, its not vba but that's no problem
    I'm glad the link was useful
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

Similar Threads

  1. Convert drawing coordinates
    By joshhill31 in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 21st Jan 2011, 02:35 pm
  2. convert units - retain coordinates
    By James1 in forum AutoCAD General
    Replies: 4
    Last Post: 11th Nov 2010, 09:45 am
  3. Drawing coordinates
    By babati in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 21st Sep 2010, 08:06 am
  4. convert the POINTS (X,Y,Z coordinates) into EXCEL
    By cadamrao in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 4th May 2010, 09:41 am
  5. formula to convert coordinates from one grid to another?
    By scubadoo in forum AutoCAD General
    Replies: 6
    Last Post: 7th Jul 2008, 12:16 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts