****Readme text to AUTOpat.LSP and AUTOform.LSP June 8, 1997********** All rights reserved Peter Allen Landeck 100314.1364@compuserve.com http://ourworld.compuserve.com/homepages/PLANDECK The author of this LSP program accepts no responsibility for loss of data of any kind through use of this LSP program. It is recommended you make a back-up file of your data before using this program. Some parts of these routines were originally developed by the authors of Maximizing Autocad: Inside Autolisp Volume II (New Riders Publishing), to which authors I acknowledge my indebtedness. ZIP CONTENTS: The following files should be found in AUTOpat.ZIP AUTOpat.lsp AUTOform.lsp ANGLE.DWG AUTOpat.TXT RUBBLE.PAT USE: AUTOpat.LSP creates a typical Autocad hatch pattern from a sample pattern created by the user in a 1 unit by 1 unit square. The catch is, only POINTS and LINES may be used by the program, and only LINES at specific angles in approximate increments of 7 degrees can be used. This is a little bit limiting, but not stifling. The following LINE angles measured from the horizontal may be used: 180, 172.8750, 165.9638, 153.4349, 143.1301, 135, 123.6901, 116.5651, 104.0364, 97.1250, 90, 82.875, 75.964, 63.434949, 56.3099, 45, 36.8699, 26.56505, 14.036243, 7.125016. These odd seeming angles are derived by measuring the angle of a line between various interstices of a square grid. A graphic depiction of these LINES at their allowable angles and a pattern created with them is shown in the appended ACAD sample drawing file ANGLE.DWG. LINES angled between 180 and 360 degrees which are the mirror of the above given angles may of course also be used. The other catch is, your sample pattern must me created within a 1 unit by 1 unit square to run through AUTOpat.LSP. This seems a small concession, since the final hatch pattern can be generated at any scale. AUTOFORM.LSP: To help alleviate the obscure LINE angle problem, a sample pattern may be randomly created (i.e. without specific attention to the angle of the individual lines) and then processed with AUTOform.LSP, which will adjust each line to conform to the closest angle listed above. This automates what otherwise might be a very tedious process and allows the designer some degree of freedom in creating the sample pattern. After the sample pattern has been processed, the LINES may appear somewhat disjointed and will have to be adjusted manually (without altering their specific angles) to achieve the desired result. To run AUTOform.LSP, make sure the file AUTOform.LSP is in your ACAD path (the ACAD\SUPPORT directory is a standard place). Then type (LOAD "AUTOFORM") including the parentheses and quotation marks. If the program loads properly, the computer should prompt you to type AUTOFORM again to actually run the program on a sample pattern contained in a 1 unit by 1 unit square area. BUGS: AUTOpat.LSP has been tested on ACADR12 for Dos and for Windows and on OS2 Warp. RUBBLE.PAT The hatch file RUBBLE.PAT, which hatches a random appearing rubble stone wall pattern, is included with these files as a demonstration of AUTOpat.LSP and AUTOform.LSP. The rubble pattern was created as described above. A sample of the RUBBLE hatch may be seen in the ANGLE.DWG mentioned above. AUTOLOADING: The user may add AUTOpat.LSP to the ACAD.LSP file so that it loads automatically each time, without the user having to remember to load it when opening a different drawing or reopening a session of Autocad after quitting. Refer to the Autocad reference manual for specific instructions. However, generally this may be accomplished by adding (defun S::STARTUP () (prompt "\nRunning STARTUP function...\n") (load "autotime" "\AUTOpat.LSP not found.") );defun S::STARTUP to the end of the ACAD.LSP file. The same lines may be added for AUTOform.LSP. MANUAL LOADING: To load, make sure the AUTOpat.LSP file is in your ACAD path, usually the ACAD\SUPPORT directory is a good location for LSP files. From the Autocad command line type (LOAD "AUTOPAT") including the parentheses and quotation marks. The program should load and the user is prompted to type AUTOPAT to run the program. Accordingly, type AUTOPAT and follow the prompts. Name the hatch pattern your will be creating and type in a short description. After the program has run you will be prompted whether to append your new pattern to the ACAD.PAT file. If you respond yes, the pattern data is added to the end of this file found in the ACAD\SUPPORT directory. If you respond no, the hatch pattern is saved in your current ACAD directory or the ROOT directory under the name you gave it with the suffix .PAT. You may want to move this file to your ACAD\SUPPORT directory. To use the hatch pattern, use the HATCH command and type in the name of the program. ACAD should find it and you should be able to use it like any other hatch pattern. You may type AUTOPAT any time during the same ACAD drawing session without reloading AUTOpat.LSP to run the program. If you load another drawing or quit the drawing editor you need to reload AUTOpat.LSP again manually. However, you can automate the process in your ACAD.LSP file as described above. AUTOLOCK: AUTOpat.LSP is equipped with another LSP program which will limit your use of AUTOpat.LSP to loading 10 times, afterwhich AUTOpat.LSP will cease to function. Downloading AUTOpat.LSP again and reloading it will not allow it to function. To obtain a copy with unlimited use contact Peter Landeck at 100314.1364@compuserve.com. An unlimited use copy of the two programs costs $20. SUMMARY: To create a hatch pattern you might proceed as follows: A. Draw a 1 unit by 1 unit square in AUTOCAD B. Draw a sample pattern, i.e. 1 tile of a repeating sequence in both the X and Y direction, within the 1 unit by 1 unit square. Use only LINES and POINTS in your sample pattern. C. Erase the 1 unit by 1 unit border and run AUTOform.LSP to adjust all the LINE angles to their allowable equivalents. Mend any lines disjointed by AUTOform.LSP without changing their angle from the horizontal. Make sure the sample pattern still fits exactly within a 1 unit by 1 unit square. D. Run AUTOpat.LSP on the sample pattern. Test your hatch with the ACAD HATCH command or pull-down menu, typing in the name of your pattern. TIP: To create a sample pattern perfectly tileable in 4 directions, draw your 1 unit square pattern, copy it into a grid of 4 (blue squares), place a 5th 1 unit square (red square) without pattern in the exact middle of the 4 copies, cut away all lines outside of the 5th square border (green lines), mend any lines inside the new 5th square which don't meet properly. The new 1 unit square pattern remaining (red square) will be perfectly tileable in 4 directions. See the sample drawing ANGLE.DWG for an illustration. AUTOLOCK: AUTOform.LSP is protected with AUTOlock. After 10 demonstration uses the program will become inoperable. An unlimited use non-encrypted copy of AUTOform.LSP costs $20. Kindly contact Peter Landeck at 100314.1364@compuserve.com for where to send a check or money order.