3/21/2021 0 Comments Contour Lisp Autocad
Ads help support our ability to provide you all our articles and papers at no cost to you.His project is missing some contours, and he wants to form an intermediate contour assuming a linear interpolation between the contour heights.The AutoLISP solution is CONTOURS.LSP, which allows the user to select any two polylines (lightweight or 2D) and enter a precision number (default 100) for the number of segments in the resulting polyline.If the terrain changes height rapidly in some places and is flatter in others, then the contours will be close together in parts and may be far apart in other sections (figure 1).
A bonus file I wrote, RPL.LSP, will come in handy to reverse the direction of any selected polyline. Figure 1. Terrain contours with varying distances between them. Applying CONTOURS.LSP to the parts of the contours that are somewhat parallel shows better results than those that vary wildly (figure 2). The precision (number of segments) gave good results for anything over 200 but did not improve much between 300 and 2,000. It took about 1 second for 200 points and about 5 seconds for 1,000 points to generate the curve. Figure 2. A contour generated between two existing contours. Contour Lisp Autocad Download The CONTOURSGet the Code Download the CONTOURS.LSP and RPL.LSP files from Cadalysts CAD Tips site and save them in AutoCADs Support directory. Use the Appload facility by selecting Tools Load Application. Then select the CONTOURS.LSP and RPL.LSP programs from where you stored them. How to Use the CONTOURS Code After you load the code, the system prompts you to enter CT to start the program. To see this prompt, you may need to set your Command window size to 3 lines by dragging the Command window splitter bar appropriately. If you are using AutoCAD 2006 and you are not using the Command line area, you can still enter CT to start. How the prompts are displayed will depend on the version of AutoCAD. After you select the polylines, the Precision: prompt is displayed, and you can select Enter to accept the default value shown of 100 points. It is assumed that the polylines (contours) run in the same direction, so they are logically parallel, and you do not therefore select any particular end of the chosen contours. The result is a polyline made up of line segments only, and you may want to convert it to a fit curve. If you encounter a problem in which the resulting intermediate contour bears no resemblance to the mid boundary, the selected polylines may not run in the same direction. To correct this problem, you need to enter RPL and select one of the contours to reverse its direction. I wrote RPL many years ago so the code is quite ancient, but it still works in AutoCAD 2004 and 2006. It probably works for any version of AutoCAD from R13 onward. When you use RPL, a prompt tells you that the selected polyline was reversed in direction, but you will see absolutely no difference in its appearance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |