示例#1
0
        /***************************************************/
        /****               Public Methods              ****/
        /***************************************************/

        public static Column ColumnFromRevit(this FamilyInstance familyInstance, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            settings = settings.DefaultIfNull();

            Column column = refObjects.GetValue <Column>(familyInstance.Id);

            if (column != null)
            {
                return(column);
            }

            oM.Geometry.ICurve      locationCurve = familyInstance.LocationCurveColumn(settings);
            IFramingElementProperty property      = familyInstance.FramingElementProperty(settings, refObjects);

            column = BH.Engine.Physical.Create.Column(locationCurve, property, familyInstance.Name);

            //Set identifiers, parameters & custom data
            column.SetIdentifiers(familyInstance);
            column.CopyParameters(familyInstance, settings.ParameterSettings);
            column.SetProperties(familyInstance, settings.ParameterSettings);

            refObjects.AddOrReplace(familyInstance.Id, column);
            return(column);
        }
示例#2
0
        /***************************************************/
        /****               Public Methods              ****/
        /***************************************************/

        public static Beam BeamFromRevit(this FamilyInstance familyInstance, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            settings = settings.DefaultIfNull();

            Beam beam = refObjects.GetValue <Beam>(familyInstance.Id);

            if (beam != null)
            {
                return(beam);
            }

            oM.Geometry.ICurve      locationCurve = familyInstance.LocationCurveFraming(settings);
            IFramingElementProperty property      = familyInstance.FramingElementProperty(settings, refObjects);

            beam = BH.Engine.Physical.Create.Beam(locationCurve, property, familyInstance.Name);

            //Set identifiers, parameters & custom data
            beam.SetIdentifiers(familyInstance);
            beam.CopyParameters(familyInstance, settings.ParameterSettings);
            beam.SetProperties(familyInstance, settings.ParameterSettings);

            refObjects.AddOrReplace(familyInstance.Id, beam);
            return(beam);
        }