ObjectARX
AcdbPolyLine
ObjectARX 中提供了三种多段线的相关类:AcDbPolyline 、AcDb2dPolyline 和
AcDb3dPolyline 。其中,利用AutoCAD 的内部命令可以创建AcDbPolyline 和AcDb3dPolyline
类的对象,用PLINE 命令创建的对象是轻量多段线(AcDbPolyline ),用3DPOLY 命令创建
的对象是三维多段线(AcDb3dPolyline )。
创建轻量多段线和三维多段线的函数,直接封装AcDbPolyline 和AcDb3dPolyline 类的构
造函数即可;创建正多边形、矩形、圆形和圆环,实际上都是创建了特殊形状的轻量多段线,
创建这些对象的关键都在于顶点和凸度的确定。
其构造函数和常用员函数如下:
AcDbPolyline(unsigned int num_verts);
Acad::ErrorStatus
addVertexAt(
unsigned int index,
const AcGePoint2d& pt,
double bulge = 0.,
double startWidth = -1.,
double endWidth = -1);
|
index
|
Input the index (0 based) before which to insert the vertex
|
|
pt
|
Input vertex location point
|
|
bulge
|
Input bulge value for vertex
|
|
startWidth
|
Input start width for vertex
|
|
endWidth
|
Input end width for vertex
|
Acad::ErrorStatus
setBulgeAt(
unsigned int index,
double bulge);
|
index
|
Input the index (0 based) of the vertex
|
|
bulge
|
Input the bulge value for the vertex
|
