ETABSProperty2D Property2DToSpeckle(string area, string property) { eAreaDesignOrientation areaDesignOrientation = eAreaDesignOrientation.Null; Model.AreaObj.GetDesignOrientation(area, ref areaDesignOrientation); eDeckType deckType = eDeckType.Filled; eSlabType slabType = eSlabType.Drop; eWallPropType wallPropType = eWallPropType.Specified; eShellType shellType = eShellType.Layered; string matProp = ""; double thickness = 0; int color = 0; string notes = ""; string GUID = ""; switch (areaDesignOrientation) { case eAreaDesignOrientation.Wall: return(WallPropertyToSpeckle(property)); break; case eAreaDesignOrientation.Floor: return(FloorPropertyToSpeckle(property)); break; } double[] value = null; return(null); }
public ETABSProperty2D WallPropertyToSpeckle(string property) { eWallPropType wallPropType = eWallPropType.Specified; eShellType shellType = eShellType.Layered; string matProp = ""; double thickness = 0; int color = 0; string notes = ""; string GUID = ""; var specklePropery2DWall = new ETABSProperty2D(); specklePropery2DWall.type = Structural.PropertyType2D.Shell; Model.PropArea.GetWall(property, ref wallPropType, ref shellType, ref matProp, ref thickness, ref color, ref notes, ref GUID); var speckleShellType = ConvertShellType(shellType); specklePropery2DWall.shellType = speckleShellType; setProperties(specklePropery2DWall, matProp, thickness, property); specklePropery2DWall.type2D = Structural.ETABS.Analysis.ETABSPropertyType2D.Wall; specklePropery2DWall.applicationId = GUID; return(specklePropery2DWall); }
GetWall(this cPropArea obj, string Name) { eWallPropType WallPropType; WallPropType = default(eWallPropType); eShellType ShellType; ShellType = default(eShellType); string MatProp, notes, GUID; MatProp = notes = GUID = default(string); double Thickness; Thickness = default(double); int color; color = default(int); var res = obj.GetWall(Name, ref WallPropType, ref ShellType, ref MatProp, ref Thickness, ref color, ref notes, ref GUID); return(WallPropType, ShellType, MatProp, Thickness, color, notes, GUID); }
/***************************************************/ /*** Read Methods ***/ /***************************************************/ private List <ISurfaceProperty> ReadSurfaceProperty(List <string> ids = null) { List <ISurfaceProperty> propertyList = new List <ISurfaceProperty>(); Dictionary <string, IMaterialFragment> bhomMaterials = ReadMaterial().ToDictionary(x => GetAdapterId <string>(x)); int nameCount = 0; string[] nameArr = { }; m_model.PropArea.GetNameList(ref nameCount, ref nameArr); ids = FilterIds(ids, nameArr); foreach (string id in ids) { eSlabType slabType = eSlabType.Slab; eShellType shellType = eShellType.ShellThin; eWallPropType wallType = eWallPropType.Specified; string material = ""; double thickness = 0; int colour = 0; string notes = ""; string guid = null; double depth = 0; double stemWidthTop = 0; double stemWidthBottom = 0;//not used double ribSpacing = 0; double ribSpacing2nd = 0; int direction = 0; double[] modifiers = new double[] { }; int ret = m_model.PropArea.GetSlab(id, ref slabType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); if (ret != 0) { m_model.PropArea.GetWall(id, ref wallType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); } SurfacePropertyModifier modifier = null; if (m_model.PropArea.GetModifiers(id, ref modifiers) == 0 && modifiers != null && modifiers.Length == 10 && modifiers.Any(x => x != 1)) { modifier = new SurfacePropertyModifier { FXX = modifiers[0], FYY = modifiers[1], FXY = modifiers[2], MXX = modifiers[3], MYY = modifiers[4], MXY = modifiers[5], VXZ = modifiers[6], VYZ = modifiers[7], Mass = modifiers[8], Weight = modifiers[9] }; } IMaterialFragment bhMaterial = null; try { bhMaterial = bhomMaterials[material]; } catch (Exception) { Engine.Base.Compute.RecordNote("Could not get material from ETABS. Material for surface property " + id + " will be null"); } if (wallType == eWallPropType.AutoSelectList) { string[] propList = null; string currentProperty = ""; m_model.PropArea.GetWallAutoSelectList(id, ref propList, ref currentProperty); m_model.PropArea.GetWall(currentProperty, ref wallType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); ConstantThickness panelConstant = new ConstantThickness(); panelConstant.Name = currentProperty; panelConstant.Material = bhMaterial; panelConstant.Thickness = thickness; panelConstant.PanelType = PanelType.Wall; SetShellType(panelConstant, shellType); if (modifier != null) { panelConstant.Fragments.Add(modifier); } SetAdapterId(panelConstant, id); propertyList.Add(panelConstant); } else { switch (slabType) { case eSlabType.Ribbed: Ribbed panelRibbed = new Ribbed(); m_model.PropArea.GetSlabRibbed(id, ref depth, ref thickness, ref stemWidthTop, ref stemWidthBottom, ref ribSpacing, ref direction); panelRibbed.Name = id; panelRibbed.Material = bhMaterial; panelRibbed.Thickness = thickness; panelRibbed.PanelType = PanelType.Slab; panelRibbed.Direction = (PanelDirection)direction; panelRibbed.Spacing = ribSpacing; panelRibbed.StemWidth = stemWidthTop; panelRibbed.TotalDepth = depth; SetShellType(panelRibbed, shellType); if (modifier != null) { panelRibbed.Fragments.Add(modifier); } SetAdapterId(panelRibbed, id); propertyList.Add(panelRibbed); break; case eSlabType.Waffle: Waffle panelWaffle = new Waffle(); m_model.PropArea.GetSlabWaffle(id, ref depth, ref thickness, ref stemWidthTop, ref stemWidthBottom, ref ribSpacing, ref ribSpacing2nd); panelWaffle.Name = id; panelWaffle.Material = bhMaterial; panelWaffle.SpacingX = ribSpacing; panelWaffle.SpacingY = ribSpacing2nd; panelWaffle.StemWidthX = stemWidthTop; panelWaffle.StemWidthY = stemWidthTop; //ETABS does not appear to support direction dependent stem width panelWaffle.Thickness = thickness; panelWaffle.TotalDepthX = depth; panelWaffle.TotalDepthY = depth; // ETABS does not appear to to support direction dependent depth panelWaffle.PanelType = PanelType.Slab; SetShellType(panelWaffle, shellType); if (modifier != null) { panelWaffle.Fragments.Add(modifier); } SetAdapterId(panelWaffle, id); propertyList.Add(panelWaffle); break; case eSlabType.Slab: case eSlabType.Drop: case eSlabType.Stiff_DO_NOT_USE: default: ConstantThickness panelConstant = new ConstantThickness(); panelConstant.Name = id; panelConstant.Material = bhMaterial; panelConstant.Thickness = thickness; panelConstant.Name = id; panelConstant.PanelType = PanelType.Slab; SetShellType(panelConstant, shellType); if (modifier != null) { panelConstant.Fragments.Add(modifier); } SetAdapterId(panelConstant, id); propertyList.Add(panelConstant); break; } } } return(propertyList); }
/***************************************************/ private List <ISurfaceProperty> ReadProperty2d(List <string> ids = null) { List <ISurfaceProperty> propertyList = new List <ISurfaceProperty>(); int nameCount = 0; string[] nameArr = { }; if (ids == null) { m_model.PropArea.GetNameList(ref nameCount, ref nameArr); ids = nameArr.ToList(); } foreach (string id in ids) { ISurfaceProperty bhProperty = null; eSlabType slabType = eSlabType.Slab; eShellType shellType = eShellType.ShellThin; eWallPropType wallType = eWallPropType.Specified; string material = ""; double thickness = 0; int colour = 0; string notes = ""; string guid = ""; double depth = 0; double stemWidthTop = 0; double stemWidthBottom = 0;//not used double ribSpacing = 0; double ribSpacing2nd = 0; int direction = 0; double[] modifiers = new double[] { }; bool hasModifiers = false; int ret = m_model.PropArea.GetSlab(id, ref slabType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); if (ret != 0) { m_model.PropArea.GetWall(id, ref wallType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); } if (m_model.PropArea.GetModifiers(id, ref modifiers) == 0) { hasModifiers = true; } if (wallType == eWallPropType.AutoSelectList) { string[] propList = null; string currentProperty = ""; m_model.PropArea.GetWallAutoSelectList(id, ref propList, ref currentProperty); m_model.PropArea.GetWall(currentProperty, ref wallType, ref shellType, ref material, ref thickness, ref colour, ref notes, ref guid); ConstantThickness panelConstant = new ConstantThickness(); panelConstant.Name = currentProperty; panelConstant.CustomData[AdapterId] = id; panelConstant.Material = ReadMaterials(new List <string>() { material })[0]; panelConstant.Thickness = thickness; panelConstant.PanelType = PanelType.Wall; SetShellType(panelConstant, shellType); if (hasModifiers) { panelConstant.CustomData.Add("Modifiers", modifiers); } propertyList.Add(panelConstant); } else { switch (slabType) { case eSlabType.Ribbed: Ribbed panelRibbed = new Ribbed(); m_model.PropArea.GetSlabRibbed(id, ref depth, ref thickness, ref stemWidthTop, ref stemWidthBottom, ref ribSpacing, ref direction); panelRibbed.Name = id; panelRibbed.CustomData[AdapterId] = id; panelRibbed.Material = ReadMaterials(new List <string>() { material })[0]; panelRibbed.Thickness = thickness; panelRibbed.PanelType = PanelType.Slab; panelRibbed.Direction = (PanelDirection)direction; panelRibbed.Spacing = ribSpacing; panelRibbed.StemWidth = stemWidthTop; panelRibbed.TotalDepth = depth; SetShellType(panelRibbed, shellType); if (hasModifiers) { panelRibbed.CustomData.Add("Modifiers", modifiers); } propertyList.Add(panelRibbed); break; case eSlabType.Waffle: Waffle panelWaffle = new Waffle(); m_model.PropArea.GetSlabWaffle(id, ref depth, ref thickness, ref stemWidthTop, ref stemWidthBottom, ref ribSpacing, ref ribSpacing2nd); panelWaffle.Name = id; panelWaffle.CustomData[AdapterId] = id; panelWaffle.Material = ReadMaterials(new List <string>() { material })[0]; panelWaffle.SpacingX = ribSpacing; panelWaffle.SpacingY = ribSpacing2nd; panelWaffle.StemWidthX = stemWidthTop; panelWaffle.StemWidthY = stemWidthTop; //ETABS does not appear to support direction dependent stem width panelWaffle.Thickness = thickness; panelWaffle.TotalDepthX = depth; panelWaffle.TotalDepthY = depth; // ETABS does not appear to to support direction dependent depth panelWaffle.PanelType = PanelType.Slab; SetShellType(panelWaffle, shellType); if (hasModifiers) { panelWaffle.CustomData.Add("Modifiers", modifiers); } propertyList.Add(panelWaffle); break; case eSlabType.Slab: case eSlabType.Drop: case eSlabType.Stiff_DO_NOT_USE: default: ConstantThickness panelConstant = new ConstantThickness(); panelConstant.CustomData[AdapterId] = id; panelConstant.Name = id; panelConstant.Material = ReadMaterials(new List <string>() { material })[0]; panelConstant.Thickness = thickness; panelConstant.Name = id; panelConstant.PanelType = PanelType.Slab; SetShellType(panelConstant, shellType); if (hasModifiers) { panelConstant.CustomData.Add("Modifiers", modifiers); } propertyList.Add(panelConstant); break; } } } return(propertyList); }