public void GetLocalAxes() { AngleLocalAxes angleOffset = _app.Model.AnalysisModel.LineElement.GetLocalAxes(CSiDataLine.NameElementFrame); Assert.That(angleOffset.AngleA, Is.EqualTo(0)); Assert.That(angleOffset.AngleB, Is.EqualTo(0)); Assert.That(angleOffset.AngleC, Is.EqualTo(0)); }
public void GetLocalAxes() { AngleLocalAxes angleOffset = _app.Model.AnalysisModel.AreaElement.GetLocalAxes(CSiDataArea.NameElementShellThin); Assert.That(angleOffset.AngleA, Is.EqualTo(0)); Assert.That(angleOffset.AngleB, Is.EqualTo(0)); Assert.That(angleOffset.AngleC, Is.EqualTo(0)); }
public void SetProperty(string name, string nameMaterial, AngleLocalAxes materialAngle, bool includeIncompatibleBendingModes, int color = -1, string notes = "", string GUID = "") { }
/// <summary> /// This function retrieves the local axis angle assignment for the plane element. /// </summary> /// <param name="name">The name of an existing plane element.</param> /// <param name="angleOffset">This is the angle 'a' that the local 1 and 2 axes are rotated about the positive local 3 axis from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +3 axis is pointing toward you. [deg]</param> /// <exception cref="CSiException"></exception> public void GetLocalAxes(string name, ref AngleLocalAxes angleOffset) { double angleA = 0; _callCode = _sapModel.PlaneElm.GetLocalAxes(name, ref angleA); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } angleOffset.AngleA = angleA; }
/// <summary> /// This function defines a solid property. /// </summary> /// <param name="name">The name of an existing or new solid property. /// If this is an existing property, that property is modified; otherwise, a new property is added.</param> /// <param name="nameMaterial">The name of the material property assigned to the solid property.</param> /// <param name="materialAngle">Material angles.</param> /// <param name="includeIncompatibleBendingModes">True: Incompatible bending modes are included in the stiffness formulation. /// In general, incompatible modes significantly improve the bending behavior of the object.]</param> /// <param name="color">The display color assigned to the property. /// If Color is specified as -1, the program will automatically assign a color.</param> /// <param name="notes">The notes, if any, assigned to the property.</param> /// <param name="GUID">The GUID (global unique identifier), if any, assigned to the property. /// If this item is input as Default, the program assigns a GUID to the property.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void SetProperty(string name, string nameMaterial, AngleLocalAxes materialAngle, bool includeIncompatibleBendingModes, int color = -1, string notes = "", string GUID = "") { _callCode = _sapModel.PropSolid.SetProp(name, nameMaterial, materialAngle.AngleA, materialAngle.AngleB, materialAngle.AngleC, includeIncompatibleBendingModes, color, notes, GUID); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } }
/// <summary> /// Sets the joint local axes assignments 1 typical. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> private static void setJOINT_LOCAL_AXES_ASSIGNMENTS_1_TYPICAL(Model model, List <Dictionary <string, string> > table) { foreach (Dictionary <string, string> tableRow in table) { Point point = model.Structure.Points[tableRow["Joint"]]; AngleLocalAxes localAxes = new AngleLocalAxes { AngleA = Adaptor.toDouble(tableRow["AngleA"]), AngleB = Adaptor.toDouble(tableRow["AngleB"]), AngleC = Adaptor.toDouble(tableRow["AngleC"]), }; point.LocalAxes = localAxes; } }
/// <summary> /// This function retrieves the local axis angle assignment for the area . /// </summary> /// <param name="name">The name of an existing area element.</param> /// <param name="angleOffset">This is the angle 'a' that the local 1 and 2 axes are rotated about the positive local 3 axis from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +3 axis is pointing toward you. [deg]</param> /// <exception cref="CSiException">API_DEFAULT_ERROR_CODE</exception> public void GetLocalAxes(string name, out AngleLocalAxes angleOffset) { double angleA = 0; _callCode = _sapModel.AreaElm.GetLocalAxes(name, ref angleA); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } angleOffset = new AngleLocalAxes { AngleA = angleA }; }
/// <summary> /// Returns the local axis angle assignment for the link element. /// This is the angle 'a' that the local 1 and 2 axes are rotated about the positive local 3 axis from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +3 axis is pointing toward you. [deg] /// </summary> /// <param name="name">The name of an existing link element.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public AngleLocalAxes GetLocalAxes(string name) { double angleA = 0; _callCode = _sapModel.PlaneElm.GetLocalAxes(name, ref angleA); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } AngleLocalAxes angleOffset = new AngleLocalAxes { AngleA = angleA }; return(angleOffset); }
/// <summary> /// This function retrieves the local axis angle assignment for the solid element. /// </summary> /// <param name="name">The name of an existing solid element.</param> /// <param name="angleOffset">This is the angle 'a' that the local 1 and 2 axes are rotated about the positive local 3 axis from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +3 axis is pointing toward you. [deg] /// For some objects, the following rotations are also performed: /// 2. Rotate about the resulting 2 axis by angle b. /// 3. Rotate about the resulting 1 axis by angle c.</param> /// <exception cref="CSiException"></exception> public void GetLocalAxes(string name, ref AngleLocalAxes angleOffset) { double angleA = 0; double angleB = 0; double angleC = 0; _callCode = _sapModel.SolidElm.GetLocalAxes(name, ref angleA, ref angleB, ref angleC); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } angleOffset.AngleA = angleA; angleOffset.AngleB = angleB; angleOffset.AngleC = angleC; }
// === Get/Set === /// <summary> /// This function retrieves solid property definition data. /// </summary> /// <param name="name">The name of an existing solid property.</param> /// <param name="nameMaterial">The name of the material property assigned to the solid property.</param> /// <param name="materialAngle">Material angles.</param> /// <param name="includeIncompatibleBendingModes">True: Incompatible bending modes are included in the stiffness formulation. /// In general, incompatible modes significantly improve the bending behavior of the object.</param> /// <param name="color">The display color assigned to the property.</param> /// <param name="notes">The notes, if any, assigned to the property.</param> /// <param name="GUID">The GUID (global unique identifier), if any, assigned to the property.</param> /// <exception cref="CSiException"></exception> public void GetProperty(string name, ref string nameMaterial, ref AngleLocalAxes materialAngle, ref bool includeIncompatibleBendingModes, ref int color, ref string notes, ref string GUID) { double csiAngleA = 0; double csiAngleB = 0; double csiAngleC = 0; _callCode = _sapModel.PropSolid.GetProp(name, ref nameMaterial, ref csiAngleA, ref csiAngleB, ref csiAngleC, ref includeIncompatibleBendingModes, ref color, ref notes, ref GUID); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } materialAngle.AngleA = csiAngleA; materialAngle.AngleB = csiAngleB; materialAngle.AngleC = csiAngleC; }
// Note: These only seem to be exported when explicitly exporting a *.s2k. *$.2k does not include these! In v20.0.0. Appears resolved in v21.0.0. /// <summary> /// Sets the section cuts 1 general. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> private static void setSECTION_CUTS_1_GENERAL(Model model, List <Dictionary <string, string> > table) { foreach (Dictionary <string, string> tableRow in table) { SectionCut sectionCut = model.Analysis.SectionCuts.FillItem(tableRow["CutName"]); sectionCut.CutDefinition = Enums.EnumLibrary.ConvertStringToEnumByDescription <eSectionCut>(tableRow["DefinedBy"]); sectionCut.Group = model.Groupings.Groups[tableRow["Group"]]; string designType = tableRow.ContainsKey("DesignType") ? tableRow["DesignType"] : string.Empty; sectionCut.SectionCutType = convertToSectionResultType(tableRow["ResultType"], designType); sectionCut.IsReportedAtDefaultLocation = Adaptor.fromYesNo(tableRow["DefaultLoc"]); sectionCut.UserDefinedLocation = new Coordinate3DCartesian { X = Adaptor.toDouble(tableRow["GlobalX"]), Y = Adaptor.toDouble(tableRow["GlobalY"]), Z = Adaptor.toDouble(tableRow["GlobalZ"]) }; if (tableRow.ContainsKey("AngleA")) { AngleLocalAxes angle = new AngleLocalAxes { AngleA = Adaptor.toDouble(tableRow["AngleA"]), AngleB = Adaptor.toDouble(tableRow["AngleB"]), AngleC = Adaptor.toDouble(tableRow["AngleC"]) }; sectionCut.Angle = angle; sectionCut.UsesAdvancedAxes = Adaptor.fromYesNo(tableRow["AdvanceAxes"]); } if (tableRow.ContainsKey("DesignAngle")) { sectionCut.DesignAngle = Adaptor.toDouble(tableRow["DesignAngle"]); } if (tableRow.ContainsKey("ElemSide")) { sectionCut.IsPositiveElementSide = (tableRow["ElemSide"].ToLower() == "positive"); } } }
// === Get/Set === /// <summary> /// Returns solid property definition data. /// </summary> /// <param name="name">The name of an existing solid property.</param> /// <param name="nameMaterial">The name of the material property assigned to the solid property.</param> /// <param name="materialAngle">Material angles.</param> /// <param name="includeIncompatibleBendingModes">True: Incompatible bending modes are included in the stiffness formulation. /// In general, incompatible modes significantly improve the bending behavior of the object.</param> /// <param name="color">The display color assigned to the property.</param> /// <param name="notes">The notes, if any, assigned to the property.</param> /// <param name="GUID">The GUID (global unique identifier), if any, assigned to the property.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void GetProperty(string name, out string nameMaterial, out AngleLocalAxes materialAngle, out bool includeIncompatibleBendingModes, out int color, out string notes, out string GUID) { double csiAngleA = 0; double csiAngleB = 0; double csiAngleC = 0; nameMaterial = string.Empty; materialAngle = new AngleLocalAxes(); includeIncompatibleBendingModes = false; color = -1; notes = string.Empty; GUID = string.Empty; _callCode = _sapModel.PropSolid.GetProp(name, ref nameMaterial, ref csiAngleA, ref csiAngleB, ref csiAngleC, ref includeIncompatibleBendingModes, ref color, ref notes, ref GUID); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } materialAngle.AngleA = csiAngleA; materialAngle.AngleB = csiAngleB; materialAngle.AngleC = csiAngleC; }
/// <summary> /// Returns the local axis angle assignment for the object. /// </summary> /// <param name="app">The application.</param> /// <param name="angleOffset">This is the angle 'a' that the local 2 and 3 axes are rotated about the positive local 1 axis, from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +1 axis is pointing toward you. [deg]</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> protected void setLocalAxes(IChangeableLocalAxes app, AngleLocalAxes angleOffset) { app.SetLocalAxes(Name, angleOffset); _angleOffset = angleOffset; }
// IChangeableLocalAxes /// <summary> /// Returns the local axis angle assignment for the object. /// </summary> /// <param name="angleOffset">This is the angle 'a' that the local 2 and 3 axes are rotated about the positive local 1 axis, from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +1 axis is pointing toward you. [deg]</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public abstract void SetLocalAxes(AngleLocalAxes angleOffset);
public void SetLocalAxes(string name, AngleLocalAxes angleOffset, eItemType itemType = eItemType.Object) { }
/// <summary> /// Returns the local axis angle assignment for the object. /// </summary> /// <param name="angleOffset">This is the angle 'a' that the local 2 and 3 axes are rotated about the positive local 1 axis, from the default orientation. /// The rotation for a positive angle appears counter clockwise when the local +1 axis is pointing toward you. [deg]</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public override void SetLocalAxes(AngleLocalAxes angleOffset) { setLocalAxes(_frameObject, angleOffset); AngleOffset = angleOffset; }