Element Iteration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The company I work for uses Revit for pipework primarily. I have been trying to find a way to iterate through each element in the pipeline to automatically place hangers. When adding elements to a list it seems the RevitAPI likes to order the list by ascending element Id. If the user decides to add a element in between two other previously placed elements then this list is technically out of order for my purpose.
I havent found a super solid way to iterate from part to part, but the way I am iterating from part to part now is by ordering a list of tuples(FabPart and XYZ(origin)) by its X then by its Y and creating a new list from this.
I can then iterate through this new list in the correct-ish(Emphasis on the "-ish") order.
The iteration aspect of this project has proven to be more difficult than expected, how do you guys accomplish similar results to situations like this?
P.S. In the snippet I supplied I am aware this will only work for pipe. I am still very early on in this project, trying to mitigate confusion!