For AutoCAD Users
How to incorporate any of these curves into AutoCAD.
Three support files, plus the curve file
Each curve page has its own AutoLISP listing. Copy that listing into a file such as Parabola.lsp. The command will not run without the shared file, and it will not offer a dialog unless that curve asks for one.
- Curvecore.lsp — required for every curve. Save it under that name. Do not rename it. Each curve loads it by that name.
- _Curvelist.lsp — optional command list for the whole set. Loading it defines the curve names. The first time you type a name, AutoCAD loads that curve’s .lsp file. Skip this file if you want only one curve: load that curve’s .lsp directly.
-
A dialog file, only when the curve names one. In the opening lines of the curve code,
dcl nilmeans no dialog file.dcl "PARABOLA"means AutoCAD will look for Parabola.dcl. The word in quotes is the file name, without the extension.
Steps
- On the curve page, copy the AutoLISP listing into a text file whose name matches the load name in _Curvelist.lsp. Yin-Yang is YinYang.lsp. Parabola is Parabola.lsp.
- Save Curvecore.lsp in the same folder.
- If
dclis nil, stop here. If it is a name, copy the Parabola specimen below, change the dialog name and the label, and save it as that name with a .dcl extension. - Put the folder on the Support File Search Path, and on Trusted Locations if AutoCAD warns that the file is not trusted. Options, Files tab.
- The support path lets AutoCAD find a file. It does not run it. Use APPLOAD on _Curvelist.lsp. To have the names ready each session, add that file to the Startup Suite from the same dialog.
- Type the curve name at the command line.
- Be circumspect with generalized variables. A non-integer exponent on a negative value can produce an imaginary result. The curve then breaks the polyline and starts a new one.
- PEDIT Fit, which the command may offer at the end, can add extra spans and loops at sharp cusps. Trim or Decurve if the fitted result is not what you want.
- For dramatic zig-zag polar effects, try changing the span value to a very large number (e.g. 1e6) before running certain curves. Also see Caveats
- You are free to reformat or modify the code. This material is public domain.
Dialog specimen
Parabola.dcl
is the whole file. The name before the colon must match the dcl string, and key="list_col" must stay. The curve code fills that list. The label is the title on the dialog and can be the curve’s name.
//PARABOLA.DCL
PARABOLA:dialog {label="Parabola"; :list_box {key="list_col"; allow_accept=true; height=8; width=15;} ok_button;}
A sine dialog is the same file with three edits: the comment, the dialog name, and the label. The width and height settings will often need adjustment.
//SINE.DCL
SINE:dialog {label="Sine Curve"; :list_box {key="list_col"; allow_accept=true; height=8; width=15;} ok_button;}