[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Splines to plines
Tip# ALSP1203 By Tony Hotchkiss On 01-Dec-2003
Rated By 2 users Downloaded : 9763
Categories : Curved Objects
Software type : AutoCAD
Spline-to-line.lsp converts splings to either lightweight polylines or 3D polylines.

Eric Proulx requested an AutoLISP program to convert splines to polylines. The SPLINE-TO-PLINE.LSP routine converts splines to either lightweight polylines or 3D polylines, depending on the spline. If the spline is 2D (planar) and the z-coordinates are zero, the routine creates a lightweight polyline. Otherwise the spline becomes a 3D polyline. In fact, there is no direct correlation between splines and polylines, so SPLINE-TO-PLINE.LSP generates a list of points along the spline and uses the points to create polylines that have only line segments. In order to retain accuracy, you can select the number of line segments. The default is 100 segments.

Figure 1 shows a variety of splines in different orientations, some planar and some 3D with the grip markers for the splines. Figure 2 shows the conversion to polylines, with grip markers. The default number of segments (100) was used for all of the objects. After conversion, the splines are deleted and the polylines are on the same layers that the splines were on.

Download SPLINE-TO-PLINE.LSP from our Get the Code area and save it in AutoCAD's Support directory. From the AutoCAD Tools menu, choose Load Applications, or enter Appload at the Command prompt. In the Load/Unload Applications dialog box, select the SPLINE-TO-PLINE.LSP file from the support directory where you installed it, then click Close. After you load the program, you are prompted to enter S2P to start.



Average Rating:

User comments