CATIA VBA macro for comparing 2 CATParts
CATIA VBA macro for comparing 2 CATParts
(OP)
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
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





RE: CATIA VBA macro for comparing 2 CATParts
Regards,
Jenia Ladkov
RE: CATIA VBA macro for comparing 2 CATParts
Yes, SPA license may be required.
Thanks
RE: CATIA VBA macro for comparing 2 CATParts
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...
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA VBA macro for comparing 2 CATParts
if you're missing CATIA API, you can always use Win API to interact with the function.
indocti discant et ament meminisse periti
RE: CATIA VBA macro for comparing 2 CATParts
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
RE: CATIA VBA macro for comparing 2 CATParts
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA VBA macro for comparing 2 CATParts
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.
Thanks in Advance
555
RE: CATIA VBA macro for comparing 2 CATParts
did you try to add the instance name to the listbox then make it the selected item?
indocti discant et ament meminisse periti
RE: CATIA VBA macro for comparing 2 CATParts
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