Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Is Search.FindAll/FindIncremental deterministic, aka for example Depth first?

alexisDVJML
Collaborator

Is Search.FindAll/FindIncremental deterministic, aka for example Depth first?

alexisDVJML
Collaborator
Collaborator

Context: I need to build an internal tree of modelItems that are partitions

For now I do it programmatically, starting from root and recursively going down

However that means:
- I need to parse at least the child of each partition to know there is not a partition between them

- stopping there, I can miss some deeply partitions (unlikely but...)

 

A better approach would be to just do a Search for ClassName Equals @"LcOaPartition" and build the tree on the go

Can I rely on the FindAll/FindIncremental to return the found partitions in a deterministic order, aka depth first or flat first?

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes
Reply
320 Views
2 Replies
Replies (2)

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @alexisDVJML ,

 

I don't know for certain, but I would suspect that your current approach is the best.
I also don't think that you will have a LcOaPartition deeper in the tree, I think that they are always children of another LcOaPartition


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

alexisDVJML
Collaborator
Collaborator

Thanks Naveen.

 

I actually implemented the 2 approaches:
1/ recursively iterate the tree. Benefits I get an implicit tree which happen to be useful in my case
2/ do a search for all partitions first, arrange them in a tree (since I need to handle some kind of properties inheritance in our plugin), then do the processing.

Both work and give similar results in the models we are currently working on, typically these models contains anywhere between 1 and hundreds of partitions.

Approach 2 has a UX advantage: the pre-processing we do for each partitions is quite intensive, I can display and update an accurate progress bar since I do a FindAll for the partitions seach  😉

Thanks again.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go