CarlosR2022
Electrical
- Sep 16, 2010
- 36
Let's say I pre-select a number of geometric elements in a 2D environment. This includes lines and texts. Now I want to have 2 distinct searches to get (1) lines then (2) texts/
Code:
'I selected a number of objects manually.
'because I want to limit my works on these objects only
dim preSelectedItems as Selection
dim selectedLines as Selection
dim selectedTexts as Selection
set preSelectedItems = CATIA.ActiveDocument.Selection
preSelectedItems.Search "Drafting.Line,sel"
set selectedLines = preSelectedItems '<~~~ this is fine
preSelectedItems.Search "Drafting.Text,sel"
set selectedTexts = preSelectedItems '<~~~ this is not ok because sel contains lines from 1st Search