/***************************************************/ /**** Private methods ****/ /***************************************************/ private List <ISurfaceProperty> ReadSurfaceProperty(List <int> ids = null) { int uID = 1; int err = 0; List <ISurfaceProperty> propertyList = new List <ISurfaceProperty>(); int[] propCount = new int[St7.kMaxEntityTotals - 1]; int[] propLastNumbers = new int[St7.kMaxEntityTotals - 1]; err = St7.St7GetTotalProperties(uID, propCount, propLastNumbers); if (!St7Error(err)) { return(propertyList); } int numberOfPlateProps = propCount[St7.ipPlatePropTotal]; for (int pp = 0; pp < numberOfPlateProps; pp++) { int propNumber = 0; err = St7.St7GetPropertyNumByIndex(uID, St7.ptPLATEPROP, pp + 1, ref propNumber); if (!St7Error(err)) { return(propertyList); } int plateType = 0; int materialType = 0; err = St7.St7GetPlatePropertyType(uID, propNumber, ref plateType, ref materialType); if (!St7Error(err)) { return(propertyList); } StringBuilder propertyName = new StringBuilder(St7.kMaxStrLen); err = St7.St7GetPropertyName(uID, St7.ptPLATEPROP, propNumber, propertyName, St7.kMaxStrLen); if (!St7Error(err)) { return(propertyList); } IMaterialFragment material = GetPlateIsotropicMaterial(propNumber); if ((St7PlateType)plateType == St7PlateType.LoadPatch) { LoadingPanelProperty loadingPanelProperty = new LoadingPanelProperty(); loadingPanelProperty.Name = propertyName.ToString(); SetAdapterId(loadingPanelProperty, propNumber); loadingPanelProperty.CustomData["ShellType"] = (St7PlateType)plateType; propertyList.Add(loadingPanelProperty); } else { double[] plateThickness = new double[2]; err = St7.St7GetPlateThickness(uID, propNumber, plateThickness); if (!St7Error(err)) { return(propertyList); } ConstantThickness panelConstant = new ConstantThickness(); panelConstant.Name = propertyName.ToString(); SetAdapterId(panelConstant, propNumber); panelConstant.Material = material; panelConstant.Thickness = plateThickness[1]; // here is bending thickness panelConstant.PanelType = PanelType.Undefined; panelConstant.CustomData["ShellType"] = (St7PlateType)plateType; propertyList.Add(panelConstant); } } return(propertyList); }
/***************************************************/ /**** Private methods ****/ /***************************************************/ private List <ISectionProperty> ReadSectionProperties(List <int> ids = null) { int err = 0; List <ISectionProperty> beamSections = new List <ISectionProperty>(); int[] propCount = new int[St7.kMaxEntityTotals - 1]; int[] propLastNumbers = new int[St7.kMaxEntityTotals - 1]; err = St7.St7GetTotalProperties(1, propCount, propLastNumbers); if (!St7Error(err)) { return(beamSections); } int numberOfBeamProps = propCount[St7.ipBeamPropTotal]; for (int pp = 0; pp < numberOfBeamProps; pp++) { int propNumber = 0; err = St7.St7GetPropertyNumByIndex(1, St7.ptBEAMPROP, pp + 1, ref propNumber); if (!St7Error(err)) { return(beamSections); } int sectionTypeVar = 0; double[] dimArray = new double[6]; StringBuilder propertyName = new StringBuilder(St7.kMaxStrLen); err = St7.St7GetBeamSectionGeometry(1, propNumber, ref sectionTypeVar, dimArray); if (!St7Error(err)) { return(beamSections); } err = St7.St7GetPropertyName(1, St7.ptBEAMPROP, propNumber, propertyName, St7.kMaxStrLen); if (!St7Error(err)) { return(beamSections); } IMaterialFragment material = GetBeamPropertyMaterial(propNumber); IProfile sectionProfile; switch (sectionTypeVar) { case St7.bsNullSection: sectionProfile = null; break; case St7.bsCircularSolid: sectionProfile = Engine.Spatial.Create.CircleProfile(dimArray[0]); break; case St7.bsCircularHollow: sectionProfile = BH.Engine.Spatial.Create.TubeProfile(dimArray[0], dimArray[3]); break; case St7.bsSquareSolid: sectionProfile = BH.Engine.Spatial.Create.RectangleProfile(dimArray[1], dimArray[0], 0); break; case St7.bsSquareHollow: sectionProfile = BH.Engine.Spatial.Create.FabricatedBoxProfile(dimArray[1], dimArray[0], dimArray[4], dimArray[3], dimArray[3], 0); break; case St7.bsTSection: sectionProfile = BH.Engine.Spatial.Create.TSectionProfile(dimArray[1], dimArray[0], dimArray[4], dimArray[3], 0, 0); break; case St7.bsLipChannel: sectionProfile = BH.Engine.Spatial.Create.ChannelProfile(dimArray[1], dimArray[0], dimArray[4], dimArray[3], 0, 0); break; case St7.bsTopHatChannel: sectionProfile = null; break; case St7.bsISection: sectionProfile = BH.Engine.Spatial.Create.FabricatedISectionProfile(dimArray[2], dimArray[0], dimArray[1], dimArray[5], dimArray[3], dimArray[4], 0); break; case St7.bsLSection: sectionProfile = BH.Engine.Spatial.Create.AngleProfile(dimArray[1], dimArray[0], dimArray[4], dimArray[3], 0, 0); break; case St7.bsZSection: sectionProfile = BH.Engine.Spatial.Create.ZSectionProfile(dimArray[2], dimArray[0], dimArray[5], dimArray[3], 0, 0); break; case St7.bsUserSection: sectionProfile = null; break; case St7.bsTrapezoidSolid: sectionProfile = null; break; case St7.bsTrapezoidHollow: sectionProfile = null; break; case St7.bsTriangleSolid: sectionProfile = null; break; case St7.bsTriangleHollow: sectionProfile = null; break; case St7.bsCruciform: sectionProfile = null; break; default: sectionProfile = null; break; } ISectionProperty sectionProperty = null; if (material is null || sectionProfile is null) { continue; } if (material is Concrete) { sectionProperty = BH.Engine.Structure.Create.ConcreteSectionFromProfile(sectionProfile, (Concrete)material, propertyName.ToString()); } else { sectionProperty = BH.Engine.Structure.Create.SteelSectionFromProfile(sectionProfile, (Steel)material, propertyName.ToString()); } SetAdapterId(sectionProperty, propNumber); beamSections.Add(sectionProperty); } return(beamSections); }