private ISectionProperty GetTaperedSectionProperty(ISectionProperty startSectionProperty, ISectionProperty endSectionProperty) { if (startSectionProperty.Material.Name != endSectionProperty.Material.Name) { Engine.Base.Compute.RecordWarning("Tapered section mixes materials. Only material from start of section is used"); } oM.Spatial.ShapeProfiles.IProfile taperProfile = null; if (startSectionProperty.Material.GetType() == typeof(Steel)) { SteelSection startSection = startSectionProperty as SteelSection; SteelSection endSection = endSectionProperty as SteelSection; taperProfile = BH.Engine.Spatial.Create.TaperedProfile(startSection.SectionProfile, endSection.SectionProfile); taperProfile.Name = "TaperedProfile-" + startSection.Name + "-To-" + endSection.Name; } if (startSectionProperty.Material.GetType() == typeof(Concrete)) { ConcreteSection startSection = startSectionProperty as ConcreteSection; ConcreteSection endSection = endSectionProperty as ConcreteSection; taperProfile = BH.Engine.Spatial.Create.TaperedProfile(startSection.SectionProfile, endSection.SectionProfile); taperProfile.Name = "TaperedProfile-" + startSection.Name + "-To-" + endSection.Name; } if (startSectionProperty.Material.GetType() == typeof(Timber)) { TimberSection startSection = startSectionProperty as TimberSection; TimberSection endSection = endSectionProperty as TimberSection; taperProfile = BH.Engine.Spatial.Create.TaperedProfile(startSection.SectionProfile, endSection.SectionProfile); taperProfile.Name = "TaperedProfile-" + startSection.Name + "-To-" + endSection.Name; } return(BH.Engine.Structure.Create.SectionPropertyFromProfile(taperProfile, startSectionProperty.Material)); }
public static string Description(this TimberSection section) { if (section == null) { return("null section"); } return("Timber " + section.SectionProfile.IDescription() + " - " + CheckGetMaterialName(section.Material)); }
public static TimberSection TimberSectionFromProfile(IProfile profile, Timber material = null, string name = "") { //Run pre-process for section create. Calculates all section constants and checks name of profile var preProcessValues = PreProcessSectionCreate(name, profile); name = preProcessValues.Item1; profile = preProcessValues.Item2; Dictionary <string, double> constants = preProcessValues.Item3; TimberSection section = new TimberSection(profile, constants["Area"], constants["Rgy"], constants["Rgz"], constants["J"], constants["Iy"], constants["Iz"], constants["Iw"], constants["Wely"], constants["Welz"], constants["Wply"], constants["Wplz"], constants["CentreZ"], constants["CentreY"], constants["Vz"], constants["Vpz"], constants["Vy"], constants["Vpy"], constants["Asy"], constants["Asz"]); return(PostProcessSectionCreate(section, name, material, MaterialType.Timber)); }
/***************************************************/ private IFAttribute CreateSection(TimberSection sectionProperty) { IFGeometricLine lusasGeometricLine = null; if (sectionProperty.SectionProfile != null) { lusasGeometricLine = d_LusasData.createGeometricLine(sectionProperty.DescriptionOrName()); lusasGeometricLine.setValue("elementType", "3D Thick Beam"); if (CreateProfile(sectionProperty.DescriptionOrName(), sectionProperty.SectionProfile as dynamic)) { if (!(sectionProperty.SectionProfile is TaperedProfile)) { lusasGeometricLine.setFromLibrary("User Sections", "Local", sectionProperty.DescriptionOrName(), 0, 0); } } } return(lusasGeometricLine); }