Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

CATIA VBA macro for comparing 2 CATParts 8

Status
Not open for further replies.

22555

Automotive
Dec 17, 2003
24
0
0
US
Hi,

I wanted to write a catia macro for comparing 2 CATParts using SPA Analysis compare method.

Requirement
1: Macro should ask user to select 2 part.
2: Areas where both matches, should be in yellow color.

There are some sample code in documentation, but they are not working in CATIA V5R25. Will *.3DMap file work in R25? if not, what are the alternatives?

Dim var11(0)
var11(0) = "C:\Comparison\AddedMaterial" & myDate & ".3dmap"
products1.AddComponentsFromFiles var11, "*"

Thanks
 
Replies continue below

Recommended for you

Hi,

You can see differences using DMU license. If you have only an MD2/HD2 you can do it with a workaround....put both parts in a CATProduct and see bellow what it can be done using Boolean operations...

2017-03-08_16_46_59-_tydwmm.png


2017-03-08_16_47_53-Greenshot_vtgxpq.png


2017-03-08_16_48_14-CATIA_V5_-_Product1_AllCATPart_aeavxk.png




Regards
Fernando

- Romania
- EU
 
did you try compare product function?

2017-03-08_12-34-44_roha3d.png


if you're missing CATIA API, you can always use Win API to interact with the function.

Eric N.
indocti discant et ament meminisse periti
 
Thank you Fernando and Eric,

Very good information from both of you.

I was trying to figure out if there is any CATIA API to do visual comparison to avoid WIN API. Also there are annotation captures in both the versions of part. I need to compare solid along with annotation, take a grab and put into ppt.

So even if I go with WIN API, I am not sure if each capture can be compared along with solid differences.

Currently I am following few steps
1. Add both parts in product
2. change 1st part color to green
3. change 2nd part color to red
4. display capture one by one
5. take a screen shot.

But if there is not difference in annotations, color is only red. So brings the question if any text is removed in new version , is it hidden and not known?

If I move one of the part by .1,.1,.1, then I cannot compare solid correctly?

Please suggest

Thanks
22555
 
Hello All,

I tried using WinAPI to compare the products. Facing below issue. Please help

1. Able to get the handle for window "Compare Products"
2. Able to get the handle for listbox "Selector003"
3. But could not able to assign product1 in listbox selection. Tried with Objselection.add Product1. But didn't work. Incase if I go with mouse click event. How do I find the cursor position of product1 in spec tree?

I need help to find out how to assign the product1 and product2 selection in Selector003 and Selector006 boxes.

Capture_hfkoe8.jpg


Thanks in Advance
555
 
you select it then call center graph function?

did you try to add the instance name to the listbox then make it the selected item?

Eric N.
indocti discant et ament meminisse periti
 
Thank you

I tried to add instance name in listbox using LB_ADDSTRING and LB_SELECTSTRING functions,

- Instance name added to listbox and also selected
- Comboxbox appears in listbox and could see 2 items, Selected Instance name and "No Selection"
- But Preview button is not enabled.

Any suggestions would help,

Thanks
 
Status
Not open for further replies.
Back
Top