![]() ![]() # Given an origin and three vectors representing the direction and lengths of three dimensions, Return ep1 if ep2.IsAlmostEqualTo(endPoint) else ep2 if ep1.IsAlmostEqualTo(endPoint) else None # Given a line and one of its end points, return the other end point. Return list(scopeBox.get_Geometry(Options())) # Get a list of lines representing the scope box geometry. Return xyz.Normalize().IsAlmostEqualTo(XYZ.BasisZ) # Determine if the vector represented by an XYZ value is oriented vertically up (parallel to the Z axis). Return (XYZ.BasisZ).IsAlmostEqualTo(XYZ.Zero) # Determine if the line is vertical (parallel to the Z axis). ![]() Return line.get_EndPoint(0 if > 0 else 1) # Get the line endpoint that has the lowest Z value. The fixed version of the code handles this case perfectly.įor reference, here's a similar implementation in Python that does not rely on supplying a view direction to the function (copy and paste to an editor or view source to see the truncated lines in full): Your code does indeed appear to work, at least the version that uses the GetSectionBoundingBoxFromScopeBox method.Īn example that exhibits the bug in question is if you move the scope box away from the origin and / or rotate the scope box around the Z axis so that it no longer aligns to the X and Y axes. The full new source code, Visual Studio solution and add-in manifest.ĭan very kindly checked that the new setting is correct and adds: Since several others tried to use the code and it appears to be of general interest, I took this opportunity to fix the error and update the add-in for Revit 2014. I believe changing the offending line to the following makes both of your solutions work in all cases: This is probably why people were having trouble getting this code to work correctly for the general case. What that gives you is the maximum point in world space when it should be the maximum point in the local space of the bounding box. I think you'll find there's a bug in both versions of your code above where you're setting the bounding box maximum to the sum of the three basis vectors. Point out an error in the code presented there: How to set the exact geometric location, size and orientation of the 3D view section box.How to retrieve the exact geometric location, size and orientation of the scope box.Even if you snap to elements, it is easy to make an error.Setting the view section box to match its scope box, If someone types in an angle that is not to a whole degree, it will almost certainly not be the same as the actual rotation of the building elements. When rotating a view, the simplest method is to make the view crop boundaries visible, then select the boundary and use the rotate command. If this is a fraction of a degree out, you will end up with all kinds of tiny but incremental differences that will surely cause problems. It may seem trivial but it is actually important that rotated plan views are at exactly the same angle as the part of the building they are displaying - this is so that the view-based orthogonal directions match the building. ![]() Here is a quick fix for accurately rotating plan views where someone has rotated a plan view incorrectly. Following an earlier post on correcting the rotation of section views in Revit, I recently saved someone lots of time with this simple advice: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |