public void SetEndPoint(int objectId, PointD endPoint) { if (!this.Set <double[]>(objectId, "終点設定", endPoint.ToArray())) { throw new AutoCadException("Failed to set end point of line."); } }
public void SetPosition(int blockRefId, PointD position) { if (!Set <double[]>(blockRefId, "基点設定", position.ToArray())) { throw new AutoCadException("Failed to set position."); } }
public void SetVertex(int polylineId, int vertexIndex, PointD vertexPoint) { List <object> args = new List <object>(); args.Add(vertexIndex); args.Add(vertexPoint.ToArray()); if (!this.Set <object[]>(polylineId, "頂点順番指定設定", args.ToArray())) { throw new AutoCadException("Failed to set vertex of polyline."); } }
public int Make(PointD startPoint, PointD endPoint) { var args = new List <object>(); args.Add(startPoint.ToArray()); args.Add(endPoint.ToArray()); var result = this.Make <object>(args.ToArray()); if (!result.Success) { throw new AutoCadException("Failed to make line."); } return(result.Value); }
public int Make(PointD point, double radius) { var args = new List <object>(); args.Add(point.ToArray()); args.Add(radius); var result = this.Make <object>(args.ToArray()); if (!result.Success) { throw new AutoCadException("Failed to make circle."); } return(result.Value); }
/// <summary>始点から、指定する図形上の位置(点)までの図形に沿った距離を取得する</summary> public double GetLength(int objectId, PointD point) { Result <double> result = this.Get <double, double[]>(objectId, "点から距離取得", point.ToArray()); if (!result.Success) { throw new AutoCadException("Failed to get length of polyline."); } return(result.Value); }
public virtual double GetLength(int objectId) { PointD start = this.GetStartPoint(objectId); PointD end = this.GetEndPoint(objectId); if (start.Equals(end)) { return(0d); //長さが0の線に対して距離取得すると失敗するので、回避だ! } Result <double> result = this.Get <double, double[]>(objectId, "点から距離取得", end.ToArray()); if (!result.Success) { throw new AutoCadException("Failed to get length of curve."); } return(result.Value); }