Welcome to Lee Mac Programming Custom Programming Services Want to harness the power of custom programming to save your company countless hours of repetitive work? If there is a specific task that you wish to automate using custom programming, feel free to contact me to hire my services. Want to know what you're missing out on? Read the testimonials of those who have worked with me and my programs.
A Sample of my Work In addition to my custom programming services, I offer a plethora of free LISP programs available for you to download, covering a huge range of applications: Not sure how to run a program? This enhanced version offers a new Multiple option at the polyline selection prompt, allowing the user to apply a taper to all polylines in a selection simultaneously. The new code accounts for earlier versions of AutoCAD in which the effectivename property of a block reference object is not available.
The new code addresses a number of issues involving duplicate points being returned when generating point lists for polylines containing multiple arc segments or polylines which are visually closed but whose Closed property is False. The new version also introduces an additional parameter to control the point density when approximating non-linear objects. This new version fixes a bug in which any text content following the last field expression held by the target annotation object would be lost following the application of the source field formatting.
I have updated my set of Bulge Conversion Functions to include a new 3-Points to Bulge function which will calculate the appropriate bulge value for an arc passing through three supplied points. This revised version refines the calculation of the block definition bounding box to ignore block components residing on frozen layers and account for the possibility of null bounding boxes as a result of all components being excluded from the calculation.
This version also updates the ABB command to incorporate the ability for the user to specify a block name directly at the command-line when inserting a new block. I have also renamed the LM: For extra convenience, all functions in the library may now be downloaded as a single file using the download link at the top of the page.
This new version offers the ability to offset the viewport outline by a predetermined number of paperspace units inside the viewport boundary, and also allows the user to automatically apply a set of predefined properties to the resulting modelspace polyline. I have also included a new animated demonstration of the program on the program page in order to convey the program's capabilities.
In the case of selecting multiple objects, the field expression references the sum of the lengths of all objects in the selection.
The resulting field can then be displayed as a new MText object, or housed within an existing table cell, single-line text, multiline text, multileader, or attribute. The program will now enable or disable the ordering controls depending on whether the ordering operation is valid for the selected items e. The test program now also accounts for a deselection of all items in the list disabling all ordering controls , a situation that would cause the previous version to crash.
Following this modification, I have consequently updated my Copy Field , Field Formatting Code , Match Field Formatting , and Field Arithmetic programs, which all rely heavily on receiving the correct output from this function.
Field Arithmetic allows the user to perform arithmetic operations on selected text or field expressions, with the result of the calculation represented using a field expression.
This update incorporates a couple of user-configurable program parameters which allow the user to easily adjust the tolerance used for dimension comparison, and the properties of the layer assigned to overlapping dimensions. The new version fixes a bug which was causing the program to crash when modifying the background mask properties for dimensions with one or more dimension style overrides already applied.
This update resolves a bug causing the program to produce an incorrect output when processing MText objects whose text content occupied multiple DXF group 3 entries.
The new version now accounts for the use of the 3DORBIT command when invoked transparently from within a command which has been configured to trigger a layer change. Previously, the act of invoking the 3DORBIT command transparently would cause the layer to be reset to the previously active layer, resulting in the new object incorrectly being created on this layer.
The updated code also removes the restriction present in the previous version which prevented layers whose layer name started or ended with the same character as the prefix or suffix from being selected for processing. Finally, the new version provides more verbose output to indicate to the user exactly which layers have been renamed by the program.
I have also included a brand new test program, and a GIF animation to demonstrate how the function may be used. Layout Field defines a set of commands which enable the user to populate a selected annotation object Text, MText, Attribute with a field expression referencing the name and position of the layout in which the object resides. However - and most importantly - the field expressions generated by the program do not reference the CTAB system variable, and will therefore yield the correct result independent of whether or not the layout is current.
The function will therefore gracefully return nil if either of the supplied objects do not support this method. This update alters the program operation to allow the user to select a block to be deleted from the drawing, with the option of selecting a block by name using the dialog displayed by the previous version of the program available upon the user typing N at the selection prompt. The dialog interface has also been enhanced to include an edit box, allowing the user to filter the displayed list of block names.
I have updated my List Box with Filter function to Version 1. This version fixes a bug arising when the user selects multiple items, applies a filter which excludes one or more of the selected items, and then accepts the resulting selection.
This revision fixes a bug causing the program to crash if parentheses or double-quotes were found in the text content. This version fixes the implementation of the block filter parameter when processing attributed dynamic blocks Version 1. The updated code now accounts for polygonal viewports represented by 2D Heavy Polylines this can arise when rotating a rectangular viewport, for example.
Limited Length Polyline allows the user to dynamically construct a straight-segmented polyline whose overall length may optionally be limited to a given value. The program uses my GrText and GrSnap functions to allow the polyline to be accurately constructed with the length displayed in real-time at the cursor. This new version ensures that the selection count for selected objects following grip-editing operations is retained, and corrects the reported selection count for non-rectangular viewports which were previously counted as two objects.
I will also soon update the program description to include instructions on how to create such programs. The new version has been entirely restructured and now provides dedicated functions to allow the user to bypass the main program dialog if desired.
The program also now enables the user to manipulate the background mask for dimensions. In rewriting the application, I have improved the error handling, program performance and code readability, paving the way for possible future enhancements. I determined that the cause of this issue was due to the arithmetic operations that are performed on the 4 bit hash values after processing each bit chunk of input data not being wrapped to a bit unsigned integer as required by the algorithm , and also that such operations could potentially be introducing rounding errors as a consequence of the use of doubles to store the 4 bit items of hash data.
To resolve this issue, I designed a bitwise addition function so that all operations could be performed on a list of bits, with no loss of precision.
I have now fixed the reported bugs and have updated the program to Version 1. I wish to extend a huge thank you to all of my readers who were kind enough to test the program to its limit and report back with their feedback, in turn improving the application for others.
The program has been mostly rewritten in order to incorporate compatibility for all types of Dimensions, and for Multileaders with Attributed Block content. This brief study forms part of my selection of Mathematical Endeavours. This page also demonstrates an alternative method in which to generate the Sierpinski Triangle by recursively applying one of three randomly selected transformations to a given point.
This function will return a pseudo-random number within the range given by the two integer arguments. This method demonstrates how to process a selection set by sequentially removing the entity at the sslength - 1 th index until no entities remain in the set. I have also updated the page to include a table of contents to assist with navigation of the tutorial. This new version will offer the user the option to erase the set of objects in the original selection. This new version no longer restricts the user to selecting a visible attribute to house the resulting Field Expression, but instead allows the user to select any attributed block and will prompt the user to choose the attribute tag to be populated with the Field Expression if the selected block contains more than one attribute.
The updated program also enables the user to predetermine the attribute tag to be populated with the Field Expression using a parameter defined in the program source code.
Finally, this new version also accounts for bit versions of AutoCAD in which the ActiveX getobjectidstring method is not available. I have updated my Align Text program to Version 1.
The new version includes an additional prompt for an optional line spacing factor which offers a default option allowing the user to retain the existing spacing between the selected text objects. I have updated my Length at Midpoint program to Version 1. This update implements a new version of my LM: The new version allows the user to cue an automatic layer change following the use of a custom AutoLISP command, and also adds the Layer Plot Style to the list of layer properties which may be configured by the program.
Following user feedback, I have updated my reactor-driven utility allowing a user to automatically select all MText content on a double-click to enable compatibility with Multileader objects, such that all MLeader text content is selected when double-clicking on an MLeader object. In this new version, the core function which performs the overlap test has been completely rewritten in order to account for dimensions which overlap on both sides, and to also enable compatibility with dimensions created in any UCS or construction plane.
A Simple Block Counter provides a step-by-step explanation of how to use an association list to construct a simple block counter program in AutoLISP, which will prompt the user for a selection of block references and will output the quantities of each block in the selection to the AutoCAD command-line. Finally, I wish all of my readers a very Merry Christmas! This program will automatically detect overlapping linear dimensions in all layouts and all blocks in the active drawing, moving such dimensions to a separate layer to be reviewed by the draftsman.
The new version allows the user to select which attribute tags are displayed in the table, and offers the ability to use field expressions to automatically update the table totals. Constant attributes with numerical content are also now included, and the table columns are sized appropriately for the content. I have also added a new GIF demonstration to show the program in action. This relatively minor update improves the method used to determine the appropriate width for an MText object in order to account for multiple lines of text; removes the case-sensitivity of attribute tag comparison to account for applications which do not enforce uppercase attribute tags; and fixes a bug causing an oblique angle to be applied to single-line text if the current text style has an oblique angle set, but the text style selected for use does not.
A new Force Layer Properties parameter determines whether the program will automatically modify the properties of existing layers in a drawing to match the properties defined in the program. A new System Variables parameter incorporates the ability to configure any number of system variables when a command is invoked, with the system variables reset to their original values upon completing or cancelling the active command.
The Layer Description has also been added to the list of layer properties which may be configured by the program. Chain Length will allow the user to calculate the total object length between two points along a chain of connected objects. Be sure to also check out my related Chain Selection program, which allows the user to automatically select all connected objects following selection of a single object in the chain.
There remain some restrictions when attempting to burst nested blocks which are nested within non-uniformly scaled parent blocks, however these restrictions are inherent in the way that AutoCAD handles such objects. The new version enables full compatibility with multileaders containing attributed block content, and the user may configure the program to renumber attributed blocks, attributed mleaders, or both.
The new version also rectifies a number of bugs present in the previous version, and restructures the program code to improve readability. There is also a new GIF animation for your viewing pleasure. This simple program enables the user to create objects with the appearance of multilines, however which are composed of standard polylines. The idea was spawned from a question received from a visitor to my site who was looking for a consistent result when double-clicking on MText and single-line text DText.
Similar to my existing Change Block Base Point program, this new program allows the user to change the base point location for multiple blocks to one of nine standard justifications.
The new version enhances the 'Replacement Mode' option, which now allows the user to replace the text content of primary or nested text, mtext, dimensions, or multileaders containing mtext or attributed block content.
As demonstrated, the program will perform successfully with both 2D and 3D objects, constructed in any UCS plane.
The program now permits the use of an optional 'Block Name' column in the CSV file from which attribute values are sourced, thus enabling the user to update multiple attribute tags held by blocks of a given block name, residing in a specific layouts within multiple drawings - automatically. I have now added support for duplicate attribute tags: Attributed anonymous block references are now included by default when a custom block filter is used, to enable full compatibility with dynamic blocks.
I have updated my Polyline Information program to Version 1. The program will now set the initial focus of the dialog to the Prefix edit box tile, and the user may dismiss the program dialog at any time using the ENTER key.
This program enables the user to easily view the object or set of objects referenced by all field expressions held by a selected Text, MText or Attribute object.
The new version fixes a number of bugs reported from the previous version.