Macro - extract CAT.Products names from tree.
Macro - extract CAT.Products names from tree.
(OP)
Hello all,
Here is the situation.
In CATIA i have a CAT.Product that contains other Products(those are containing also other products.)
I need to extract the names of all products wich are starting with "R" lettter from my tree.The problem is that the "R" products can be found at different expanesion levels of the tree.
I have uploaded a picture that depicts what i want to mean.
Thank you for your time.
Here is the situation.
In CATIA i have a CAT.Product that contains other Products(those are containing also other products.)
I need to extract the names of all products wich are starting with "R" lettter from my tree.The problem is that the "R" products can be found at different expanesion levels of the tree.
I have uploaded a picture that depicts what i want to mean.
Thank you for your time.





RE: Macro - extract CAT.Products names from tree.
indocti discant et ament meminisse periti
RE: Macro - extract CAT.Products names from tree.
You can use also Search name criteria, all, starting with R* (it doesn't matter the level....) and get all the items...
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Macro - extract CAT.Products names from tree.
After i read the reply of "itsmyjob" i have searched for recursive script for catia tree structure and i have found some userfull info.
Some info were wrong from the first time : there are product with names starting with : "C","_","M","G" and 12313R (The "R" is not at the begining but is the 10'th character). By the way all the products that i am interested in have names starting with numbers.
I managed to write some code and when running the script i can prompt all the names (and some properties) of all the products that i am interested in and also adding them
in to the selection.
CODE --> VB
sometimes i must compare them from catia with an excel file that has allready data, and hide the ones that are not found in excel.
I don't know where to write the code to open the excel and complete or verify becouse of the recursive function.I have tried earlier and i got computer and catia crashed after it opened me 360 excell workbooks. (opened one each time he found a good product)
RE: Macro - extract CAT.Products names from tree.
If Instr(oPart.Name, "R") = 1 then
DoSomething
End If
RE: Macro - extract CAT.Products names from tree.