Date: Monday, 9 October 1989 18:05-MDT From: Benjamin Olasov To: kpetersen@wsmr-simtel20.army.mil Re: New PD1: Uploads I've uploaded the following files to SIMTEL20: RECT.ARC AutoLISP: Rectangle drawing routines SFILL.ARC AutoLISP: Fill between 2 Arcs, Lines, Plines PDIST.ARC AutoLISP: Finds dist betwn two pts on pline PARNCH.ARC AutoLISP parentheses checker/ pretty printer DTL.ARC AutoLISP: Extracts detail section of drawing ANSIMENU.ARC AutoLISP: ANSI menu system for developers SV-ENV.ARC AutoLISP: Saves AutoLISP environment to file DRAGON.ARC AutoLISP: Generates recursively defined dwgs CHG.ARC AutoLISP: Low level entity access DOOR.ARC AutoLISP: Two pick door program These files replace the file ACADARC.ARC now in the directory. Most of these files are AutoLISP code, for use with AutoCad's imbedded LISP interpreter. Although they're uploaded for the MSDOS section, they should work with Unix AutoCad or MacIntosh AutoCad as well. The one exception is MENU.LSP which uses the DOS specific ANSI.SYS device. I hope they're useful. Feedback is welcome. Regards, Ben olasov@cs.columbia.edu Detailed descriptions of the uploads follow: -------- RECT.ARC AutoLISP: Rectangle drawing routines RECT.LSP RECT draws a rectangle based on digitizing the lower left corner and supplying X and Y dimensions. The widths and rounding radius can either digitized or entered in dimension format from the keyboard. REC draws a rectangle based on digitizing two corners and prompts for the corner rounding radius. The rounding radius can be digitized. The default rounding radius is always 0. By Ben Olasov, Graphic Systems, Inc., Cambridge, MA SFILL.ARC AutoLISP: Fill between 2 Arcs, Lines, Plines SFILL.LSP SFILL will construct an even division of SOLIDs between any 2 Arcs, Lines or Polylines on any elevation plane. This routine was once RULESURF.lsp and much of the code was designed to collect and use 3dpoints for 3dfaces. It works well with the SOLID entity and I think you will find it very useful. Please feel free to modify and improve this code. Note: the entities must "read" in the same direction, else you will get a major bow tie effect. By Jamie Clay, AutoDesk, Sausalito, CA [76703,4204] PDIST.ARC AutoLISP: Finds dist betwn two pts on pline PDIST.LSP is a AutoLISP 2.6-based user defined command that measures the distance between two points along a polyline. This is accomplished by BREAKING out the polyline segment to be measured, using the AutoLISP 2.6 AREA command to report the length of the polyline, and using the UNDO command to repair the break. By Philip M. Kreiker, Looking Glass Microproducts PARNCH.ARC AutoLISP parentheses checker/ pretty printer Program for AutoCAD users who need to "clean-up" a Lisp source file similiar to "Pretty-Type" and do Parentheses checking at the function level. This routine will not only check each function and report on missing open and closed parentheses but it will also create a file, [filename.CNG], that is indented at each parenthesis level. This file allows easy traceback of the parentheses levels of the routine, it can also be the final source file. Usage: Type PARNCH at the DOS command prompt. By George Hartinger, P.O.Box 40812, Grand Junction, Colo. 81504 DTL.ARC AutoLISP: Extracts detail section of drawing DTL.LSP Extracts a section of a drawing for a detail. Lines, Arcs, & Circles are trimmed to the box boundary. P-LINES and equal scale blocks are exploded one level in the detail before trimming. By Robert McNeel & Assoc. 1310 Ward St., Seattle, WA, 98109 ANSIMENU.ARC AutoLISP: ANSI menu system for developers MENU.LSP The function MENU-OPERATION creates menus in text screen mode for AutoLISP. It assumes an 80 column textscreen monitor and ANSI.SYS graphics device MENU-OPERATION looks for and returns an integer. In this version, the header, prompt and individual items in the item-list MUST all be strings. The syntax is: (menu-operation "header" '("item-1" "item-2" ... "item-n") "prompt") By Ben Olasov, Graphic Systems, Inc., Cambridge, MA SV-ENV.ARC AutoLISP: Saves AutoLISP environment to file Environment writing function for *Release 9*. Flaky in Release 10. This function C:SV-ENV saves the current LISP environment into a file with the name of the drawing and with the extension .LSP. For example, if the name of the current drawing whose LISP environment you wish to save is FOOBAR.DWG, then the name of the LISP file to which the environment is saved will be FOOBAR.LSP. For this function to work at all, you must have placed a marker in your ATOMLIST (AutoLISP's record of all LISP variables, functions, etc.). To do this, simply place the following line at the end of your ACAD.LSP file: (setq MARK 'T) Then the SV-ENV function will not attempt to record AutoLISP's primitive functions, or the functions automatically loaded with your ACAD.LSP. To restore your previous environment of variables and user functions, just type (load "dwgname") at the command prompt, where "dwgname" is the name of the drawing whose LISP environment you saved. By Ben Olasov, Graphic Systems, Inc., Cambridge, MA DRAGON.ARC AutoLISP: Generates recursively defined dwgs DRAGON.LSP From _LISP_ by Patrick H. Winston and B. K. P. Horn, published by Addison/ Wesley. Contains command level functions C:DRAGON, C:C-CURVE and C:DEMO. By Ben Olasov, Graphic Systems, Inc., Cambridge, MA CHG.ARC AutoLISP: low level entity access CHG.LSP CHG displays and modifies the properties of individual entities. CHG creates a numbered menu of the selected entities properties, and then prompts the user to select the number of the property to modify. CHG then prompts for a new value for that property, which may be a point (list), real, integer, or string. Any changes made by CHG can be undone using AutoCad's 'U' command. Doing so will return the drawing to its state before using CHG. An example use of CHG: In a drawing containing two valid blocks A and B, an individual iteration of block A can be transformed to an iteration of block B by giving B as its new name. All of its previous insertion parameters will remain the same, but its identity will be changed to block B. If the name of the layer in which the entity resides is changed to the name of an existing layer, the entity will change its residence to that layer. However, if the new layer name is the name of a non-existing layer, a layer with that name will be created, and the entity will be transferred to that layer. By Ben Olasov, Graphic Systems, Inc., Cambridge, MA DOOR.ARC AutoLISP: Two pick door program DOOR.LSP contains the command level function C:DOOR which prompts for the hinge point of the door, then the swing point, and proceeds to break the wall, finish the door opening, and draw a door symbol scaled to the size of the opening. By Ben Olasov, Graphic Systems, Inc., Cambridge, MA -------- EOF