Message 1 of 4

Not applicable
09-07-2020
08:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I derived a custom entity from AcDbSpline, and I need to draw something else at the fitpoints.
void MyEnt::subViewportDraw(AcGiViewportDraw* pVd)
{
assertReadEnabled();
AcDbSpline::subViewportDraw(pVd);
if (!hasFitData())
return;
AcDbSpline* currentEnt = NULL;
AcDbObjectIdArray ss;
AcDbObjectId oID = NULL;
AcDbEntity* pEnt = NULL;
AcGePoint3dArray fitPoints;
Adesk::Boolean tangentsExist;
AcGeVector3d startTangent;
AcGeVector3d endTangent;
int degree;
double fitTolerance;
AcDbExtents extents;
getGeomExtents(extents);
double max = 0, disp = 0;
disp = abs(extents.maxPoint().x - extents.minPoint().x);
if (disp > max)
max = disp;
disp = abs(extents.maxPoint().y - extents.minPoint().y);
if (disp > max)
max = disp;
disp = abs(extents.maxPoint().z - extents.minPoint().z);
if (disp > max)
max = disp;
max /= 50;
getFitData(fitPoints, degree, fitTolerance, tangentsExist, startTangent, endTangent);
for (int i = 0; i < fitPoints.length(); i++) {
drawBDpoint(pVd, fitPoints[i], max); //draw a circle at the i-th fitpoint with the radius max.
}
return;
}
When the spline is displayed fitpoints, the drawing works fine, while the circles will not be drawn the control points are displayed.
I need to create myEnt with NURBS data instead of fitpoints, and the spline created are displayed with control points on default. If I want to see my custom drawing, I need to display the fitpoints manually. And there comes the question, how can I force draw the spline with its fitpoints, no mater how it is created?
Solved! Go to Solution.