I am wondering what different use cases are for the Outline object vs the BoundingboxXYZ objects. They both seem to have a lot in common. They are both:
The API also seems to use the term 'outline' and 'boundingbox' interchangeably. For example:
So far, I've been using BoundingBoxXYZ for most of my BoundingBox logic. Only recently I discovered that the Outline object has helpful methods like 'Add', 'Contains', 'ContainsOtherOutline', 'Intersects'.
Are there any important distinctions between these two classes? Do they have different use cases? Basically, am I missing something here ๐ ?
I am thinking of replacing most of my BoundingBoxXYZ methods with Outline objects, and create a conversion method to go from Outline to BoundingBoxXYZ for the cases where you'd still need them (like assigning a section box to a 3d view).
I do not believe it is worthwhile changing too much. On one hand, never change a running system. On the other hand, I do not believe the Outline class is used as much as it might be. Check out this quite extensive discussion of the Outline class behaviour:
The Outline is almost the same BoundingboxXYZ, and I know some differences.
Not sure what the APIObject does, probably some internal reference for RevitAPI object.
I guess not having APIObject is better.
Hi @pieter1,
I have several functions that deal with elements in links in relation to the current model (AutoVoid cut, Area-To-Area/Room matching for datatransfer between them, validating contours etc).
On occasion it can happen that a link internal origin isn't placed in the internal origin of the active model or other combinations of mixed origins (or even rotated), For intersecion checking I create Solids and use SolidUtils.CreateTransformed to create a solid relative to the current model position (or the other way current model to the link's coordinates system/origin)
If you take a BoundingBox of that transformed Solid, the boundingbox transform origin isn't (always) 0,0,0 (depends on the transform applied)
So if you use the boundingbox limits to create a outline for BoundingBoxIntersectsFilter it doesn't check in the correct place for intersections.
Originally I only had to deal with models where the linked model were in eachother internal origin, but suddenly I got strange results, intersections where none where or a cut misaligned, the cause: internal origin and project base point of a link weren't the same. So years ago I added some extensions for BoundingBoxXYZ and outline elements along with a wrapper for some XYZ collecting and generating a BoundinBoxXYZ/Outline or even a solid.
Last year I updated one of the function to increase the speed of the Intersection detection and AutoCut of walls with heavy use of BoundingBoxIntersectsFilter, ElementIntersectsSolidFilter, SolidUtils and BooleanOperationsUtils to cut down the evaluation of 1000's of walls agains structural framing (or whatever) in another model (or own model) from about 30-60min to about 10sec. with around 600-800 detections.
So if you retrieve the BoundingBoxXYZ directly from elements and pass them to Revit API function there will be no need to correct the coordinates. But manipulated elements with transform will likely also have a boundingBoxXYZ with a transform origin not 0,0,0
Sorry, became a longer post than intended.
- Michel
Thank you this is very helpful!
My use cases does not need to work with links, which probably explains why this has not been an issue so far.
I too am planning to take more use of the builtin Revit API filters for boundingbox calculations (BoundingBoxIntersectsFilter specifically), which requires an Outline object as an argument, which is how I first ran into the Outline object.
I'm glad I asked the question here. I feel I have a better understanding of the nuances now. Thanks all!
Can't find what you're looking for? Ask the community or share your knowledge.