Bentley ORD (openroads designer) secondary development (BIM) section 2 basic interface sharing

Preface

The first section of this series of articles refers to the Bentley ORD (openroads designer) secondary development (BIM) section one environment configuration

This section mainly introduces the general methods of ORD SDK, including the creation of basic elements, SDK common namespaces and related interface usage examples. If anything is wrong, you are welcome to modify and supplement in the comment area.

1. Namespace

Mainly introduce the three most basic namespaces, namely Bentley.GeometryNET, Bentley.DgnPlatformNET.Elements, MdlUtility.

Bentley.GeometryNET

This namespace mainly defines the most basic graphic elements in the Bently development package, including angles, two-dimensional points, three-dimensional points, two-dimensional vectors, three-dimensional vectors and other elements. These elements constitute subsequent complex graphics (including line segments, arcs, and complex chains). , Noodles, etc.).

  • Angle

    // 弧度与角度转换
    Angle.DegreesToRadians(double degress);
    Angle.RadiansToDegrees(double radians);
    // 常量
    Angle.PI;
    // 常用三角函数
    Angle.Acos;
    Angle.Asin;
    Angle.Atan;Angle.Atan2;
    // 角度自身三角函数运算
    Angle angle = new Angle();
    angle.Cos;
    angle.Sin;
    angle.Tan;
    
  • Two-dimensional point DPoint2d

    // 定义
    DPoint2d point = new DPoint2d(double ax, double ay);
    // 运算 是否同一个点
    DPoint2d.Equals(DPoint2d left, DPoint2d right);// 静态方法
    bool Equals(DPoint2d other); // 实例方法
    // 运算 求距离
    double Distance(DPoint2d target);
    
  • Three-dimensional point DPoint3d

    // 定义
    DPoint3d point = new DPoint3d(double ax, double ay, double az);
    // 运算 是否同一个点
    DPoint3d.Equals(DPoint3d left, DPoint3d right);// 静态方法
    bool Equals(DPoint3d other); // 实例方法
    // 运算 求距离
    double Distance(DPoint3d target);
    
  • Two-dimensional vector DVector2d

    // 定义
    DVector2d v = new DVector2d(DPoint2d origin, DPoint2d target);
    DVector2d v = new DVector2d(double ax, double ay);
    
  • Three-dimensional vector DVector3d

    // 定义
    DVector3d v = new DVector3d(DPoint3d origin, DPoint3d target);
    DVector3d v = new DVector3d(double ax, double ay, double az);
    

Bentley.DgnPlatformNET.Elements

This namespace mainly defines various elements formed in the drawing space, and all of its classes inherit from Element. Common element types include line segments, arcs, complex polylines, surfaces, complex surfaces, and various three-dimensional elements, which are the basic elements that constitute various types of complex models.

  • LineElement

    Line element, a drawing element composed of two points, see the next section for the creation method

  • ArcElement

    The arc element is drawn from the center, the start and end points or the angle. See the next section for the creation method

  • The method of creating other elements is the same as the method of creating line arcs. See the next section for details.

  • General element class Element

MdlUtility

This namespace mainly provides creation tools for drawing elements, including two-dimensional space element tools TwoDElementTools and three-dimensional space element tools ThreeDElementTools, which are mainly used to create various elements in space, as follows:

  • TwoDElementTools

    // 创建圆弧
    CreateArcElement1(DPoint3d startPoint, DPoint3d centerPoint, DPoint3d endPoint, bool isMajor);// 起点、终点、圆心,major暂时未弄清楚
    CreateArcElement2(DPoint3d CenterPoint, double PrimaryRadius, double SecondaryRadius, DMatrix3d Rotation, double StartAngle, double SweepAngle);// 圆心、主半径、第二半径、旋转法线、初始角度、圆弧角度
    // 创建线元素
    CreateLineElement1(List<DPoint3d> managedPoints);// 线段折点
    CreateLineElement2(DPoint3d startPoint, DPoint3d endPoint);// 线段起终点
    // 创建面元素
    CreateShapeElement1(List<DPoint3d> managedPoints, MsdFillMode FillMode);// 多边形折点、填充模式
    // 创建复杂链
    CreateComplexLineElement(List<Element> eles);// 首尾相接的元素列表
    // 创建复杂面
    CreateComplexShapeElement(List<Element> eles, MsdFillMode FillMode);// 根据首尾相接的元素列表,创建多边形元素
    /***************以上函数返回类型均为Element********************/// 获取元素起终点
    GetStartAndEndPoint(Element curve, ref DPoint3d StartPoint, ref DPoint3d EndPoint);
    
  • ThreeDElementTools

    // TODO List
    // 三维空间实体元素创建工具暂不做详细介绍,后续会根据开发情况逐步补充完善 
    

2. Project preparation

This series of articles is based on the tunnel design section drawing project as an example to summarize and share experience. The relevant namespace and interface functions introduced above will be used in the process. At the same time, a certain amount of mathematical and geometric analysis capabilities are required, mainly including the following:

  • Point, line, area relationship, tangency, intersection, etc.

  • Trigonometric function application

  • Similar triangle principle

  • Concepts such as normal, matrix, vector, etc.

  • Three-dimensional geometric space concept

Note: The section design parameters are complex and changeable. This project will customize a set of general and flexible section drawing algorithms according to different design parameters to adapt to different types of section design processes.

Follow the following public accounts, follow various technical articles, and get the follow-up push and sharing of this series

Guess you like

Origin blog.csdn.net/baidu_33480921/article/details/113101242