Example #1
0
        /// <summary>
        /// Create from existing Element
        /// </summary>
        /// <param name="plan"></param>
        /// <param name="isRevitOwned"></param>
        /// <returns></returns>
        internal static FloorPlanView FromExisting(Autodesk.Revit.DB.ViewPlan plan, bool isRevitOwned)
        {
            if (plan == null)
            {
                throw new ArgumentNullException("plan");
            }

            return(new FloorPlanView(plan)
            {
                IsRevitOwned = isRevitOwned
            });
        }
Example #2
0
        public void LongestOfShortestExitPaths_ValidArgOneReturn()
        {
            Autodesk.Revit.DB.ViewPlan defaultView = (Autodesk.Revit.DB.ViewPlan)GetDefaultViewPlan();

            var longestOfShortestPaths = PathOfTravel.LongestOfShortestExitPaths(
                defaultView.ToDSType(true) as FloorPlanView,
                new Point[] { Point.ByCoordinates(23.349, 2.508, 3.625),
                              Point.ByCoordinates(12.892, 7.285, 3.625) });

            Assert.NotNull(longestOfShortestPaths);
            Assert.AreEqual(1, longestOfShortestPaths.Length);
            Assert.NotNull(longestOfShortestPaths[0]);

            int boudingBoxTest = longestOfShortestPaths[0].BoundingBox.ToString().CompareTo(
                "BoundingBox(MinPoint = Point(X = 23.349, Y = -46.619, Z = 0.000), MaxPoint = Point(X = 62.349, Y = 2.508, Z = 0.000))");

            Assert.AreEqual(0, boudingBoxTest);
        }
Example #3
0
        public void LongestOfShortestExitPaths_ValidArgTwoReturns()
        {
            Autodesk.Revit.DB.ViewPlan defaultView = (Autodesk.Revit.DB.ViewPlan)GetDefaultViewPlan();

            var longestOfShortestPaths = PathOfTravel.LongestOfShortestExitPaths(
                defaultView.ToDSType(true) as FloorPlanView,
                new Point[] { Point.ByCoordinates(12.892, -7.285, 3.625),
                              Point.ByCoordinates(33.806, -7.285, 3.625) });

            Assert.NotNull(longestOfShortestPaths);
            Assert.AreEqual(2, longestOfShortestPaths.Length);
            Assert.NotNull(longestOfShortestPaths[0]);
            Assert.NotNull(longestOfShortestPaths[1]);

            int boudingBoxTest1 = longestOfShortestPaths[0].BoundingBox.ToString().CompareTo(
                "BoundingBox(MinPoint = Point(X = 33.806, Y = -7.285, Z = 0.000), MaxPoint = Point(X = 62.349, Y = 31.965, Z = 0.000))");

            int boudingBoxTest2 = longestOfShortestPaths[1].BoundingBox.ToString().CompareTo(
                "BoundingBox(MinPoint = Point(X = -16.235, Y = -7.285, Z = 0.000), MaxPoint = Point(X = 12.892, Y = 31.965, Z = 0.000))");

            Assert.AreEqual(0, boudingBoxTest1);
            Assert.AreEqual(0, boudingBoxTest2);
        }
Example #4
0
 private void InternalSetViewPlan(Autodesk.Revit.DB.ViewPlan view)
 {
     InternalViewPlan  = view;
     InternalElementId = view.Id;
     InternalUniqueId  = view.UniqueId;
 }
Example #5
0
 /// <summary>
 /// Set the InternalViewPlan property and the associated element id and unique id
 /// </summary>
 /// <param name="plan">ViewPlan</param>
 protected void InternalSetPlanView(Autodesk.Revit.DB.ViewPlan plan)
 {
     InternalViewPlan  = plan;
     InternalElementId = plan.Id;
     InternalUniqueId  = plan.UniqueId;
 }
Example #6
0
 /// <summary>
 /// Initialize a FloorPlanView element
 /// </summary>
 private void InitFloorPlanView(Autodesk.Revit.DB.ViewPlan view)
 {
     InternalSetPlanView(view);
 }
Example #7
0
 /// <summary>
 /// Create a Revit Floor Plan from Autodesk View Plan
 /// </summary>
 private FloorPlanView(Autodesk.Revit.DB.ViewPlan view)
 {
     SafeInit(() => InitFloorPlanView(view));
 }
Example #8
0
 /// <summary>
 /// Private constructor
 /// </summary>
 private AreaPlanView(Autodesk.Revit.DB.ViewPlan view)
 {
     SafeInit(() => InitAreaPlanView(view));
 }