Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia Macro: Get Screen Coordinates of All items in Drawing View

Status
Not open for further replies.

jagandeep

Automotive
May 27, 2013
82
IN
I am in the process of creating BOM Ballons Macro. I am doing it hard way i.e.

1.Start.Command "Balloon"
2. Move Mouse Cursor to Drawing View Area (SetCursorPos WinApi)
3. Simulate Click Event (mouse_event WinApi)
4. Move Mouse Again
5. Simulate Click Event
6. Sendkeys "{Enter}"

I need to do it for each and every item for which I have to create balloons. Now the problem is how to get screen co-ordinates (i.e. x,y coordinates from top left of monitor screen) for each and every part for balloon creation ?

See Attached Picture for more info

Is it possible somehow ?? Please help.
 
Replies continue below

Recommended for you

Hello JajAndeep,

Here are some thoughts on how you can deel with your problem. You need to use Windows API functions and a programming language which can deal with graphics (.NET languages can do that).

Step O: Create two Bitmap object (lets call them Base and Aux)and store an image of your drawing area in Base. Start Ballon command.
Step 1: Move mouse to the first/next black pixel of Base. On the screen some pixels will turn to orange color.
Step 2: Store an image of your drawing area in Aux.
Step 3. Compare Aux to Base and set the changed pixels to a specific, but in each loop different, color in Base.
Step 4. Loop to Step 1 until end of Base object.
Step 5. For each different color in Base choose a pixel and click on it.

(In the past I used a graphics processing method to deal with the Specification Tree of CATIA.)

I hope it helps.


-GEL

Imposible is nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top