#include "EntMakeTest.h"
void
EntMakeDbox::makePolyline()
{
acutPrintf(_T("\nTesting make of AcDbPolyline..."));
AcGePoint3dArray vertices;
int ptCount;
if (getPointArray(vertices, ptCount) != Acad::eOk)
return;
AcDbPolyline* pline = new AcDbPolyline(ptCount); // optimized to know how many verts
// append all the vertices (as 2D)
Acad::ErrorStatus es;
AcGePoint2d pt;
for (int i=0;i
es = pline->addVertexAt(i, pt);
if (es != Acad::eOk)
ArxDbgUtils::rxErrorMsg(es);
}
// set elevation of pline from elevation of first point's Z (as does PLINE command)
pline->setElevation(vertices[0].z);
pline->setDatabaseDefaults();
ArxDbgUtils::transformToWcs(pline, acdbHostApplicationServices()->workingDatabase());
ArxDbgUtils::addToCurrentSpaceAndClose(pline);
}