Autodesk / civilconnection

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

Featureline.CoordinateSystemByStation return null #2

Closed EduardLouis closed 5 years ago

EduardLouis commented 5 years ago

Hi,

There is an error on Intersection method from Dynamo. It's a little bit strange for me, when a featureline polycurve is intersected with a plane XZ of a coordinate system from the Baseline return a list of nurbs. If each curve of the polycurve is intersected with the plane XZ from coordinate system everything works fine. Also if I make a surface on that plan and intersect with the polycurve, works fine.

Capture

I try something like in below code and works fine, but I'm not sure if it's safe for large amount of data or not. Today trying this changed method on large list, Revit close without any message. Not sure if the issues is from here or from another part.

Plane plane = cs.ZXPlane;
                //max distance of surface to intersect the polycurve
                double maxDistForIntersect = 1000;

                Plane plane = cs.ZXPlane;
                Rectangle rec = Rectangle.ByWidthLength(plane, maxDistForIntersect, maxDistForIntersect);
                Surface recS = Surface.ByPatch(rec);
                PolyCurve pc = this._polycurve;

                Point p = null;
                double d = double.MaxValue;
                dynamic rezIntersect = recS.Intersect(pc);
                foreach (var result in rezIntersect)

If there is another better solution for this issue, when Featureline.CoordinateSystemByStation return null (Error - Point is null), please let me know.

paoloemilioserra commented 5 years ago

@EduardLouis are you able to share the dataset (DYN, RVT and DWG) and the log file? If you cannot share Revit and Civil 3D data, please use the Project Refinery Data.Remember node on the results of Featureline.Curve and Baseline.CoordinateSystemByStation.

EduardLouis commented 5 years ago

I'll try yo install Project Refinery. Today trying get the result in another script I see that the problem is in fact from Geometry Working Range. When is Medium works fine, when is Large give errors.

Medium Range image

Large Range image

And I find my answer in your documentation: image

paoloemilioserra commented 5 years ago

Thanks @EduardLouis, it will be addressed in future releases of Dynamo Core, the team is aware of it.