Overriding Custom Curve Object Draw Function

I am trying to write a class for a custom curve object that also includes custom drawing. At this phase I am still testing around and trying to become familiar with writing plugins in c++. However, it appears that the override for the draw function suddenly stops working as soon as I modify the grips for the associated curve. Can anyone explain why and how to fix this? Here is the code:

#include "stdafx.h"
#include "planCurve.h"
#include "rhinoSdkDraw.h"

ON_OBJECT_IMPLEMENT(planCurve,CRhinoCurveObject, "A0590105-4EE2-4924-A1BC-88554592C6D4")

planCurve::planCurve()
{
	this->EnableGrips(true);
}



void planCurve::Draw(CRhinoDisplayPipeline& dc) const
{
	ON_Color color = ON_Color(100, 100, 200);
	
	const ON_Curve* crv = this->Curve();
	dc.DrawCurve(*crv, color, 5,NULL);
}

void planCurve::DrawHighlightedSubObjects(CRhinoDisplayPipeline& dc) const
{

}

planCurve::planCurve(const planCurve& src)
	: CRhinoCurveObject(src)
{
}

planCurve& planCurve::operator=(const planCurve& src)
{
	if (&src != this)
	{
		CRhinoCurveObject::operator=(src);
	}

	return *this;
}

ON_Curve* planCurve::SetCurve(const ON_NurbsCurve& curve)
{
	return CRhinoCurveObject::SetCurve(curve);
}

void planCurve::SetCurve(ON_NurbsCurve* pCurve)
{
	CRhinoCurveObject::SetCurve(pCurve);
}


planCurve::~planCurve()
{
}

Were you ever able to resolve this issue? I am looking for information to help me accomplish something similar.

I couldn’t resolve the issue… My lack of experience C++ led me to shifting everything to python and abandoning custom grip objects altogether (I’m pretty sure I found an alternative to custom grips with a rhino.input function instead).

@dks5254 - does your custom curve object also provide a custom grip handler? If not, then when the curve’s grips are modfied, then your custom curve object will be replaced witt a regular CRhinoCurveObject.

– Dale