you can ToPolyline() to get the underlying polyline from a polylineCurve
please post the code that causes the error.
Curve inputCrv;
Polyline polyline;
//
if (inputCrv is PolylineCurve pCrv)
{
polyline = pCrv.ToPolyline;
}
else
{
// error handling
}
//
// alternative
if (inputCrv.TrygetPolyline(out polyline))
{
//...
}
// or if you prefere
if (! inputCrv.TrygetPolyline(out polyline))
{
// error
return;
}
// ... go on with your logic here