
This book will show you the basic principles to get you started. Perhaps you can not find a commercial program that does exactly what you want it to do, what your needs are don’t warrant the cost of a commercial program, you want more control of the CNC code, or you may just enjoy the challenge of doing it. There are many reasons why one might want to create his own programs to generate CNC code from tool paths drawn in AutoCAD. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.ĪutoCAD and AutoLISP are registered trademarks of Autodesk, Inc. The author makes no express or implied warranty of any kind and assumes no responsibility for errors or omissions. It is assumed, however, that the reader does know AutoCAD and G-code. The programming language used is AutoLISP, but the article assumes the reader knows nothing about AutoLISP (this could also be done with VBA or VSTA). This article presents the basics on producing G-code using nothing but AutoCAD and one of its built-in programming languages. SetWidth Sets the start and end width of a polyline, given the segment index.Don Jones has spent the past 20 years using and customizing AutoCAD in the stair manufacturing industry. SetBulge Sets the bulge of a polyline, given the segment index. Use the following methods to update the bulge or width of a polyline: AddVertex Adds a vertex to a lightweight polyline. Coordinates property Specifies the coordinates for each vertex in the polyline. Use the following properties and methods to open or close a polyline, change the coordinates of a polyline vertex, or add a vertex: Closed property Opens or closes the polyline.

To edit a polyline, use the properties and methods of the LightweightPolyline or Polyline object.

A fit polyline uses standard curves for curve fit and utilizes any tangent directions set on any given vertex. Both polylines are controlled by the AutoCAD SPLINETYPE system variable. There are two kinds of spline-fit polylines: quadratic and cubic. A spline-fit polyline uses a curve fit, similar to a B-spline. 2D and 3D polylines, rectangles, polygons, and 3D polygon meshes are all polyline variants and are edited in the same way.ĪutoCAD recognizes both fit polylines and spline-fit polylines.
