I'm trying to allow the user to draw a rectangle on the screen that remains stationary as the model is moved, rotated, etc. Looking here (link), this code will draw a line from (0, 0) to (100, 100):
Point2D = Graphics.CreatePixelPoint
l1 = Graphics.Scene.Factory2D.CreatePolyline([Point2D(200, 200), Point2D(200, 300), Point2D(300, 300), Point2D(300, 200)])
l1.Closed = True
I'm now trying to get the location of a user's mouse click in the graphics window to enable him or her to specify the corners of the box. If I knew the dimensions and location on the screen of the graphics window, I think I could get the location of the mouse on the screen and work out from there the locations of the corners of the box. However, I don't know how to get the dimensions and location on the screen of the graphics window. Further, I think there's a decent chance that I'm missing something, and there's a means of directly obtaining the location of the cursor in the graphics window (i.e., without doing the math to convert the screen location of the mouse to the graphics window location).