GenerativeComponents Help

Creating Nodes from Bentley.Geometry Library

Nodes can be created using the Bentley.Geometry library. This is another way to create lightweight geometry and avoid creating superfluous top-level nodes. Most geometric nodes have a technique for creating the node from the D-Series types such as DPoint3d, DEllipse3d or DPlane3d.

The following example shows a line created from a DSegement3d.

transaction 1 modelChange 'Add baseCS, Change baseCS'
{
    node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
    {
        Technique                 = 'AtModelOrigin';
        GraphLocation             = <auto> {40.0, 40.0};
    }
    node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
    {
        Technique                 = 'AtModelOrigin';
        DGNModelName              = '3D Metric Design';
        GraphLocation             = {29.167, 81.667, 174.0, 0.0};
    }
}

transaction 2 script 'Create Line from DSegment3d'
{
        	Line ln = new Line("joiningLine");
    		DPoint3d startPoint = new DPoint3d(1.2, 3.4, 0.0);
    		DPoint3d endPoint = new DPoint3d(2.0, 4.5, 0.0);
    		DSegment3d seg3d = new DSegment3d();
    		seg3d.StartPoint = startPoint;
    		seg3d.EndPoint = endPoint;
    		ln.FromDSegment3d(baseCS, seg3d);
}