This is my code:
Rhino.Geometry.Curve curve = new Rhino.Geometry.Curve.CreateInterpolatedCurve(points, 3, CurveKnotStyle.Uniform);
Visual Studio gives me this error:
“The type name ‘CreateInterpolatedCurve’ does not exist in the type ‘Curve’”
How do I fix this?
dale
(Dale Fugier)
February 27, 2016, 12:51am
2
Rhino.Geometry.Curve
is a RhinoCommon class - something you’d use if you were writing a plug-in in .NET.
From your past posts, it appears that you are writing a plug-in in C++. Here is a sample of creating an interpolated NURBS curve in C++.
https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleCommands/cmdSampleInterpCurve.cpp
dale
(Dale Fugier)
February 27, 2016, 12:59am
3
My mistake - you might be using RhinoCommon, in which case CreateInterpolatedCurve
is a static function on Rhino.Geometry.Curve
. Make sure you project references RhinoCommon.
menno
(Menno Deij - van Rijswijk)
February 27, 2016, 10:02am
4
This statement is wrong:
Rhino.Geometry.Curve curve = new Rhino.Geometry.Curve.CreateInterpolatedCurve(points, 3, CurveKnotStyle.Uniform);
Because CreateInterpolatedCurve is a static function, you must call it like this (without the new
operator):
Rhino.Geometry.Curve curve = Rhino.Geometry.Curve.CreateInterpolatedCurve(points, 3, CurveKnotStyle.Uniform);
1 Like
dale
(Dale Fugier)
February 27, 2016, 6:06pm
5
Good catch @menno . I completely missed the ‘new’…
Thank you all for your help, I was able to fix it.