elmundo777
Automotive
- Jun 23, 2020
- 93
Hello. I cannot solve the issue with the selection of several objects.
I'm search for an element by its name. Then I need to add to the selected items.
Here example how I search all elements from active document:
But i need a custom selection by partnumber\instance name.
Here example how I search the element by instancename:
How can i add next element to selection?
This option is not suitable, since I need to add an object, not a string
But how to go from string to object?
<--this is wrong
I'm search for an element by its name. Then I need to add to the selected items.
Here example how I search all elements from active document:
Code:
dim cad = CATIA.ActiveDocument
dim sel = cad.Selection
sel.Search( "CATAsmSearch.Product+CATAsmSearch.Part,all")
But i need a custom selection by partnumber\instance name.
Here example how I search the element by instancename:
Code:
sel.Search( "Name=" & nameWithoutExt & ".1" & ",all")
How can i add next element to selection?
This option is not suitable, since I need to add an object, not a string
But how to go from string to object?
Code:
sel.Add(nameWithoutExt)