Sunday, May 31, 2009

What is the maximum number of vertices in AutoCAD polylines?

The number of polyline vertices (in a Polyline, LWpolyline, 3Dpolyline, Spline) is not limited in AutoCAD, you can use any practical number of polyline nodes (vertex). So you can create and edit curves with more than 100.000 vertices.

With such extremely large polylines, you have to count with slower response in some operations (e.g. displaying grips on grip-editing).

You can try yourself the following AutoLISP code:

(setq x 0 y 0)
(setvar "CMDECHO" 0)
(command "_PLINE")
(repeat 100001
(command (list x y))
(setq x (+ x 1.0) y (+ y 1.0))
)
(command "")
(setvar "CMDECHO" 1)
(vl-load-com)
(vlr-beep-reaction)

For comparison: the maximal number of polyline vertices is limited to 101 in the DGN V7 format, and to 5.000 points in the DGN V8 format.

No comments:

Post a Comment