Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

3Dx: How can I get the names of selected parts when open assembly with Explore option?

Status
Not open for further replies.

CarlosR2022

Electrical
Joined
Sep 16, 2010
Messages
36
Location
US
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.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top