CarlosR2022
Electrical
- Sep 16, 2010
- 36
I have a big assembly with thousands of sub-assemblies and many parts. It has a very complex structure so I Explore it instead of Open the whole thing. I would like to write a macro to list the sub-assemblies that match my search condition. The issue is that even if the tree has the correct list highlighted, the `Selection` collection returns 0 count.
The code above should give me a list of everything, I see everything in the tree get highlighted but then when I try `oSel.Count`, I get `0` so I cannot use `oSel.Item(i).Value.Name` to get the list I want. Is there away to do this or it is not possible? It seems many things are not possible using the free VBA.
Code:
dim oSel as Selection
set oSel = CATIA.ActiveEditor.Selection
oSel.Search "Type=*,all"
The code above should give me a list of everything, I see everything in the tree get highlighted but then when I try `oSel.Count`, I get `0` so I cannot use `oSel.Item(i).Value.Name` to get the list I want. Is there away to do this or it is not possible? It seems many things are not possible using the free VBA.