<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to force draw a spline with its fitpoints instead of control points in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9734164#M4102</link>
    <description>&lt;P&gt;I derived a custom entity from AcDbSpline, and I need to draw something else at the fitpoints.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;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 &amp;gt; max)
		max = disp;
	disp = abs(extents.maxPoint().y - extents.minPoint().y);
	if (disp &amp;gt; max)
		max = disp;
	disp = abs(extents.maxPoint().z - extents.minPoint().z);
	if (disp &amp;gt; max)
		max = disp;
	max /= 50;
	getFitData(fitPoints, degree, fitTolerance, tangentsExist, startTangent, endTangent);
	for (int i = 0; i &amp;lt; fitPoints.length(); i++) {
		drawBDpoint(pVd, fitPoints[i], max);   //draw a circle at the i-th fitpoint with the radius max.
	}
	return;
}&lt;/LI-CODE&gt;&lt;P&gt;When the spline is displayed fitpoints,&amp;nbsp; the drawing works fine, while the circles will not be drawn the control points are displayed.&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 03:38:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-08T03:38:45Z</dc:date>
    <item>
      <title>How to force draw a spline with its fitpoints instead of control points</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9734164#M4102</link>
      <description>&lt;P&gt;I derived a custom entity from AcDbSpline, and I need to draw something else at the fitpoints.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;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 &amp;gt; max)
		max = disp;
	disp = abs(extents.maxPoint().y - extents.minPoint().y);
	if (disp &amp;gt; max)
		max = disp;
	disp = abs(extents.maxPoint().z - extents.minPoint().z);
	if (disp &amp;gt; max)
		max = disp;
	max /= 50;
	getFitData(fitPoints, degree, fitTolerance, tangentsExist, startTangent, endTangent);
	for (int i = 0; i &amp;lt; fitPoints.length(); i++) {
		drawBDpoint(pVd, fitPoints[i], max);   //draw a circle at the i-th fitpoint with the radius max.
	}
	return;
}&lt;/LI-CODE&gt;&lt;P&gt;When the spline is displayed fitpoints,&amp;nbsp; the drawing works fine, while the circles will not be drawn the control points are displayed.&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 03:38:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9734164#M4102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-08T03:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to force draw a spline with its fitpoints instead of control points</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737282#M4103</link>
      <description>&lt;P&gt;You can remove the fit data from an &lt;FONT face="courier new,courier"&gt;AcDbSpline&lt;/FONT&gt; using &lt;FONT face="courier new,courier"&gt;AcDbSpline::purgeFitData()&lt;/FONT&gt;. It will be displayed with circles at the control points then.&lt;/P&gt;
&lt;P&gt;If you don't want to loose the fit data you can retrieve it with &lt;FONT face="courier new,courier"&gt;AcDbSpline::getFitData(..)&lt;/FONT&gt; and restore it with &lt;FONT face="courier new,courier"&gt;AcDbSpline::setFitData(..)&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 10:58:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737282#M4103</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-09-09T10:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to force draw a spline with its fitpoints instead of control points</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737315#M4104</link>
      <description>&lt;P&gt;Sorry for the&amp;nbsp;confusion of my words before. I want to display circles(and someting else) at the fitpoints using the code above. If the spline is created using fit data, the fitpoints are displayed and the circles are drawn as I expected. If the spline is created using nurbs data, the control points are displayed, and the circles will not be drawn. So, I wonder if there is a simple way to force draw a spline with its fitpoints, no matter how the spline is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;AcDbSpline(nurbs data) ----&amp;gt; getFitData() ----&amp;gt; setFitdata() looks a littel&amp;nbsp;inefficient.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;In the AutoCad program, I can switch the drawing manually in the right-mouse menu of spline, but I can't find that in the arx document.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;I wonder if there is a sample "switch" can do the job, which determines how a spline is drawn. Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 11:23:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737315#M4104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-09T11:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to force draw a spline with its fitpoints instead of control points</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737620#M4105</link>
      <description>&lt;P&gt;Oh, I found that in the document. Sorry for my negligence.&lt;/P&gt;&lt;P&gt;AcDbSpline::setType()&amp;nbsp; would do the job.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 13:52:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-draw-a-spline-with-its-fitpoints-instead-of-control/m-p/9737620#M4105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-09T13:52:36Z</dc:date>
    </item>
  </channel>
</rss>

