I would like to create a scan criteria that will scan all levels except for a specific level. I know that I can exclude all levels, and then add individual levels to the scan criteria, but what if I don't know all of the levels that exist because they vary from file to file?
Put another way... if a file has 63 levels, and I want to scan all of the levels except for level 1, is there a way to define the scan criteria without excluding all levels and then adding levels 2-63 individually to the scan?
What I would really like is a scan criteria like: oScanCriteria.OmitLevel oLevel
Is there anything like this, or another way to do this?
Hi,
if it will be always one level only (or just a few) that should be excluded from scanning, I think it's easier to scan all levels and test and skip elements from the "should be excluded level" during iterating through resulting element enumerator.
Of course you can also exclude all levels from the criteria, in the next step to iterate through all levels in a model (using for each construction) and add levels one by one back to the criteria, but it looks like more code for the same result to me.
With regards,
JAn
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: JJ Wutt
I see.... So scan all levels and then if an element is on the level I want to omit I could just move to the next element and skip it.
Thanks!