Example #1
0
        /// <summary>
        /// Initialize a CurtainSystem element
        /// </summary>
        private void InitCurtainSystem(ReferenceArray faces, Autodesk.Revit.DB.CurtainSystemType curtainSystemType)
        {
            TransactionManager.Instance.EnsureInTransaction(Document);

            Autodesk.Revit.DB.CurtainSystem curtainSystem = ElementBinder.GetElementFromTrace <Autodesk.Revit.DB.CurtainSystem>(Document);

            ICollection <ElementId> ids = Document.Create.NewCurtainSystem2(faces, curtainSystemType);

            if (ids.Count > 1)
            {
                foreach (ElementId id in ids)
                {
                    Autodesk.Revit.DB.CurtainSystem system = (Autodesk.Revit.DB.CurtainSystem)Document.GetElement(id);
                    InitCurtainSystem(system);
                }
                return;
            }
            else
            {
                curtainSystem = (Autodesk.Revit.DB.CurtainSystem)Document.GetElement(ids.First());
            }

            InternalSetCurtainSystem(curtainSystem);

            TransactionManager.Instance.TransactionTaskDone();

            ElementBinder.CleanupAndSetElementForTrace(Document, InternalCurtainSystem);
        }
Example #2
0
        protected override void TrySolveInstance(IGH_DataAccess DA)
        {
            // grab input system type
            DB.CurtainSystemType curtainSystemType = default;
            if (!DA.GetData("Curtain System Type", ref curtainSystemType))
            {
                return;
            }

            // properties of the system type
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_PANEL, "Curtain Panel");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_JOIN_CONDITION, "Join Condition");

            // layout (vertical)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LAYOUT_VERT, "Grid 1 : Layout");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LENGTH_VERT, "Grid 1 : Spacing");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.CURTAINGRID_ADJUST_BORDER_VERT, "Grid 1 : Adjust for Mullion Size");

            // layout (horizontal)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LAYOUT_HORIZ, "Grid 2 : Layout");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LENGTH_HORIZ, "Grid 2 : Spacing");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.CURTAINGRID_ADJUST_BORDER_HORIZ, "Grid 2 : Adjust for Mullion Size");

            // mullion types(vertical)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_INTERIOR_GRID1, "Grid 1 Mullions : Interior Type");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER1_GRID1, "Grid 1 Mullions : Border 1 Type");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER2_GRID1, "Grid 1 Mullions : Border 2 Type");

            // mullion types (horizontal)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_INTERIOR_GRID2, "Grid 2 Mullions : Interior Type");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER1_GRID2, "Grid 2 Mullions : Border 1 Type");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER2_GRID2, "Grid 2 Mullions : Border 2 Type");
        }
Example #3
0
        protected override void TrySolveInstance(IGH_DataAccess DA)
        {
            // grab input system type
            DB.CurtainSystemType curtainSystemType = default;
            if (!DA.GetData("Curtain System Type", ref curtainSystemType))
            {
                return;
            }

            // properties of the system type
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_PANEL, "Curtain Panel Type");
            PipeHostParameter <Types.CurtainGridJoinCondition>(DA, curtainSystemType, DB.BuiltInParameter.AUTO_JOIN_CONDITION, "Curtain Grid Join Condition");

            // layout (vertical)
            PipeHostParameter <Types.CurtainGridLayout>(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LAYOUT_VERT, "Grid 1 Grid Layout (U Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LENGTH_VERT, "Grid 1 Grid Spacing (U Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.CURTAINGRID_ADJUST_BORDER_VERT, "Grid 1 Grid Adjust for Mullion Size? (U Axis)");

            // layout (horizontal)
            PipeHostParameter <Types.CurtainGridLayout>(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LAYOUT_HORIZ, "Grid 2 Grid Layout (V Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.SPACING_LENGTH_HORIZ, "Grid 2 Grid Spacing (V Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.CURTAINGRID_ADJUST_BORDER_HORIZ, "Grid 2 Grid Adjust for Mullion Size? (V Axis)");

            // mullion types(vertical)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_INTERIOR_GRID1, "Grid 1 Interior Mullion Type (U Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER1_GRID1, "Grid 1 Start Mullion Type (U Axis / Border 1)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER2_GRID1, "Grid 1 End Mullion Type (U Axis / Border 2)");

            // mullion types (horizontal)
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_INTERIOR_GRID2, "Grid 2 Interior Mullion Type (V Axis)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER1_GRID2, "Grid 2 Start Mullion Type (V Axis / Border 1)");
            PipeHostParameter(DA, curtainSystemType, DB.BuiltInParameter.AUTO_MULLION_BORDER2_GRID2, "Grid 2 End Mullion Type (V Axis / Border 2)");
        }
Example #4
0
 /// <summary>
 /// Private constructor
 /// </summary>
 private CurtainSystem(ReferenceArray faces, Autodesk.Revit.DB.CurtainSystemType curtainSystemType)
 {
     SafeInit(() => InitCurtainSystem(faces, curtainSystemType));
 }