/***************************************************/ private IMaterialFragment GetPlatePropertyMaterial(int plateProp) { int err = 0; IMaterialFragment material = null; double[] materialArray = new double[8]; int materialType = 0; int plateType = 0; StringBuilder materialName = new StringBuilder(St7.kMaxStrLen); err = St7.St7GetPlatePropertyType(1, plateProp, ref plateType, ref materialType); if (materialType != St7.mtIsotropic) { return(material); // !!! ISOTROPIC ONLY !!! } err = St7.St7GetPlateIsotropicMaterial(1, plateProp, materialArray); if (!St7Error(err)) { return(material); } err = St7.St7GetMaterialName(1, St7.ptPLATEPROP, plateProp, materialName, St7.kMaxStrLen); if (!St7Error(err)) { return(material); } // !!!! Materials are set based on Poisson Ratio !!!! if (materialArray[St7.ipBeamPoisson] <= 0.2) { material = BH.Engine.Structure.Create.Concrete(materialName.ToString(), materialArray[St7.ipPlateIsoModulus], materialArray[St7.ipPlateIsoPoisson], materialArray[St7.ipPlateIsoAlpha], materialArray[St7.ipPlateIsoDensity]); } else { material = BH.Engine.Structure.Create.Steel(materialName.ToString(), materialArray[St7.ipPlateIsoModulus], materialArray[St7.ipPlateIsoPoisson], materialArray[St7.ipPlateIsoAlpha], materialArray[St7.ipPlateIsoDensity]); } return(material); }
/***************************************************/ /**** 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); }