C# Cad2016二次开发api(三)

直线 Line

属性中文数据类型作用
Length长度double直线的长度
Angle角度double直线的弧度,0~2π
Delta增量Vector3d起点到终点的向量
Normal法向向量Vector3d直线所在平面的法向单位向量
Thickness厚度double
EndPoint终点Point3d直线的终点
StartPoint起点Point3d直线的起点
方法参数说明
Line( )无参数构造函数:声明一条空的直线
Line
(
   Point3d pointer1,
   Point3d pointer2
)


起点
终点
构造函数:声明从起点到终点的一条直线

Line line = new Line();

Point3d point1 = new Point3d(0, 0, 0);
Point3d point2 = new Point3d(10, 10, 0);
Line line = new Line(point1, point2);

圆 Circle

属性中文数据类型作用
Diameter直径double圆的直径
Circumference周长double圆的周长
Normal单位法向向量Vector3d圆所在的平面的单位法向向量
Thickness厚度double圆的厚度
Radius半径double圆的半径
Center圆心Point3d圆的圆心
方法参数说明
Circle( )无参数构造函数:声明一个空的圆
Circle
(
   Point3d center,
   Vector3d normal,
   double radius
)


圆心
法向向量
半径
构造函数:声明一个确定圆心半径的圆

Circle circle = new Circle();

Point3d center = new Point3d(0, 0, 0);
Vector3d normal = Vector3d.ZAxis;
double radius = 5;
Circle circle = new Circle(center, normal, radius);

圆弧 Arc

属性中文数据类型作用
TotalAngle总角度double圆弧的总弧度
Length总长double圆弧的总长度
Normal法向向量Vector3d圆弧所在平面的单位法向向量
Thickness厚度double圆弧的厚度
EndAngle终点角度double圆心到终点连线的弧度
StartAngle起点角度double圆心到起点连线的弧度
Radius半径double圆弧的半径
Center圆心Point3d圆弧的圆心

注意事项:当Normal为-Z轴方向时,虽然圆弧任是根据右手定则逆时针的,但是从用户视角,圆弧变成了顺时针,圆弧起始弧度判断也从X轴变成了-X轴,在读取一些图纸中的圆弧时,需注意Normal方向。

方法参数说明
Arc( )无参数构造函数:声明一个空的圆弧
Arc
(
   Point3d center,
   double radius,
   double startAngle,
  double endAngle
)


圆心
半径
起点角度
终点角度
构造函数:声明一个确定
圆心半径的起点终点的圆弧
Arc
(
   Point3d center,
   Vector3d normal,
   double radius,
   double startAngle,
  double endAngle
)


圆心
法向向量
半径
起点角度
终点角度
构造函数:声明一个确定
圆心半径的起点终点的圆弧,
并且设置法向向量,可以控制圆弧的顺逆时针

Arc arc = new Arc();

Point3d center = Point3d.Origin;
double radius = 5;
double startAngle = 0;
double endAngle = Math.PI / 3;
Arc arc = new Arc(center, radius, startAngle, endAngle);

Point3d center = Point3d.Origin;
Vector3d normal = -Vector3d.ZAxis;
double radius = 5;
double startAngle = 0;
double endAngle = Math.PI / 3;
Arc arc = new Arc(center, normal, radius, startAngle, endAngle);

椭圆 Ellipse

椭圆

属性中文数据类型作用
MinorRadius短轴半径double椭圆短轴的半径
MajorRadius长轴半径double椭圆长轴的半径
IsNull是否为空bool判断椭圆是否为空
EndParam终点参数double椭圆终点的参数
StartParam起点参数double椭圆起点的参数
EndAngle终点角度double椭圆终点的弧度
StartAngle起点角度double椭圆起点的弧度
RadiusRatio半径比例double短轴半径/长轴半径
MinorAxis短轴向量Vector3d椭圆短轴的向量
MajorAxis长轴向量Vector3d椭圆长轴的方向
Normal法向向量Vector3d椭圆所在平面的单位法向向量
Center圆心Point3d椭圆的圆心
方法参数说明
Ellipse( )无参数构造函数:声明一个空的椭圆
Ellipse
(
   Point3d center,
   Vector3d unitNormal,
   Vector3d majorAxis,
  double radiusRatio,
  double startAngle,
  double endAngle
)


圆心
法向向量
长轴向量
半径比例
起始弧度
终止弧度
构造函数:声明一个确定参数的椭圆
void Set
(
   Point3d center,
   Vector3d unitNormal,
   Vector3d majorAxis,
  double radiusRatio,
  double startAngle,
  double endAngle
)


圆心
法向向量
长轴向量
半径比例
起始弧度
终止弧度
给一个椭圆设置参数
double GetParameterAtAngle
(
  double angle
)


角度
获取指定角度处的参数
double GetAngleAtParameter
(
  double value
)


参数
获取指定参数处的角度

Ellipse ellipse = new Ellipse();

Point3d center = new Point3d(0, 0, 0);
Vector3d unitNormal= Vector3d.ZAxis;
Vector3d majorAxis = new Vector3d(10, 0, 0);
double radiusRatio = 0.5;
double startAngle = 0;
double endAngle = Math.PI * 2;
Ellipse ellipse = new Ellipse(center, unitNormal, majorAxis, radiusRatio, startAngle, endAngle);

Ellipse ellipse = new Ellipse();
Point3d center = new Point3d(0, 0, 0);
Vector3d unitNormal = Vector3d.ZAxis;
Vector3d majorAxis = new Vector3d(10, 0, 0);
double radiusRatio = 0.5;
double startAngle = Math.PI / 3;
double endAngle = Math.PI / 3 * 2;
ellipse.Set(center, unitNormal, majorAxis, radiusRatio, startAngle, endAngle);

double value = ellipse.GetParameterAtAngle(Math.PI / 3);

double angle = ellipse.GetAngleAtParameter(2);

多段线 Polyline

https://www.bilibili.com/video/BV11g4y1E7iH/

属性中文数据类型作用
Length长度double多段线的长度
HasWidth是否有宽度bool多段线是否有宽度
HasBulges是否有凸度bool多段线是否有圆弧
NumberOfVertices节点数int多段线的节点数量
IsOnlyLines是否只有直线bool多段线是否全部由直线组成
Normal法向向量Vector3d多段线所在平面的单位法向向量
ConstantWidth全局宽度double多段线的全局宽度,宽度一致
Thickness厚度double多段线的厚度
Elevation高程double多段线的高程,即Z坐标
Plinegen普林根bool关闭时节点会打断线型
打开时节点不会打断线型
Closed是否闭合bool多段线是否闭合
方法参数说明
Polyline( )无参数构造函数:声明一个空的多段线
Polyline
(
  int vertices
)


节点数
构造函数:声明一个确定节点
数的多段线
void ConvertFrom
(
  Entity entity,
  bool transferId
)


转化源
是否传递ID
从别的Entity转成Polyline
(目前只发现可以从
Polyline2d转)
Polyline2d ConvertTo
(
  bool transferId
)


是否传递ID
把Polyline转成Polyline2d
参数涉及IdMapping
(目前我还不懂嘿嘿嘿)
Point3d GetPoint3dAt
(
  int value
)


节点索引
获取指定节点索引处的点
注意索引不要超出
SegmentType GetSegmentType
(
  int index
)


段落索引
获取指定索引处的段落
的类型(线、圆弧等等)
LineSegment2d GetLineSegment2dAt
(
  int index
)


段落索引
获取指定索引处的段落
的二维线段
CircularArc2d GetArcSegment2dAt
(
  int index
)


段落索引
获取指定索引处的段落
的二维圆弧
LineSegment3d GetLineSegmentAt
(
  int index
)


段落索引
获取指定索引处的段落
的三维线段
CircularArc3d GetArcSegmentAt
(
  int index
)


段落索引
获取指定索引处的段落
的三维圆弧
bool OnSegmentAt
(
  int index,
  Point2d pt2d,
  double value
)


段落索引
二维点
不知道
判断一个点是否在指定
索引的段落上
第三个参数不知道啥意思
void AddVertexAt
(
  int index,
  Point2d pt,
  double bulge,
  double startWidth,
  double endWidth
)


节点索引
二维点
凸度
起始宽度
终止宽度
在指定索引的节点添加一个点
void RemoveVertexAt
(
  int index
)


节点索引
删除指定索引的节点
Point2d GetPoint2dAt
(
  int index
)


节点索引
获取指定索引处节点的
二维点
void SetPointAt
(
  int index,
  Point2d pt
)


节点索引
二维点
修改指定索引处节点的
二维点
double GetBulgeAt
(
  int index
)


节点索引
获取指定索引处节点的
凸度
void SetBulgeAt
(
  int index,
  double bulge
)


节点索引
凸度
设置指定索引处节点的
凸度
double GetStartWidthAt
(
  int index
)


节点索引
获取指定索引处节点的
起始宽度
double GetEndWidthAt
(
  int index
)


节点索引
获取指定索引处节点的
终止宽度
void SetStartWidthAt
(
  int index,
  double startWidth
)


节点索引
起始宽度
设置指定索引处节点的
起始宽度
void SetEndWidthAt
(
  int index,
  double endWidth
)


节点索引
终止宽度
设置指定索引处节点的
终止宽度
void MinimizeMemory()无参数最小化内存
void MaximizeMemory()无参数最大化内存
void Reset
(
  bool reuse,
  int vertices
)
不知道清空多段线

Polyline polyline = new Polyline();

int vertices = 5;
Polyline polyline = new Polyline(vertices);

Polyline polyline = new Polyline();
polyline.ConvertFrom(polyline2D, false);

Polyline2d polyline2D = polyline.ConvertTo(false);

List<Point3d> points = new List<Point3d>();
for (int i = 0; i < polyline.NumberOfVertices; i++)
{
    Point3d point3D = polyline.GetPoint3dAt(i);
    points.Add(point3D);
}

int index = 1;
SegmentType segmentType = polyline.GetSegmentType(index);

int index = 1;
LineSegment2d lineSegment2D = polyline.GetLineSegment2dAt(index);

int index = 1;
CircularArc2d circularArc2D = polyline.GetArcSegment2dAt(index);

int index = 1;
LineSegment3d lineSegment3D=polyline.GetLineSegmentAt(index);

int index = 1;
CircularArc3d circularArc3D=polyline.GetArcSegmentAt(index);

Point3d pt3d = polyline.GetPointAtDist(1200);
Point2d pt2d = new Point2d(pt3d.X, pt3d.Y);
double vaule = 60;
bool b = polyline.OnSegmentAt(index, pt2d, vaule);

Polyline polyline = new Polyline();
polyline.AddVertexAt(0, new Point2d(0, 0), 0, 0, 0);
polyline.AddVertexAt(1, new Point2d(10, 0), 0, 0, 0);
polyline.AddVertexAt(1, new Point2d(5, 5), 0, 2, 1);

polyline.RemoveVertexAt(1);

Point2d point2D = polyline.GetPoint2dAt(1);

Point2d point2D = new Point2d(5, 5);
polyline.SetPointAt(1, point2D);

double bulge = polyline.GetBulgeAt(0); 

polyline.SetBulgeAt(0, 2);

double startWidth=polyline.GetStartWidthAt(0);

double endWidth = polyline.GetEndWidthAt(0);

polyline.SetStartWidthAt(0, 2);

 polyline.SetEndWidthAt(0, 2);

 polyline.MinimizeMemory();

 polyline.MaximizeMemory();

polyline.Reset(true, 1); 

多线 Mline

属性中文数据类型作用
NumberOfVertices节点数int多线的节点数
SupressEndCaps抑制终点封口bool是否抑制终点的封口
SupressStartCaps抑制起点封口bool是否抑制起点的封口
IsClosed是否封闭bool多线是否封闭
Normal法向向量Vector3d多线所在平面的
单位法向向量
Scale比例double比例,两根线的间距
Justification对正MlineJustification对正模式
Style样式ObjectId多线的样式
方法参数说明
Mline( )无参数构造函数:声明一个空的多线
void AppendSegment
(
  Point3d newVertex
)


新的点
在多线末尾增加一个点
void RemoveLastSegment
(
  Point3d lastVertex
)


最后的点
移除最后一个点,参数无所谓
void MoveVertexAt
(
  int index,
  Point3d newPosition
)


节点索引
新的点
移动指定索引处的节点
int Element
(
  Point3d pt
)
未知方法,知道的联系我
Point3d VertexAt
(
  int index
)


节点索引
获得指定索引处的节点
Point3d GetClosestPointTo
(
  Point3d givenPoint,
  Vector3d normal,
  bool extend,
  bool excludeCaps
)


三维点
向量
是否延长
排除封口
点到多线的最近点,
相当于取点在向量上的射线
与多线求最近点
如果延长,则可以取延长线
上的最近点
排除封口的话会忽略封口,
求到两根线的最近点
Point3d GetClosestPointTo
(
  Point3d givenPoint,
  bool extend,
  bool excludeCaps
)


三维点
是否延长
排除封口
点到多线的最近点,
如果延长,则可以取延长线
上的最近点
排除封口的话会忽略封口,
求到两根线的最近点

Database database = HostApplicationServices.WorkingDatabase;
string name = "STANDARD";
ObjectId objectId = ObjectId.Null;
using (Transaction trans = database.TransactionManager.StartTransaction())
{
    DBDictionary ss = (DBDictionary)database.MLStyleDictionaryId.GetObject(OpenMode.ForRead);
    foreach (var item in ss)
    {
        if (item.Key.ToUpper() == name)
        {
            objectId = item.Value;
        }
    }
}
Mline mline = new Mline();
mline.Style = objectId;
mline.Normal = Vector3d.ZAxis;

Point3d point3D1 = new Point3d(0, 0, 0);
Point3d point3D2 = new Point3d(10, 10, 0);
mline.AppendSegment(point3D1);
mline.AppendSegment(point3D2);

Point3d lastVertex = new Point3d();
mline.RemoveLastSegment(lastVertex);

Point3d newPosition = new Point3d(10, 20, 0);
mline.MoveVertexAt(1, newPosition);

未知。希望你的补充

Point3d point3D = mline.VertexAt(1);

Point3d pt = new Point3d(0, 5, 0);
Vector3d vector3D = new Vector3d(-1, -1, 0);
var po = mline.GetClosestPointTo(pt, vector3D, false, false);

Point3d pt = new Point3d(0, 5, 0);
var po = mline.GetClosestPointTo(pt, false, false);

三维多段线 Polyline3d

属性中文数据类型作用
Length长度double多段线的长度
PolyType类型Poly3dType多段线的类型
Closed闭合bool多段线是否闭合
方法参数说明
Polyline3d( )无参数构造函数:声明一条空的
三维多段线
Polyline3d
(
  Poly3dType type,
  Point3dCollection vertices,
  bool closed
)


多段线类型
点集
是否闭合
构造函数:声明一条给定类型
确定点集和闭合的三维多段线
void ConvertToPolyType
(
  Poly3dType newVal
)


多段线类型
转化多段线类型
void Straighten( )无参数去除多段线类型
void SplineFit
(
  Poly3dType value,
  int segments
)


多段线类型
段数
修改多段线类型,设置段数,
段数越多,越平滑
void SplineFit( )无参数多段线类型为设置为三次
ObjectId AppendVertex
(
  PolylineVertex3d vertexToAppend
)


多段线节点
给多段线增加一个点
ObjectId InsertVertexAt
(
  ObjectId indexVertexId,
  PolylineVertex3d newVertex
)


插入点的id
新多段线点
在指定点插入新的点
(需有插入点的id)
void InsertVertexAt
(
  PolylineVertex3d indexVertex,
  PolylineVertex3d newVertex
)


插入处的点
新多段线点
在指定点插入新的点
IEnumerator GetEnumerator( )无参数枚举器(不知道咋用,
只知道可以foreach遍历每个点)

Polyline3d polyline3D = new Polyline3d();

Poly3dType poly3DType = Poly3dType.SimplePoly;
Point3dCollection point3DCollection = new Point3dCollection();
point3DCollection.Add(new Point3d(0, 0, 0));
point3DCollection.Add(new Point3d(10, 0, 0));
point3DCollection.Add(new Point3d(10, 10, 0));
bool isClosed = true;
Polyline3d polyline3D = new Polyline3d(poly3DType, point3DCollection, isClosed);

Poly3dType poly3DType = Poly3dType.CubicSplinePoly;
polyline3D.ConvertToPolyType(poly3DType);

polyline3D.Straighten();

polyline3D.SplineFit(Poly3dType.QuadSplinePoly, 3);

polyline3D.SplineFit();

PolylineVertex3d polylineVertex3D = new PolylineVertex3d(new Point3d(10, 10, 0));
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans=db.TransactionManager.StartTransaction())
{
    polyline3D = polyline3D.ObjectId.GetObject(OpenMode.ForWrite) as Polyline3d;
    polyline3D.AppendVertex(polylineVertex3D);
    trans.Commit();
}

Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans= db.TransactionManager.StartTransaction())
{
    polyline3D = polyline3D.ObjectId.GetObject(OpenMode.ForWrite) as Polyline3d;
    int n = 0;
    foreach (ObjectId item in polyline3D)
    {
        if (n == 1)
        {
            PolylineVertex3d polylineVertex3D = new PolylineVertex3d(new Point3d(20, 10, 0));
            polyline3D.InsertVertexAt(item, polylineVertex3D);
            break;
        }
        n++;
    }
    trans.Commit();
}

int n = 0;
foreach (PolylineVertex3d item in polyline3D)
{
    if (n == 1)
    {
        PolylineVertex3d polylineVertex3D = new PolylineVertex3d(new Point3d(20, 10, 0));
        polyline3D.InsertVertexAt(item, polylineVertex3D);
        break;
    }
    n++;
}

foreach (PolylineVertex3d item in polyline3D)
{
                
}

二维多段线 Polyline2d

属性中文数据类型作用
Length长度double多段线的长度
ConstantWidth全局宽度double多段线的全局宽度
LinetypeGenerationOn线型生成bool关闭时节点会打断线型
打开时节点不会打断线型
Elevation高程double多段线的标高(z轴)
Normal法向向量Vector3d单位法向向量
Thickness厚度double多段线的厚度
DefaultEndWidth终止宽度double多段线默认终止宽度
DefaultStartWidth起始宽度double多段线默认起始宽度
Closed闭合bool多段线是否闭合
PolyType拟合方式Poly2dTypeSimplePoly 无
FitCurvePoly 曲线拟合
QuadSplinePoly 二次
CubicSplinePoly三次
方法参数说明
Polyline2d( )无参数构造函数:声明一条空的二维多段线
Polyline2d
(
  Poly2dType type,
  Point3dCollection vertices,
  double elevation,
  bool closed,
  double startWidth,
  double endWidth,
  DoubleCollection bulges
)


拟合方式
顶点集
标高
是否闭合
起始宽度
终止宽度
凸度集合
构造函数:声明一条明确属性的
二维多段线
void ConvertToPolyType
(
  Poly2dType newVal
)


拟合方式
转换拟合方式
void Straighten( )无参数拟合方式改成SimplePoly
void SplineFit
(
  Poly2dType value,
  int segments
)


拟合方式
段数
修改拟合方式和段数
void SplineFit( )无参数拟合方式改成CubicSplinePoly
void CurveFit( )无参数拟合方式改成FitCurvePoly
void NonDBAppendVertex
(
  Vertex2d vertexToAppend
)


节点
添加一个节点
ObjectId AppendVertex
(
  Vertex2d vertexToAppend
)


节点
添加一个节点
(多段线需已经添加)
ObjectId InsertVertexAt
(
  ObjectId vertexId,
  Vertex2d newVertex
)


插入节点
新节点
在指定节点后新加一个节点
(多段线需已经添加)
void InsertVertexAt
(
  Vertex2d indexVertex,
  Vertex2d newVertex
)


插入节点
新节点
在指定节点后新加一个节点
IEnumerator GetEnumerator( )无参数迭代器
Point3d VertexPosition
(
  Vertex2d vertex
)


节点
获得指定节点的Point3d

Polyline2d polyline2D = new Polyline2d();

Point3dCollection pos = new Point3dCollection
{
    new Point3d(0, 0, 0),
    new Point3d(10, 0, 0),
    new Point3d(10, 10, 0),
    new Point3d(20, 10, 0)
};
DoubleCollection doubles = new DoubleCollection
{
    0,
    0,
    0,
    0
};
Polyline2d polyline2D = new Polyline2d(Poly2dType.SimplePoly, pos, 0, false, 0, 0, doubles);

polyline2D.ConvertToPolyType(Poly2dType.FitCurvePoly);

polyline2D.Straighten();

polyline2D.SplineFit(Poly2dType.CubicSplinePoly, 100);

polyline2D.SplineFit();

polyline2D.CurveFit();

Vertex2d vertex2D = new Vertex2d(new Point3d(20, 20, 0), 0, 0, 0, 0);
polyline2D.NonDBAppendVertex(vertex2D);

Vertex2d vertex2D = new Vertex2d(new Point3d(20, 20, 0), 0, 0, 0, 0);
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
    polyline2D.ObjectId.GetObject(OpenMode.ForWrite);
    polyline2D.AppendVertex(vertex2D);
    trans.Commit();
}

Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
    polyline2D.ObjectId.GetObject(OpenMode.ForWrite);
    int n = 0;
    foreach (ObjectId item in polyline2D)
    {
        if (n == 1)
        {
            Vertex2d vertex2D = new Vertex2d(new Point3d(15, 5, 0), 0, 0, 0, 0);
            polyline2D.InsertVertexAt(item, vertex2D);
            break;
        }
        n++;
    }
    trans.Commit();
}

int n = 0;
foreach (Vertex2d item in polyline2D)
{
    if (n == 1)
    {
        Vertex2d vertex2D = new Vertex2d(new Point3d(15, 8, 0), 0, 0, 0, 0);
        polyline2D.InsertVertexAt(item, vertex2D);
        break;
    }
    n++;
}

//IEnumerator enumerator = polyline2D.GetEnumerator();
//var obj = enumerator.Current;
//enumerator.MoveNext();
foreach (var item in polyline2D)
{

}

foreach (Vertex2d item in polyline2D)
{
    Point3d point3D = polyline2D.VertexPosition(item);
}

单行文字DBText

属性中文数据类型作用
Justify对齐点AttachmentPoint对齐方式
VerticalMode垂直对齐方式TextVerticalMode垂直对齐方式
HorizontalMode水平对齐方式TextHorizontalMode水平对齐方式
IsMirroredInYY轴镜像bool是否延Y轴镜像
IsMirroredInXX轴镜像bool是否延X轴镜像
TextStyleId文字样式IdObjectId文字样式的ObjectId
TextStyleName文字样式名称string文字样式的名称
TextString文字内容string单行文字的内容
WidthFactor宽度系数double宽度系数,1为默认
Height字高double字体的高度
Rotation旋转弧度double旋转的弧度(逆时针)
Oblique倾斜弧度double倾斜的弧度(左负右正)
Thickness厚度double厚度
Normal平面法向向量Vector3d所在平面法向向量
IsDefaultAlignment是否默认对齐bool否代表有对齐点
AlignmentPoint文本对齐点Point3d设置某些对齐方式后
的对齐点,代替基点
Position基点位置Point3d原始的基点

方法参数说明
DBText( )无参数构造函数
int CorrectSpelling( )无参数拼写错误?(不知道咋用)
void AdjustAlignment
(
  Database alternateDatabaseToUse
)


试试
不懂
void ConvertFieldToText( )无参数不懂
string getTextWithFieldCodes( )无参数不懂

DBText dBText = new DBText();

 

 

 

 

转角标注RotatedDimension

属性中文数据类型作用
Rotation文字倾斜double文字所在的线的切斜角
Oblique标注转角double两个标注线的倾斜角
DimLinePoint标注线定位点Point3d标注线经过的点
XLine2Point标注终点Point3d标注终点所在的点
XLine1Point标注起点Point3d标注起点所在的点
方法参数说明
RotatedDimension( )无参数构造函数
RotatedDimension
(
  double rotation,
  Point3d line1Point,
  Point3d line2Point,
  Point3d dimensionLinePoint,
  string dimensionText,
  ObjectId dimensionStyle
)


倾斜角
标注起点
标注终点
标注线定位点
标注文字替换
标注样式
构造函数
RotatedDimension rotatedDimension = new RotatedDimension();
double rotation = Math.PI / 6;
Point3d line1Point = new Point3d(0, 0, 0);
Point3d line2Point = new Point3d(100, 0, 0);
Point3d dimensionLinePoint = new Point3d(50, 30, 0);
string dimensionText = "150";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
RotatedDimension rotatedDimension = new RotatedDimension(rotation, line1Point, line2Point, dimensionLinePoint,dimensionText, dimensionStyle);

对齐标注AlignedDimension

属性中文数据类型作用
Oblique标注转角double两个标注线的倾斜角
DimLinePoint标注线定位点Point3d标注线经过的点
XLine2Point标注点2Point3d标注终点所在的点
XLine1Point标注点1Point3d标注起点所在的点
方法参数说明
AlignedDimension( )无参数构造函数
AlignedDimension
(
  Point3d line1Point,
  Point3d line2Point,
  Point3d dimensionLinePoint,
  string dimensionText,
  ObjectId dimensionStyle
)


标注起点
标注终点
标注线定位点
标注文字替换
标注样式
构造函数
AlignedDimension alignedDimension = new AlignedDimension();
Point3d line1Point = new Point3d(0, 0, 0);
Point3d line2Point = new Point3d(100, 0, 0);
Point3d dimensionLinePoint = new Point3d(50, 30, 0);
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
AlignedDimension alignedDimension = new AlignedDimension(line1Point, line2Point, dimensionLinePoint, dimensionText,
dimensionStyle);

角度标注LineAngularDimension2

属性中文数据类型作用
XLine2End标注线2终点Point3d标注线2终点
XLine2Start标注线2起点Point3d标注线2起点
XLine1End标注线1终点Point3d标注线1终点
XLine1Start标注线1起点Point3d标注线1起点
ArcPoint标注线定位点Point3d标注线定位点
方法参数说明
LineAngularDimension2( )无参数构造函数
LineAngularDimension2
(
  Point3d line1Start,
  Point3d line1End,
  Point3d line2Start,
  Point3d line2End,
  Point3d arcPoint,
  string dimensionText,
  ObjectId dimensionStyle
)


标注线1起点
标注线1终点
标注线2起点
标注线2终点
标注线定位点
文字替换
标注样式
构造函数
LineAngularDimension2 lineAngularDimension2 = new LineAngularDimension2();
Point3d line1Start = new Point3d(0, 0, 0);
Point3d line1End = new Point3d(0, 50, 0);
Point3d line2Start = new Point3d(10, 0, 0);
Point3d line2End = new Point3d(50, 50, 0);
Point3d arcPoint = new Point3d(30, 80, 0);
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
LineAngularDimension2 lineAngularDimension2 = new LineAngularDimension2(line1Start,line1End,line2Start,line2End, arcPoint,
dimensionText, dimensionStyle);

半径标注RadialDimension

属性中文数据类型作用
ChordPoint标注线定位点Point3d标注线定位点
Center圆心Point3d圆心
LeaderLength引线长度double引线长度
方法参数说明
RadialDimension( )无参数构造函数
RadialDimension
(
  Point3d center,
  Point3d chordPoint,
  double leaderLength,
  string dimensionText,
  ObjectId dimensionStyle
)


原点
标注线定位点
引线长度
文字替换
标注样式
构造函数
RadialDimension radialDimension = new RadialDimension();
Point3d center = new Point3d(0, 0, 0);
Point3d chordPoint = new Point3d(50, 50, 0);
double leaderLength = 100;
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
RadialDimension radialDimension = new RadialDimension(center, chordPoint, leaderLength, dimensionText,
dimensionStyle);
AddEntity(radialDimension);

直径标注DiametricDimension

属性中文数据类型作用
FarChordPoint远弦点Point3d远弦点
ChordPoint近弦点Point3d近弦点
LeaderLength引线长度double引线长度
方法参数说明
DiametricDimension( )无参数构造函数
DiametricDimension
(
  Point3d chordPoint,
  Point3d farChordPoint,
  double leaderLength,
  string dimensionText,
  ObjectId dimensionStyle
)


近弦点
远弦点
引线长度
文字替换
标注样式
构造函数
DiametricDimension diametricDimension = new DiametricDimension();
Point3d chordPoint = new Point3d(50, 0, 0);
Point3d farChordPoint = new Point3d(-50, 0, 0);
double leaderLength = 20;
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
DiametricDimension diametricDimension = new DiametricDimension(chordPoint, farChordPoint,leaderLength,
dimensionText,dimensionStyle);
AddEntity(diametricDimension);

弧长标注ArcDimension

属性数据类型说明
HasLeaderbool是否有说明引线
IsPartialbool是否是局部的
ArcSymbolTypeint圆弧样式(默认0)
0=弧长符号在文字前
1=弧长符号在文字上
2=不显示弧长符号
但是我怎么改他都不变
不知道为啥
XLine2PointPoint3d标注终点
XLine1PointPoint3d标注起点
Leader2PointPoint3d额外点2
Leader1PointPoint3d额外点1
CenterPointPoint3d圆心
ArcPointPoint3d标注定位点
ArcEndParamdouble圆弧终点参数
ArcStartParamdouble圆弧起点参数
方法参数说明
ArcDimension
(
  Point3d centerPoint,
  Point3d xLine1Point,
  Point3d xLine2Point,
  Point3d arcPoint,
  string dimensionText,
  ObjectId dimensionStyle
)


圆心
标注起点
标注终点
标注线定位点
文字替代
标注样式
构造函数
Point3d centerPoint = new Point3d(0, 0, 0);
Point3d xLine1Point = new Point3d(0, 50, 0);
Point3d xLine2Point = new Point3d(50, 0, 0);
Point3d arcPoint = new Point3d(70, 70, 0);
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
ArcDimension arcDimension = new ArcDimension(centerPoint, xLine1Point, xLine2Point, arcPoint, dimensionText,
dimensionStyle);
AddEntity(arcDimension);

折弯标注RadialDimensionLarge

属性数据类型说明
OverrideCenterPoint3d中心位置代替点
JogPointPoint3d折弯坐标
ChordPointPoint3d标记定位点
CenterPoint3d圆心
JogAngledouble折弯角度(设置了无效
不知道为啥子)
方法参数说明
RadialDimensionLarge( )无参数构造函数
RadialDimensionLarge
(
  Point3d center,
  Point3d chordPoint,
  Point3d overrideCenter,
  Point3d jogPoint,
  double jogAngle,
  string dimensionText,
  ObjectId dimensionStyle
)


圆心
标注定位点
中心位置代替点
折弯坐标
标注样式
文字替代
标注样式
构造函数

坐标标注OrdinateDimension

属性数据类型说明
LeaderEndPointPoint3d引线终点
DefiningPointPoint3d标注点
OriginPoint3d原点
UsingXAxisbool以X坐标为计量
UsingYAxisbool以Y坐标为计量
方法参数说明
OrdinateDimension( )无参数构造函数
OrdinateDimension
(
  bool useXAxis,
  Point3d definingPoint,
  Point3d leaderEndPoint,
  string dimText,
  ObjectId dimStyle
)


以X坐标为计量
标注点
引线终点
文字替换
标注样式
构造函数
OrdinateDimension ordinateDimension = new OrdinateDimension();
bool useXAxis = true;
Point3d definingPoint = new Point3d(50, 20, 0);
Point3d leaderEndPoint = new Point3d(70, 50, 0);
string dimensionText = "";
Document doc = Application.DocumentManager.MdiActiveDocument;
ObjectId dimensionStyle = doc.Database.DimStyleTableId;
OrdinateDimension ordinateDimension = new OrdinateDimension(useXAxis, definingPoint, leaderEndPoint,
dimensionText,dimensionStyle);

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/326726.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

使用Python实现深度学习模型通常涉及以下几个步骤:

本人详解 作者:王文峰,参加过 CSDN 2020年度博客之星,《Java王大师王天师》 公众号:JAVA开发王大师,专注于天道酬勤的 Java 开发问题中国国学、传统文化和代码爱好者的程序人生,期待你的关注和支持!本人外号:神秘小峯 山峯 转载说明:务必注明来源(注明:作者:王文峰…

RabbitMQ脑裂处理

脑裂现象&#xff1a; Network partition detected Mnesia reports that this RabbitMQ cluster has experienced a network partition. There is a risk of losing data. Please read RabbitMQ documentation about network partitions and the possible solutions. 转载请在文…

什么是技术架构?架构和框架之间的区别是什么?怎样去做好架构设计?(二)

什么是技术架构?架构和框架之间的区别是什么?怎样去做好架构设计?(二)。 技术架构是对某一技术问题(需求)解决方案的结构化描述,由构成解决方案的组件结构及之间的交互关系构成。广义上的技术架构是一系列涵盖多类技术问题设计方案的统称,例如部署方案、存储方案、缓存…

Centos系统安全设置

1 设置密码复杂度&#xff0c;帐号密码有效期3个月 密码复杂度要求&#xff1a;最小长度8位&#xff0c;至少2位大写字母&#xff0c;1位小写字母&#xff0c;4位数字&#xff0c;1位特殊字符 1&#xff09;执行备份&#xff1a; #cp -p /etc/login.defs /etc/login.defs_bak…

逸学Docker【java工程师基础】3.3Docker安装nacos

docker pull nacos/nacos-server docker network create nacos_network #创建容器网络 docker run -d \ --name nacos \ --privileged \ --cgroupns host \ --env JVM_XMX256m \ --env MODEstandalone \ --env JVM_XMS256m \ -p 8848:8848/tcp \ -p 9848:9848…

Linux 有哪些搜索方式?5分钟带你搞懂!

5分钟带你掌握 Linux 的三种搜索方式 前言 1.find 命令 find 命令是用来在给定的目录下查找符合给定条件的文件 语法格式&#xff1a;find [查找起始路径] [查找条件] [处理动作] &#xff08;1&#xff09;根据名称查找&#xff1a;find [查找起始路径] -name 文件名 或者…

​LeetCode解法汇总82. 删除排序链表中的重复元素 II

目录链接&#xff1a; 力扣编程题-解法汇总_分享记录-CSDN博客 GitHub同步刷题项目&#xff1a; https://github.com/September26/java-algorithms 原题链接&#xff1a;. - 力扣&#xff08;LeetCode&#xff09; 描述&#xff1a; 给定一个已排序的链表的头 head &#xf…

request entity too large 解决请求实体过大问题的方法

在网络请求过程中&#xff0c;有时会出现请求实体过大而导致服务器无法处理的情况。本文将介绍两种情况及其解决办法&#xff0c;真实可用&#xff01; 问题描述 请求实体过大问题主要分为两种情况&#xff1a; 1、带413状态码的请求实体过大 这种情况通常发生在请求文件过…

09- OpenCV:图像上采样和降采样

目录 1、上采样和降采样 简介 2、采样的应用场景 3、采样的API 4、图像金字塔概念 5、代码演示 1、上采样和降采样 简介 在图像处理中&#xff0c;上采样&#xff08;Upsampling&#xff09;和降采样&#xff08;Downsampling&#xff09;是常用的操作。 &#xff08;1&…

React函数式组件学习笔记

React是一种用于构建用户界面的JavaScript库&#xff0c;它采用组件化的方式来构建复杂的UI。在React中&#xff0c;函数式组件是一种声明式的方式去描述UI的状态和行为。 React的特性 1.声明式设计-React采用声明范式&#xff0c;可以轻松描述应用 2.高效-React通过对DOM的模…

若依顶部导航栏改造

若依顶部导航栏改造 1.改造后代码 需要代码的请私聊我&#xff01; 目前的话就是三级目录&#xff0c;太多了也没啥用&#xff01;

鸿蒙入门实战-ArkTS开发

声明式UI基本概念 应用界面是由一个个页面组成&#xff0c;ArkTS是由ArkUI框架提供&#xff0c;用于以声明式开发范式开发界面的语言。 声明式UI构建页面的过程&#xff0c;其实是组合组件的过程&#xff0c;声明式UI的思想&#xff0c;主要体现在两个方面&#xff1a; 描述…

ZooKeeper 安装

ZooKeeper 的安装包括单机模式安装&#xff0c;以及集群模式安装。 单机模式较简单&#xff0c;是指只部署一个 zk 进程&#xff0c;客户端直接与该 zk 进程进行通信。在开发测试环境下&#xff0c;通常来说没有较多的物理资源&#xff0c;因此我们常使用单机模式。 当然在单…

NXP采用RS RTS测试系统,验证28纳米RFCMOS雷达单芯片 |百能云芯

Rohde & Schwarz的雷达目标模拟器R&S RTS&#xff0c;作为汽车雷达的颠覆性解决方案&#xff0c;尤其是其能够电子模拟非常近距离物体的能力&#xff0c;已被用于验证NXP半导体的下一代雷达传感器参考设计的性能。 这一合作使汽车行业在汽车雷达的发展上迈出了一步&…

参加数据库活动,学习知识,领取奖品

去年12月1日我发了一篇关于数据库高可用的文章《我们的数据库需要什么样的HA&#xff1f;》&#xff0c;文中介绍了阿里云PolarDB MySQL通过了热备无感秒切技术&#xff0c;解决了HA场景下的故障探测、切换速度和切换体验的问题。文末提到了线上的PolarDB功能体验馆&#xff0c…

结构化流的介绍

目录 有界数据和无界数据 有界数据 无界数据 结构化流 基本介绍 入门案例 结构化流的编程模型 数据结构 数据源(Source) File Source Kafka Source(Spark 和 Kafka 整合) 整合Kafka准备工作 从kafka中读取数据 流式处理 批处理 数据写入Kafka中 流式处理 批处理…

Hadoop——HDFS、MapReduce、Yarn期末复习版(搭配尚硅谷视频速通)

一、HDFS 1.HDFS概述 1.1 HDFS定义 HDFS(Hadoop Distributed File System),它是一个文件系统&#xff0c;用于存储文件&#xff0c;通过目录树来定位文件&#xff1b;其次&#xff0c;它是分布式的&#xff0c;由很多服务器联合起来实现其功能&#xff0c;集群中的服务器有各自…

conda环境下FutureWarning: Pass sr=16000, n_fft=800 as keyword args问题解决

1 问题描述 在训练语音处理模型过程中&#xff0c;出现如下错误&#xff1a; audio.py:100: FutureWarning: Pass sr16000, n_fft800 as keyword args. From version 0.10 passing these as positional arguments will result in an errorreturn librosa.filters.mel(hp.samp…

Docker之网络配置的使用

&#x1f389;&#x1f389;欢迎来到我的CSDN主页&#xff01;&#x1f389;&#x1f389; &#x1f3c5;我是君易--鑨&#xff0c;一个在CSDN分享笔记的博主。&#x1f4da;&#x1f4da; &#x1f31f;推荐给大家我的博客专栏《Docker之网络配置的使用》。&#x1f3af;&…

芯品荟|电梯外呼面板屏驱市场调研报告

PART ONE 产品简介 - Introduction - 1.电梯外呼面板介绍 电梯外呼面板&#xff0c;用于显示电梯当前位置、运行状态和楼层信息&#xff0c;以便乘客在等待电梯时了解电梯的运行情况。 电梯外呼面板&#xff0c;按显示屏的种类&#xff0c;分为3类&#xff0c;分别是LED屏、L…