Thank you for your reply.
My question is could it possible for example, click on the surface of a 3D geometry part using the mouse and obtain the 3D coordinates of that point?
Can you provide more information on how to use TxGraphicViewer class? Creating a user viewer class inherit from the TxGraphicViewer class?
TxGraphicViewer class represents an instance of the Graphic Viewer window - we support more than one.
You cannot inherit that class and make your own Graphic Viewer.
//Get the active Graphic Viewer TxGraphicViewer activeGV = TxApplication.ViewersManager.GraphicViewer; //Get all open Graphic Viewers List<TxGraphicViewer> gvViewers = TxApplication.ViewersManager.GraphicViewers;
Mouse events are static and they are fired for every Graphic Viewer.
Ok, but the mouse events only provide the x and y coordinates from one corner (upper left ?) of a graphic viewer window.
My understanding from Jinglins question is, whether it is possible to click somewhere on an object and to get the x, y and z coordinates of that clicked spot relative to the origin of the object / origin of the study / working frame!
that is right, I want to use the Mouse to click and pick a point and read its 3D coordinate relative to its current working frame. The Mouse down Event only gives me a 2D coordinates. Any further suggestions?
I noticed that there is already some coordinate information on the bottom-right corner, when I click componets in the graphic viewer (by the side of Standard Mode, Snap Pick Intent, Component Pick Level , ...). Is it possible to read the coordinates directly through .Net API?
Then use the GetLastPickedLocation() of TxSelection. It returns TxTransformation object in world coordinates. You can then calculate the relative coordinates to the working frame (TxTransformation.LocationRelativeToWorkingFrame).
TxSelection also provides GetLastPickedItem() that returns ITxObject.