How to create a Centreline "Node" with GC?

I have two line strings elements as GC nodes (polyline filters) and would like to generate a centreline automatically using GC tools.

This centreline node will then be the input for other GC nodes.

I want to create this in GC (rather than the geometry/alignment civil tools in the OpenRoads/Rail) 

I want to use the correct node type if anyone can help?

The options for polyline node dont seem to fit......

Thanks

Parents
  • Hello Stuart, 

    If you can share the input geometry type for the requirements then we can understand how we should progress. So far what i understand is you have 2 parallel lines and you want the center line between those lines using GC? 

    An image or the sample GCT file would be a good demonstration.  

    Regards,
    Alifur

  • Thanks for the reply.  A quick diagram below:

    Do I have to use function script?  or another easier GC method?

  • Hello Stuart,

    We have a custom node which helps to create midpoints between 2 specified points. We can use that custom node to create midpoint between the start & end points of the Polyline. Then join those midpoints would help us get the central line. See the below image. I have attached the dll and the example GCT file for reference. 

    1488.Assemblies.zip

    I hope this helps you. 

    Regards,
    Alifur

    Answer Verified By: Stuart Travis 

  • You can do this pretty simply like this:

    1. Place points along each polyline at vertices (in attached example I have only done one side for simplicity, do both if you want the best accuracy (you will need to sort the order though)
    2. Project points to the opposing PolyLine
    3. Draw a line between these points
    4. Get the midpoint by using a Point at parameter 0.5
    5. Connect the midpoints with a new polyline - note as mentioned above if you want to capture the vertices for both polylines you will need to order these midpoints to get a clean output. If you're not concerned with this then doing one side is much simpler

    GCT:

    transaction 1 stateChange 'Add baseCS'
    {
        gcModel
        {
            node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
            {
                Technique                 = 'AtDGNModelOrigin';
                DGNModelName              = 'Design Model';
                SymbolSize                = 1.0;
                GraphLocation             = <auto> {40.0, 40.0, 0.0, 118.59};
            }
        }
    }
    
    transaction 2 stateChange 'Add polyLine1_Vertex00, polyLine1_Vertex01, polyLine1_Vertex02, polyLine1_Vertex03, polyLine1_Vertex04'
    {
        gcModel
        {
            node User.Objects.polyLine1_Vertex00 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 3960.83365455615;
                YTranslation              = <free> -11308.3991935816;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 40.0, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex01 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 4904.6234616874;
                YTranslation              = <free> -9221.83406559898;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 225.443, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex02 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 6245.79845076864;
                YTranslation              = <free> -7805.95058589651;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 410.887, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex03 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 7686.31973533739;
                YTranslation              = <free> -7085.58881552156;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 596.33, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex04 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 10517.6891567311;
                YTranslation              = <free> -6911.70838818968;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 781.773, 0.0, 145.443};
            }
        }
    }
    
    transaction 3 stateChange 'Add polyLine1'
    {
        gcModel
        {
            node User.Objects.polyLine1 Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = {polyLine1_Vertex00, polyLine1_Vertex01, polyLine1_Vertex02, polyLine1_Vertex03, polyLine1_Vertex04};
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                GraphLocation             = {1312.493, -753.843, 0.0, 118.59};
            }
        }
    }
    
    transaction 4 stateChange 'Add polyLine2_Vertex00, polyLine2_Vertex01, polyLine2_Vertex02, polyLine2_Vertex03, polyLine2_Vertex04, polyLine2_Vertex05'
    {
        gcModel
        {
            node User.Objects.polyLine2_Vertex00 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 5309.59357399622;
                YTranslation              = <free> -11744.1684569563;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 40.0, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex01 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 6352.72967661497;
                YTranslation              = <free> -10048.8342904705;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 225.443, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex02 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 7135.86015931991;
                YTranslation              = <free> -9150.86246260638;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 410.887, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex03 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 8003.61963827195;
                YTranslation              = <free> -8656.08900174364;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 596.33, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex04 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 9130.89597074236;
                YTranslation              = <free> -8355.9805090892;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 781.773, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex05 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 10493.3594517138;
                YTranslation              = <free> -8250.53698464304;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 967.217, 0.0, 145.443};
            }
        }
    }
    
    transaction 5 stateChange 'Add polyLine2'
    {
        gcModel
        {
            node User.Objects.polyLine2 Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = {polyLine2_Vertex00, polyLine2_Vertex01, polyLine2_Vertex02, polyLine2_Vertex03, polyLine2_Vertex04, polyLine2_Vertex05};
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                GraphLocation             = {1308.282, -289.875, 0.0, 118.59};
            }
        }
    }
    
    transaction 6 stateChange 'Add point1'
    {
        gcModel
        {
            node User.Objects.point1 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ProjectOntoCurve';
                Curve                     = polyLine1;
                PointToProjectOntoCurve   = polyLine1.Vertices;
                GraphLocation             = {1605.091, -751.224, 0.0, 132.017};
            }
        }
    }
    
    transaction 7 stateChange 'Add point2'
    {
        gcModel
        {
            node User.Objects.point2 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ProjectOntoCurve';
                Curve                     = polyLine2;
                PointToProjectOntoCurve   = point1;
                GraphLocation             = {1592.771, -286.024, 0.0, 132.017};
            }
        }
    }
    
    transaction 8 stateChange 'Add constructionLine'
    {
        gcModel
        {
            node User.Objects.constructionLine Bentley.GC.NodeTypes.Line
            {
                Technique                 = 'ByPoints';
                StartPoint                = point1;
                EndPoint                  = point2;
                Color                     = Colors.Yellow;
                Visibility                = NodeVisibility.Visible;
                GraphLocation             = {1930.571, -530.024, 0.0, 132.017};
            }
        }
    }
    
    transaction 9 stateChange 'Add midPoint'
    {
        gcModel
        {
            node User.Objects.midPoint Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByParameterAlongCurve';
                Curve                     = constructionLine;
                T                         = 0.5;
                Visibility                = NodeVisibility.Visible;
                GraphLocation             = {2263.931, -521.864, 0.0, 132.017};
            }
        }
    }
    
    transaction 10 stateChange 'Add CL'
    {
        gcModel
        {
            node User.Objects.CL Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = midPoint;
                Color                     = Colors.Red;
                LineStyleName             = 7;
                GraphLocation             = {2597.531, -511.304, 0.0, 118.59};
            }
        }
    }
    

Reply
  • You can do this pretty simply like this:

    1. Place points along each polyline at vertices (in attached example I have only done one side for simplicity, do both if you want the best accuracy (you will need to sort the order though)
    2. Project points to the opposing PolyLine
    3. Draw a line between these points
    4. Get the midpoint by using a Point at parameter 0.5
    5. Connect the midpoints with a new polyline - note as mentioned above if you want to capture the vertices for both polylines you will need to order these midpoints to get a clean output. If you're not concerned with this then doing one side is much simpler

    GCT:

    transaction 1 stateChange 'Add baseCS'
    {
        gcModel
        {
            node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
            {
                Technique                 = 'AtDGNModelOrigin';
                DGNModelName              = 'Design Model';
                SymbolSize                = 1.0;
                GraphLocation             = <auto> {40.0, 40.0, 0.0, 118.59};
            }
        }
    }
    
    transaction 2 stateChange 'Add polyLine1_Vertex00, polyLine1_Vertex01, polyLine1_Vertex02, polyLine1_Vertex03, polyLine1_Vertex04'
    {
        gcModel
        {
            node User.Objects.polyLine1_Vertex00 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 3960.83365455615;
                YTranslation              = <free> -11308.3991935816;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 40.0, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex01 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 4904.6234616874;
                YTranslation              = <free> -9221.83406559898;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 225.443, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex02 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 6245.79845076864;
                YTranslation              = <free> -7805.95058589651;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 410.887, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex03 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 7686.31973533739;
                YTranslation              = <free> -7085.58881552156;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 596.33, 0.0, 145.443};
            }
            node User.Objects.polyLine1_Vertex04 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 10517.6891567311;
                YTranslation              = <free> -6911.70838818968;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {314.0, 781.773, 0.0, 145.443};
            }
        }
    }
    
    transaction 3 stateChange 'Add polyLine1'
    {
        gcModel
        {
            node User.Objects.polyLine1 Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = {polyLine1_Vertex00, polyLine1_Vertex01, polyLine1_Vertex02, polyLine1_Vertex03, polyLine1_Vertex04};
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                GraphLocation             = {1312.493, -753.843, 0.0, 118.59};
            }
        }
    }
    
    transaction 4 stateChange 'Add polyLine2_Vertex00, polyLine2_Vertex01, polyLine2_Vertex02, polyLine2_Vertex03, polyLine2_Vertex04, polyLine2_Vertex05'
    {
        gcModel
        {
            node User.Objects.polyLine2_Vertex00 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 5309.59357399622;
                YTranslation              = <free> -11744.1684569563;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 40.0, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex01 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 6352.72967661497;
                YTranslation              = <free> -10048.8342904705;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 225.443, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex02 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 7135.86015931991;
                YTranslation              = <free> -9150.86246260638;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 410.887, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex03 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 8003.61963827195;
                YTranslation              = <free> -8656.08900174364;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 596.33, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex04 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 9130.89597074236;
                YTranslation              = <free> -8355.9805090892;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 781.773, 0.0, 145.443};
            }
            node User.Objects.polyLine2_Vertex05 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'OnPlane';
                Plane                     = baseCS.XYPlane;
                XTranslation              = <free> 10493.3594517138;
                YTranslation              = <free> -8250.53698464304;
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                Visibility                = NodeVisibility.Hidden;
                GraphLocation             = <auto> {862.0, 967.217, 0.0, 145.443};
            }
        }
    }
    
    transaction 5 stateChange 'Add polyLine2'
    {
        gcModel
        {
            node User.Objects.polyLine2 Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = {polyLine2_Vertex00, polyLine2_Vertex01, polyLine2_Vertex02, polyLine2_Vertex03, polyLine2_Vertex04, polyLine2_Vertex05};
                Color                     = Colors.None;
                FillColor                 = Colors.None;
                LevelName                 = 'Default';
                LineStyleName             = '';
                LineWeight                = -1;
                Transparency              = 0.0;
                GraphLocation             = {1308.282, -289.875, 0.0, 118.59};
            }
        }
    }
    
    transaction 6 stateChange 'Add point1'
    {
        gcModel
        {
            node User.Objects.point1 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ProjectOntoCurve';
                Curve                     = polyLine1;
                PointToProjectOntoCurve   = polyLine1.Vertices;
                GraphLocation             = {1605.091, -751.224, 0.0, 132.017};
            }
        }
    }
    
    transaction 7 stateChange 'Add point2'
    {
        gcModel
        {
            node User.Objects.point2 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ProjectOntoCurve';
                Curve                     = polyLine2;
                PointToProjectOntoCurve   = point1;
                GraphLocation             = {1592.771, -286.024, 0.0, 132.017};
            }
        }
    }
    
    transaction 8 stateChange 'Add constructionLine'
    {
        gcModel
        {
            node User.Objects.constructionLine Bentley.GC.NodeTypes.Line
            {
                Technique                 = 'ByPoints';
                StartPoint                = point1;
                EndPoint                  = point2;
                Color                     = Colors.Yellow;
                Visibility                = NodeVisibility.Visible;
                GraphLocation             = {1930.571, -530.024, 0.0, 132.017};
            }
        }
    }
    
    transaction 9 stateChange 'Add midPoint'
    {
        gcModel
        {
            node User.Objects.midPoint Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByParameterAlongCurve';
                Curve                     = constructionLine;
                T                         = 0.5;
                Visibility                = NodeVisibility.Visible;
                GraphLocation             = {2263.931, -521.864, 0.0, 132.017};
            }
        }
    }
    
    transaction 10 stateChange 'Add CL'
    {
        gcModel
        {
            node User.Objects.CL Bentley.GC.NodeTypes.PolyLine
            {
                Technique                 = 'ByVertices';
                Vertices                  = midPoint;
                Color                     = Colors.Red;
                LineStyleName             = 7;
                GraphLocation             = {2597.531, -511.304, 0.0, 118.59};
            }
        }
    }
    

Children
No Data