/// <summary> /// Creates a Revit ViewSection by a specified corrdinate system, minPoint and maxPoint /// </summary> /// <param name="cs"></param> /// <param name="minPoint"></param> /// <param name="maxPoint"></param> /// <returns></returns> public static SectionView ByCoordinateSystemMinPointMaxPoint( Autodesk.DesignScript.Geometry.CoordinateSystem cs, Autodesk.DesignScript.Geometry.Point minPoint, Autodesk.DesignScript.Geometry.Point maxPoint) { return(new SectionView(GeometryPrimitiveConverter.ToRevitBoundingBox(cs, minPoint, maxPoint))); }
public void ToRevitBoundingBox_Method_PreservesValues() { var csOrigin = Point.ByCoordinates(1, 2, 3); var csX = Vector.ByCoordinates(0, 1, 0); var csY = Vector.ByCoordinates(0, 0, 1); var cs = CoordinateSystem.ByOriginVectors(csOrigin, csX, csY); var minPoint = Point.ByCoordinates(-2, -2, -2); var maxPoint = Point.ByCoordinates(2, 2, 2); Autodesk.Revit.DB.BoundingBoxXYZ boundingBoxXYZ = GeometryPrimitiveConverter.ToRevitBoundingBox( cs, minPoint, maxPoint); boundingBoxXYZ.Min.ShouldBeApproximately(minPoint.InHostUnits()); boundingBoxXYZ.Max.ShouldBeApproximately(maxPoint.InHostUnits()); boundingBoxXYZ.Transform.Origin.ShouldBeApproximately(csOrigin.InHostUnits()); boundingBoxXYZ.Transform.BasisX.ShouldBeApproximately(csX); boundingBoxXYZ.Transform.BasisY.ShouldBeApproximately(csY); }