CATIA CAA API Help – 9

esponse to : Getting mouse click coordinates
Subject : Getting mouse click coordinates

I think Indication agent works only in drawing. Hence try to use CATPathElement agent. And to get the x.y coordinate on screen use CATGraphicPathElement. The snippet of code is as below.
CATGraphicPathElement *graph_path = (CATGraphicPathElement *)sel_path;
CATGraphicElementIntersection *graph_intersection =
(CATGraphicElementIntersection *)graph_path->FindElement(CATGraphicElementIntersection::ClassId());
CATMathPoint intersection_point = graph_intersection->point;

Original message :
Hello, I’m using an indication agent to get the x,y point of the mouse click. Does anyone know
how to find out what element I’ve selected with that mouse click without declaring another agent? Or if I select an element, how do I get the x,y of the mouse?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s