public static string ToNative(this Structural0DLoadPoint load) { return(new GSA0DLoadPoint() { Value = load }.SetGWACommand()); }
public static string ToNative(this Structural0DLoadPoint load) { return(SchemaConversion.Helper.ToNativeTryCatch(load, () => new GSA0DLoadPoint() { Value = load }.SetGWACommand())); }
public void ParseGWACommand() { if (this.GWACommand == null) { return; } var obj = new Structural0DLoadPoint(); var pieces = this.GWACommand.ListSplit("\t"); var counter = 1; // Skip identifier obj.Name = pieces[counter++].Trim(new char[] { '"' }); obj.LoadCaseRef = Helper.GetApplicationId(typeof(GSALoadCase).GetGSAKeyword(), Convert.ToInt32(pieces[counter++])); var axis = pieces[counter++]; this.Axis = axis == "GLOBAL" ? 0 : Convert.ToInt32(axis); //Helper.GetGridPlaneRef(Convert.ToInt32(pieces[counter++]), out int gridPlaneRefRet, out string gridSurfaceRec); //Helper.GetGridPlaneData(gridPlaneRefRet, out int gridPlaneAxis, out double gridPlaneElevation, out string gridPlaneRec); //this.SubGWACommand.Add(gridSurfaceRec); //this.SubGWACommand.Add(gridPlaneRec); //string gwaRec = null; //var planeAxis = Helper.Parse0DAxis(gridPlaneAxis, Initialiser.Interface, out gwaRec); //if (gwaRec != null) // this.SubGWACommand.Add(gwaRec); //double elevation = gridPlaneElevation; //var planeLoadAxisId = 0; //var planeLoadAxisData = pieces[counter++]; //StructuralAxis planeLoadAxis; //if (planeLoadAxisData == "LOCAL") // planeLoadAxis = planeAxis; //else //{ // planeLoadAxisId = planeLoadAxisData == "GLOBAL" ? 0 : Convert.ToInt32(planeLoadAxisData); // planeLoadAxis = Helper.Parse0DAxis(planeLoadAxisId, Initialiser.Interface, out gwaRec); // if (gwaRec != null) // this.SubGWACommand.Add(gwaRec); //} //var planeProjected = pieces[counter++] == "YES"; //var planeDirection = pieces[counter++]; //var value = Convert.ToDouble(pieces[counter++]); obj.Loading = new StructuralVectorSix(new double[3]); var direction = pieces[counter++].ToLower(); switch (direction.ToUpper()) { case "X": obj.Loading.Value[0] = Convert.ToDouble(pieces[counter++]); break; case "Y": obj.Loading.Value[1] = Convert.ToDouble(pieces[counter++]); break; case "Z": obj.Loading.Value[2] = Convert.ToDouble(pieces[counter++]); break; default: // TODO: Error case maybe? break; } this.Value = obj; }