Cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a 3D point on a 3D geometry using mouse?

Creator
Creator

Hello,

 

Just wondering if it is possible to use the mouse pointer to select a specific point on a 3D geomety part?

 

Thanks,

Jinglin

9 REPLIES

Re: How to select a 3D point on a 3D geometry using mouse?

Siemens Genius Siemens Genius
Siemens Genius

Hi.

I am sorry, the question is not clear. Can you refine?

 

Re: How to select a 3D point on a 3D geometry using mouse?

Creator
Creator

Hi OferOhayon,

 

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?

 

Regards,

Jinglin

 

Re: How to select a 3D point on a 3D geometry using mouse?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

Register to the static MouseDown and/or MouseUp events of TxGraphicViewer and check the event arguments.

Re: How to select a 3D point on a 3D geometry using mouse?

Creator
Creator

Hello Diana,

 

Can you provide more information on how to use TxGraphicViewer class?  Creating a user viewer class inherit from the TxGraphicViewer class? 

 

Thanks,

Jinglin

Re: How to select a 3D point on a 3D geometry using mouse?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Jinglin,

 

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.

 

Best Regards,

DianaG

 

Re: How to select a 3D point on a 3D geometry using mouse?

Legend
Legend

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!

Re: How to select a 3D point on a 3D geometry using mouse?

Creator
Creator

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?

 

Thanks,

Jinglin

 

 

Re: How to select a 3D point on a 3D geometry using mouse?

Siemens Phenom Siemens Phenom
Siemens Phenom

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. 

 

Best Regards,

Diana

Re: How to select a 3D point on a 3D geometry using mouse?

Creator
Creator

Thanks, that works!