コード例 #1
0
        protected override void TrySolveInstance(IGH_DataAccess DA)
        {
            // get input
            Types.DataObject <DB.CompoundStructure> dataObj = default;
            if (!DA.GetData("Compound Structure", ref dataObj))
            {
                return;
            }

            DB.CompoundStructure cstruct = dataObj.Value;

            // Deconstruct the data object into output params
            DA.SetData("Width", cstruct.GetWidth());
            DA.SetDataList("Layers", cstruct.GetLayers().Select(x => new Types.DataObject <DB.CompoundStructureLayer>(apiObject: x, srcDocument: dataObj.Document)).ToList());
            DA.SetData("Layer Count", cstruct.LayerCount);
            DA.SetData("Cutoff Height", cstruct.CutoffHeight);
            DA.SetData("End Cap Condition", new Types.EndCapCondition(cstruct.EndCap));
            DA.SetData("Has Structural Deck", cstruct.HasStructuralDeck);
            DA.SetData("Is Vertically Compound", cstruct.IsVerticallyCompound);
            DA.SetData("Sample Height", cstruct.SampleHeight);
            DA.SetData("Minimum Sample Height", cstruct.MinimumSampleHeight);
            DA.SetData("Opening Wrapping Condition", new Types.OpeningWrappingCondition(cstruct.OpeningWrapping));
            DA.SetData("Structural Material Index", cstruct.StructuralMaterialIndex);
            DA.SetData("Variable Layer Index", cstruct.VariableLayerIndex);
            DA.SetData("First Core Layer Index", cstruct.GetFirstCoreLayerIndex());
            DA.SetData("Last Core Layer Index", cstruct.GetLastCoreLayerIndex());
            DA.SetData("Minimum Allowable Layer Thickness", DB.CompoundStructure.GetMinimumLayerThickness());
        }
コード例 #2
0
        /// <summary>
        /// Returns a list of dictionaries with Autodesk.Revit.DB.CompoundStructureLayer properties.
        /// </summary>
        /// <param name="cs">Autodesk.Revit.DB.CompoundStructure</param>
        /// <param name="doc">Autodesk.Revit.DB.Document</param>
        /// <returns></returns>
        internal static cg.IList <cg.Dictionary <string, object> > _GetLayers(revitCS cs, revitDoc doc)
        {
            cg.IList <cg.Dictionary <string, object> > layers = new cg.List <cg.Dictionary <string, object> >();

            foreach (revitCSLayer layer in cs.GetLayers())
            {
                layers.Add(_RevitLayerToDictionary(layer, doc));
            }

            return(layers);
        }
コード例 #3
0
        public SerialCompoundStructure(RevitCS CompoundStructure,
                                       [DefaultArgument("Synthetic.Revit.Document.Current()")] RevitDoc Document)
        {
            this.Layers     = new List <SerialCompoundStructureLayer>();
            this.WallSweeps = new List <string>();
            IList <RevitCSLayer> csLayers = CompoundStructure.GetLayers();

            foreach (RevitCSLayer csLayer in csLayers)
            {
                this.Layers.Add(new SerialCompoundStructureLayer(csLayer, Document));
            }
        }
コード例 #4
0
        public RevitCS CreateCompoundStructure(
            [DefaultArgument("Synthetic.Revit.Document.Current()")] RevitDoc Document)
        {
            IList <RevitCSLayer> csLayers = new List <RevitCSLayer>();

            foreach (SerialCompoundStructureLayer layer in this.Layers)
            {
                csLayers.Add(layer.CreateCompoundStructureLayer(Document));
            }

            RevitCS cs = RevitCS.CreateSimpleCompoundStructure(csLayers);

            return(cs);
        }
コード例 #5
0
ファイル: WallType.cs プロジェクト: andradam75/Synthetic
        /// <summary>
        /// Gets the compound structure from a wall type.
        /// </summary>
        /// <param name="WallType">A Dynamo wrapped Revit.WallType</param>
        /// <returns name="CompoundStructure">A Compound Structure</returns>
        public static CompoundStructure GetCompoundStructure(dynaWallType WallType)
        {
            revitDB.WallType unwrappedWall     = (revitDB.WallType)WallType.InternalElement;
            revitDoc         document          = unwrappedWall.Document;
            revitCS          compoundStructure = unwrappedWall.GetCompoundStructure();

            if (compoundStructure != null)
            {
                return(new CompoundStructure(compoundStructure, document));
            }
            else
            {
                return(null);
            }
        }
コード例 #6
0
        /// <summary>
        /// Creates a compound structure from a wall type.
        /// </summary>
        /// <param name="wallType">A Dynamo wrapped Revit.WallType.</param>
        /// <param name="document">An unwrapped document associated with the CompoundStructure.</param>
        /// <returns name="compoundStructure">A Compound Structure.</returns>
        public static CompoundStructure FromWallType(dynamoElements.WallType wallType,
                                                     [DefaultArgument("Synthetic.Revit.Document.Current()")] revitDoc document)
        {
            revitDB.WallType unwrappedWall     = (revitDB.WallType)wallType.InternalElement;
            revitCS          compoundStructure = unwrappedWall.GetCompoundStructure();

            if (compoundStructure != null)
            {
                return(new CompoundStructure(compoundStructure, document));
            }
            else
            {
                return(null);
            }
        }
コード例 #7
0
 /// <summary>
 /// Constructs a CompoundStructure given a Autodesk.Revit.DB.CompoundStructure and a Autodesk.Revit.DB.Document
 /// </summary>
 /// <param name="cs">Autodesk.Revit.DB.CompoundStructure</param>
 /// <param name="doc">Autodesk.Revit.DB.Document</param>
 internal CompoundStructure(revitCS cs, revitDoc doc)
 {
     internalCompoundStructure = cs;
     internalDocument          = doc;
 }
コード例 #8
0
 /// <summary>
 /// Given a Autodesk.Revit.DB.CompoundStructure, creates a Synthetic.Revit.CompoundStructure.
 /// </summary>
 /// <param name="compoundStructure">A Autodesk.Revit.DB.CompoundStructure</param>
 /// <param name="document">An unwrapped document associated with the CompoundStructure.</param>
 /// <returns name="compoundStructure">A Compound Structure.</returns>
 public static CompoundStructure Wrap(revitCS compoundStructure,
                                      [DefaultArgument("Synthetic.Revit.Document.Current()")] revitDoc document)
 {
     return(new CompoundStructure(compoundStructure, document));
 }