public void AddByCoordinate(Coordinate3DSpherical coordinate, ref string name, string userName = "", string coordinateSystem = CoordinateSystems.Global, bool mergeOff = false, int mergeNumber = 0) { }
/// <summary> /// Sets the joint coordinates. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> private static void setJOINT_COORDINATES(Model model, List <Dictionary <string, string> > table) { foreach (Dictionary <string, string> tableRow in table) { eCoordinateType coordinateType = Enums.EnumLibrary.ConvertStringToEnumByDescription <eCoordinateType>(tableRow["CoordType"]); string jointName = tableRow["Joint"]; switch (coordinateType) { case eCoordinateType.Cartesian: Coordinate3DCartesian coordinateCartesian = new Coordinate3DCartesian { X = Adaptor.toDouble(tableRow["XorR"]), Y = Adaptor.toDouble(tableRow["Y"]), Z = Adaptor.toDouble(tableRow["Z"]) }; model.Structure.Points.Add(coordinateCartesian, jointName); break; case eCoordinateType.Cylindrical: // TODO: COnfirm output for cylindrical coord systems Coordinate3DCylindrical coordinateCylindrical = new Coordinate3DCylindrical { Radius = Adaptor.toDouble(tableRow["XorR"]), Theta = Adaptor.toDouble(tableRow["Y"]), Z = Adaptor.toDouble(tableRow["Z"]) }; //model.Structure.Points.Add(coordinateCylindrical, jointName); break; case eCoordinateType.Spherical: // TODO: COnfirm output for spherical coord systems Coordinate3DSpherical coordinateSpherical = new Coordinate3DSpherical { Radius = Adaptor.toDouble(tableRow["XorR"]), Theta = Adaptor.toDouble(tableRow["Y"]), Phi = Adaptor.toDouble(tableRow["Z"]) }; //model.Structure.Points.Add(coordinateSpherical, jointName); break; default: break; } Point point = model.Structure.Points[jointName]; point.IsSpecialPoint = Adaptor.fromYesNo(tableRow["SpecialJt"]); point.CoordinateSystem = tableRow["CoordSys"]; point.CoordinateType = coordinateType; } }
/// <summary> /// Returns the r, a and b coordinates of the specified point element/object in the Present Units. /// The coordinates are reported in the coordinate system specified by <paramref name="coordinateSystem" />. /// </summary> /// <param name="name">The name of an existing point element/object.</param> /// <param name="coordinate">The spherical r-, a-, b-coordinate of the specified point element/object in the specified coordinate system.</param> /// <param name="coordinateSystem">The name of the coordinate system in which the joint coordinates are returned.</param> /// <exception cref="CSiException"></exception> public void GetCoordinate(string name, ref Coordinate3DSpherical coordinate, string coordinateSystem = CoordinateSystems.Global) { double radius = 0; double theta = 0; double phi = 0; _callCode = _sapModel.PointElm.GetCoordSpherical(name, ref radius, ref theta, ref phi, coordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(); } coordinate.Radius = radius; coordinate.Theta = theta; coordinate.Phi = phi; }
/// <summary> /// Returns the spherical r-, a-, b-coordinates of the specified point element/object in the Present Units. /// The coordinates are reported in the coordinate system specified by <paramref name="coordinateSystem" />. /// </summary> /// <param name="name">The name of an existing point element/object.</param> /// <param name="coordinateSystem">The name of the coordinate system in which the joint coordinates are returned.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public Coordinate3DSpherical GetCoordinateSpherical(string name, string coordinateSystem = CoordinateSystems.Global) { double radius = 0; double theta = 0; double phi = 0; _callCode = _sapModel.PointElm.GetCoordSpherical(name, ref radius, ref theta, ref phi, coordinateSystem); if (throwCurrentApiException(_callCode)) { throw new CSiException(API_DEFAULT_ERROR_CODE); } Coordinate3DSpherical coordinate = new Coordinate3DSpherical(); coordinate.Radius = radius; coordinate.Theta = theta; coordinate.Phi = phi; return(coordinate); }
public void GetCoordinate(string name, ref Coordinate3DSpherical coordinate, string coordinateSystem = CoordinateSystems.Global) { }