Jump to content

Convert mouse coordinates to drawing coordinates


M76

Recommended Posts

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

 

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :wink:

 

HTH

Edited by BlackBox
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...