Share

AcDbPolyline::AcDbPolyline

C++

AcDbPolyline(
    unsigned int num_verts
);

Description

The AcDbPolyline dynamically allocates memory when vertices are added. However, if you know the number of vertices to be added, memory can be allocated to the exact size by specifying the number of vertices in the constructor. Specifying a non-zero value for num_verts doesn't mean that the polyline automatically has that many vertices. It means that memory has been allocated, ready to be loaded with vertex information. The memory allocated is unused until it gets filled by AcDbPolyline::addVertexAt() calls.

If a polyline is being grown or shrunk by adding or removing vertices, the dynamic memory allocation will only grow and not shrink. When the user is finished adding or removing vertices, there may be unused allocated memory. To trim this unused memory, use AcDbPolyline::minimizeMemory() when all additions or removals to the polyline are done. This is not done automatically for every AcDbPolyline::addVertexAt and AcDbPolyline::removeVertexAt() because it is a time-expensive operation.

Parameters

Parameters Description
num_verts Input number of vertices to allocate memory for

Links

AcDbPolyline

Was this information helpful?