/// <summary> /// Sets the model global degrees of freedom. /// </summary> /// <param name="activeDOFs">Boolean indications of which degrees of freedom are active.</param> /// <exception cref="MPT.CSI.API.Core.Support.CSiException"></exception> public void SetActiveDOF(DegreesOfFreedomGlobal activeDOFs) { bool[] dofArray = activeDOFs.ToArray(); _callCode = _sapModel.Analyze.SetActiveDOF(ref dofArray); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } }
/// <summary> /// This function defines a Local constraint. /// If the specified name is not used for a constraint, a new constraint is defined using the specified name. /// If the specified name is already used for another Local constraint, the definition of that constraint is modified. /// If the specified name is already used for some constraint that is not a Local constraint, an error is returned. /// TODO: Handle this. /// </summary> /// <param name="nameConstraint">The name of a constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void SetLocal(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom) { bool[] csiDegreesOfFreedom = degreesOfFreedom.ToArray(); _callCode = _sapModel.ConstraintDef.SetLocal(nameConstraint, ref csiDegreesOfFreedom); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } }
/// <summary> /// This function defines a Line constraint. /// If the specified name is not used for a constraint, a new constraint is defined using the specified name. /// If the specified name is already used for another Line constraint, the definition of that constraint is modified. /// If the specified name is already used for some constraint that is not a Line constraint, an error is returned. /// TODO: Handle this. /// </summary> /// <param name="nameConstraint">The name of a constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <param name="nameCoordinateSystem">The name of the coordinate system in which the constraint is defined.</param> /// <exception cref="CSiException"></exception> public void SetLine(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom, string nameCoordinateSystem) { bool[] csiDegreesOfFreedom = degreesOfFreedom.ToArray(); _callCode = _sapModel.ConstraintDef.SetLine(nameConstraint, ref csiDegreesOfFreedom, nameCoordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } }
// === Get/Set === /// <summary> /// Retrieves the model global degrees of freedom. /// </summary> /// <param name="activeDOFs">Boolean indications of which degrees of freedom are active.</param> /// <exception cref="MPT.CSI.API.Core.Support.CSiException"></exception> public void GetActiveDOF(ref DegreesOfFreedomGlobal activeDOFs) { bool[] dofArray = new bool[0]; _callCode = _sapModel.Analyze.GetActiveDOF(ref dofArray); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } activeDOFs.FromArray(dofArray); }
/// <summary> /// This function defines a Weld constraint. /// If the specified name is not used for a constraint, a new constraint is defined using the specified name. /// If the specified name is already used for another Weld constraint, the definition of that constraint is modified. /// If the specified name is already used for some constraint that is not a Weld constraint, an error is returned. /// TODO: Handle this. /// </summary> /// <param name="nameConstraint">The name of an existing constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <param name="tolerance">Joints within this distance of each other are constrained together.</param> /// <param name="nameCoordinateSystem">The name of the coordinate system in which the constraint is defined.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void SetWeld(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom, double tolerance, string nameCoordinateSystem) { bool[] csiDegreesOfFreedom = degreesOfFreedom.ToArray(); _callCode = _sapModel.ConstraintDef.SetWeld(nameConstraint, ref csiDegreesOfFreedom, tolerance, nameCoordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } }
/// <summary> /// This function defines a Body constraint. /// If the specified name is not used for a constraint, a new constraint is defined using the specified name. /// If the specified name is already used for another Body constraint, the definition of that constraint is modified. /// If the specified name is already used for some constraint that is not a Body constraint, an error is returned. /// </summary> /// <param name="nameConstraint">The name of a constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <param name="nameCoordinateSystem">The name of the coordinate system in which the constraint is defined.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void SetBody(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom, string nameCoordinateSystem) { // TODO: Handle this: If the specified name is already used for some constraint that is not a [xxxx] constraint, an error is returned. bool[] csiDegreesOfFreedom = degreesOfFreedom.ToArray(); _callCode = _sapModel.ConstraintDef.SetBody(nameConstraint, ref csiDegreesOfFreedom, nameCoordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } }
// === /// <summary> /// The function returns the definition for the specified Local constraint. /// </summary> /// <param name="nameConstraint">The name of an existing constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <exception cref="CSiException"></exception> public void GetLocal(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom) { bool[] csiDegreesOfFreedom = new bool[0]; _callCode = _sapModel.ConstraintDef.GetLocal(nameConstraint, ref csiDegreesOfFreedom); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } degreesOfFreedom.FromArray(csiDegreesOfFreedom); }
// === /// <summary> /// The function returns the definition for the specified Line constraint. /// </summary> /// <param name="nameConstraint">The name of an existing constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <param name="nameCoordinateSystem">The name of the coordinate system in which the constraint is defined.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void GetLine(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom, ref string nameCoordinateSystem) { bool[] csiDegreesOfFreedom = new bool[0]; _callCode = _sapModel.ConstraintDef.GetLine(nameConstraint, ref csiDegreesOfFreedom, ref nameCoordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } degreesOfFreedom.FromArray(csiDegreesOfFreedom); }
// === /// <summary> /// The function returns the definition for the specified Weld constraint. /// </summary> /// <param name="nameConstraint">The name of a constraint.</param> /// <param name="degreesOfFreedom">Indicates which joint degrees of freedom are included in the constraint.</param> /// <param name="tolerance">Joints within this distance of each other are constrained together.</param> /// <param name="nameCoordinateSystem">The name of the coordinate system in which the constraint is defined.</param> /// <exception cref="CSiException"></exception> public void GetWeld(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom, ref double tolerance, ref string nameCoordinateSystem) { bool[] csiDegreesOfFreedom = new bool[0]; _callCode = _sapModel.ConstraintDef.GetWeld(nameConstraint, ref csiDegreesOfFreedom, ref tolerance, ref nameCoordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } degreesOfFreedom.FromArray(csiDegreesOfFreedom); }
/// <summary> /// Sets the active degrees of freedom. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> internal static void SetACTIVE_DEGREES_OF_FREEDOM(Model model, List <Dictionary <string, string> > table) { DegreesOfFreedomGlobal dof = model.Settings.ModelInformation.ActiveDegreesOfFreedom; table.Add(new Dictionary <string, string> { { "UX", Adaptor.toYesNo(dof.UX) }, { "UY", Adaptor.toYesNo(dof.UY) }, { "UZ", Adaptor.toYesNo(dof.UZ) }, { "RX", Adaptor.toYesNo(dof.RX) }, { "RY", Adaptor.toYesNo(dof.RY) }, { "RZ", Adaptor.toYesNo(dof.RZ) } } ); }
public void FillModelFromTable_Fills_ACTIVE_DEGREES_OF_FREEDOM() { SAP2000Reader reader = new SAP2000Reader(); Tables table = Reader.ReadFile(path, reader); Assert.IsTrue(table.GenerateModelFromTables(reader)); DegreesOfFreedomGlobal dofs = table.Model.Settings.ModelInformation.ActiveDegreesOfFreedom; Assert.IsTrue(dofs.UX); Assert.IsFalse(dofs.UY); Assert.IsTrue(dofs.UZ); Assert.IsFalse(dofs.RX); Assert.IsTrue(dofs.RY); Assert.IsFalse(dofs.RZ); }
/// <summary> /// Sets the active degrees of freedom. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> internal static void SetACTIVE_DEGREES_OF_FREEDOM(Model model, List <Dictionary <string, string> > table) { Dictionary <string, string> row = table[0]; DegreesOfFreedomGlobal dof = new DegreesOfFreedomGlobal { UX = Adaptor.fromYesNo(row["UX"]), UY = Adaptor.fromYesNo(row["UY"]), UZ = Adaptor.fromYesNo(row["UZ"]), RX = Adaptor.fromYesNo(row["RX"]), RY = Adaptor.fromYesNo(row["RY"]), RZ = Adaptor.fromYesNo(row["RZ"]) }; model.Settings.ModelInformation.ActiveDegreesOfFreedom = dof; }
public void GetActiveDOF(ref DegreesOfFreedomGlobal activeDOFs) { }
public void GetWeld(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom, ref double tolerance, ref string nameCoordinateSystem) { }
public void GetLocal(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom) { }
public void GetLine(string nameConstraint, ref DegreesOfFreedomGlobal degreesOfFreedom, ref string nameCoordinateSystem) { }
public void SetWeld(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom, double tolerance, string nameCoordinateSystem) { }
public void SetEqual(string nameConstraint, DegreesOfFreedomGlobal degreesOfFreedom, string nameCoordinateSystem) { }
public void SetActiveDOF(DegreesOfFreedomGlobal activeDOFs) { }