/***************************************************/ // Convert panel information to CCX format. public override List <string> ToCCX() { string panelType; switch (this._feType) { case Element2D.Element2DType.Shell: panelType = "*SHELL"; break; case Element2D.Element2DType.Membrane: panelType = "*MEMBRANE"; break; default: throw new Exception(String.Format("{0} is not supported in the current implementation of Guanaco.", this._feType)); } List <string> CCXFormat = new List <string> { "*ORIENTATION,NAME=ORPANEL" + this.CCXId() }; CCXFormat.Add(GuanacoUtil.RhinoVectorToString(this._lcs.XAxis) + "," + GuanacoUtil.RhinoVectorToString(this._lcs.YAxis)); CCXFormat.Add("*ELSET,ELSET=PANEL" + this.CCXId()); CCXFormat.AddRange(GuanacoUtil.IntsToCCX(this._elements.Select(e => e.Id.AsInteger), true)); CCXFormat.Add(panelType + " SECTION,MATERIAL=" + this._material.Name + ",ELSET=PANEL" + this.CCXId() + ",ORIENTATION=ORPANEL" + this.CCXId()); CCXFormat.Add(this._thickness.ToString(GuanacoUtil.Invariant)); return(CCXFormat); }
/***************************************************/ // Convert bar information to CCX format. public override List <string> ToCCX() { Plane orLCS = new Plane(this._lcs); orLCS.Rotate(this._rotation, orLCS.ZAxis); List <string> CCXFormat = new List <string> { "*ORIENTATION,NAME=ORBAR" + this.CCXId() }; CCXFormat.Add(GuanacoUtil.RhinoVectorToString(orLCS.XAxis) + "," + GuanacoUtil.RhinoVectorToString(orLCS.YAxis)); CCXFormat.Add("*ELSET,ELSET=BAR" + this.CCXId()); CCXFormat.AddRange(GuanacoUtil.IntsToCCX(this._elements.Select(e => e.Id.AsInteger), true)); string[] profileInfo = this._profile.ToCCXFormat(); string barInfo = profileInfo[0] + ",MATERIAL=" + this._material.Name + ",ELSET=BAR" + this.CCXId() + ",ORIENTATION=ORBAR" + this.CCXId() + ","; if (this._offset.X != 0) { barInfo += "OFFSET1=" + (this._offset.X / this._profile.GetHeight()).ToString(GuanacoUtil.Invariant) + ","; } if (this._offset.Y != 0) { barInfo += "OFFSET2=" + (this._offset.Y / this._profile.GetWidth()).ToString(GuanacoUtil.Invariant) + ","; } barInfo += profileInfo[1]; CCXFormat.Add(barInfo); CCXFormat.Add(profileInfo[2]); CCXFormat.Add(GuanacoUtil.RhinoVectorToString(orLCS.XAxis)); return(CCXFormat); }