Autodesk / civilconnection

CivilConnection enables the exchange of information between Civil 3D, Dynamo and Revit.
94 stars 43 forks source link

Featureline.PointAtStation still getting point when point is not lying on the featureline #39

Closed atultegar closed 4 years ago

atultegar commented 4 years ago

Hi, In Civil 3D file, the corridor contains only 1 baseline while having 2 baseline regions. Due to which it creates 2 featurelines for same point code. Also, the baseline is made up of very long alignment, due to which whenever I used the node Featureline.PointAtStation giving any station value outside the start and end point of featureline (but the station value withing the alignment station range), I am getting a point. Instead of getting point value, it should give an error or null value for a point.

CivilConn_PointAtStation

CivilConn_PointAtStation2

I also checked the old code of CivilConnection, it was as below: `public CoordinateSystem CoordinateSystemByStation(double station, bool vertical = true) { Utils.Log(string.Format("Featureline.CoordinateSystemByStation started...", ""));

        CoordinateSystem cs = null;
        CoordinateSystem output = null;

        if (Math.Abs(station - this.Start) < 0.00001)
        {
            station = this.Start;
        }

        if (Math.Abs(station - this.End) < 0.00001)
        {
            station = this.End;
        }

        //bool findIntersection = true;

        if (station < this.Start || station > this.End)
        {
            var message = "The Station value is not compatible with the Featureline.";

            Utils.Log(string.Format("ERROR: {0}", message));

            //findIntersection = false;
            //return null;
        }

        cs = this._baseline.CoordinateSystemByStation(station);

        Utils.Log(string.Format("CoordinateSystem: {0}", cs));`

and in the new version of code : ` public CoordinateSystem CoordinateSystemByStation(double station, bool vertical = true) { Utils.Log(string.Format("Featureline.CoordinateSystemByStation started...", ""));

        CoordinateSystem cs = null;
        CoordinateSystem output = null;

        if (Math.Abs(station - this.Start) < 0.00001)
        {
            station = this.Start;
        }

        if (Math.Abs(station - this.End) < 0.00001)
        {
            station = this.End;
        }

        if (station < this.Start || station > this.End)
        {
            var message = "The Station value is not compatible with the Featureline.";

            Utils.Log(string.Format("ERROR: {0}", message));
        }

        cs = this._baseline.CoordinateSystemByStation(station);

        Utils.Log(string.Format("CoordinateSystem: {0}", cs));`

CivilConnection_temp.log

Requesting you to look into this issue.

Thanks Atul Tegar

paoloemilioserra commented 4 years ago

@atultegar this is by design, not going to change it.