在建模过程中,建筑师和工程师并不需要对所有构件进行三维建模,也可通过创建标准详图,以说明如何构造较大项目中的材质。详图是对项目的重要补充,因为它们显示了材质应该如何相互连接。
本节将介绍在详图中使用的以及可以通过BIMBase API访问的详图线对象。详图线对象包括直线、圆、圆弧、多段线四类,如表7-1所示。
表7-1 详图线对象
直线对象 | BPModelLine |
---|---|
圆对象 | BPModelCircle |
圆弧对象 | BPModelArc |
多段线对象 | BPPolyLineEntity |
可通过调用相应接口创建详图线对象,示例代码7-1中通过构造函数创建了线(BPModelLine)对象,并将线添加到活动模型空间上。
BPDocument doc = BPApplication.singleton().activeDocument; BPModel model = doc.modelManager.activeModel;
GePoint3d PointS = new GePoint3d(9000, 9000, 0);
GePoint3d PointE = new GePoint3d(9000, 0, 0);
BPModelLine line = new BPModelLine(PointS, PointE);
line.lineStyle = DrawingLineStyles.eDashDot;
line.lineWeight = DrawingLineWeights.eW12; line.lineColor = System.Drawing.Color.Blue;
BIMBaseCS.BPStatus sta = line.addToDocument(model);
代码7-1 详细线对象的创建
通过构造函数创建了详图线对象后,也可以通过或方法更改详图线的相关参数,如表7-2所示。
表7-2 详图线对象接口
对象 | 属性/方法 | 描述 |
---|---|---|
直线对象BPModelLine | BPModelLine(GePoint3d startPoint, GePoint3d endPoint) | 两点创建直线对象 |
GeVec3d direction | 直线方向 | |
GePoint3d startPoint | 直线起点 | |
GePoint3d midPoint | 直线中点 | |
GePoint3d endPoint | 直线末端点 | |
圆对象BPModelCircle | BPModelCircle(GePoint3d center, double radius) | 创建圆对象(圆心,半径) |
BPModelCircle(GePoint3d center, GeVec3d normal, double radius) | 创建圆对象(圆心,方向向量,半径) | |
double area | 圆的面积 | |
double length | 圆的周长 | |
GeVec3d normal | 圆的方向向量 | |
GePoint3d center | 圆心 | |
圆弧对象BPModelArc | BPModelArc(GePoint3d startPoint, GePoint3d middlePoint, GePoint3d endPoint) | 创建圆弧对象(三点确定圆弧) |
BPModelArc(GePoint3d centerPoint, double radius, double startAngle, double sweepAngle) | 创建圆弧对象(圆心、半径、扫掠角度) | |
double length | 圆弧长度 | |
GeVec3d normal | 圆弧方向向量 | |
GeVec3d yDirection | Y方向向量 | |
GeVec3d xDirection | X方向向量 | |
GePoint3d endPoint | 圆弧末端点 | |
GePoint3d center | 圆弧圆心 | |
GePoint3d startPoint | 圆弧起始点 | |
double sweepAngle | 圆弧扫掠角度 | |
double startAngle | 扫掠起始角度 | |
多段线对象BPPolyLineEntity | BPPolylineEntity(List |
通过线段列表创建多段线对象 |
bool closed() | 是否闭合 | |
addVertex(GePoint3d point) | 添加顶点 | |
clearVertexs() | 清空所有点的信息 | |
setClosed(bool closed) | 设置是否闭合 | |
getVertex(int index, GePoint3d point, GePoint3d ptOhter, bool isArc, double startWidth, double endWidth) | 获取顶点 | |
numVerts() | 获取顶点数目 | |
setSegments(List |
设置多段线list |