Welcome to Lee Mac Programming

Expert Elite

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.

Increase your AutoCAD Productivity

Make AutoCAD work for you by using custom programming to automate many repetitive tasks.

This site is primarily aimed towards utilising the AutoLISP & Visual LISP APIs to create custom programs which may be run within full versions of AutoCAD (not LT versions) and many of its derivative 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: from text manipulation to attribute extraction and everything inbetween.

The Tutorials page also offers an insight into how you can learn to create your own AutoLISP programs and quickly increase your AutoCAD efficiency and productivity.

Whether you are a complete beginner or perhaps more experienced, I have no doubt that you can benefit from the help & resources available here.

What is AutoLISP?

AutoLISP is a dialect of the LISP programming language engineered to enable manipulation & customisation of AutoCAD and many of its derivative programs such as Civil 3D, MEP, Architecture, Electrical etc. AutoLISP is restricted to running on full versions of AutoCAD and cannot be run in any version of AutoCAD LT. Other applications such as Bricscad and IntelliCAD also offer the ability to run AutoLISP programs.

Visual LISP is an extension of AutoLISP introduced as an add-on to AutoCAD R14, and subsequently fully incorporated into the release of AutoCAD 2000. Visual LISP provides access to the ActiveX/COM and offers many advanced functions to aid with customisation.

New to AutoLISP?

Not sure how to run a program? Be sure to see my tutorial on Running an AutoLISP Program.

Site News  

27th July 2014

I have added a new function: Evaluate Once on Startup to the Subfunction Library section of the site. This function provides the facility for a supplied expression to be evaluated only once on the next drawing startup, and not subsequently.

17th July 2014

I have updated my Areas to Field program to Version 1.3. This new version of the program will populate the contents of an AutoCAD table cell with the appropriate field expression if the point specified by the user is found to reside within a table cell.

21st June 2014

I have updated my Copy to XRef program to Version 1.2 to account for cases in which the XLOADCTL system variable is equal to 1, and also provide more detailed feedback to the user should the program fail to interface with the source drawing of the selected xref.

My Dynamic Attribute Width program has been updated to Version 1.1. The 'Reset' option in the new version will now reset the width factor of the selected attribute to that of its associated attribute definition, rather than always resetting the factor to 1.0.

19th June 2014

I have updated my HSL to RGB function as part of my set of Colour Conversion Functions to make the code more concise & readable.

15th June 2014

Count Version 1.4 released.

I have entirely rewritten my oldest & most popular block counting application: Count Version 1.4 should now be fully compatible with all full versions of AutoCAD (including 2015) running on both 32-bit & 64-bit Windows operating systems. The new version also offers an enhanced settings dialog, allowing the user to configure several additional parameters which were not available in the previous version.

I have also updated my Layer Director program to Version 1.2. The new version will allow the user to specify basic layer properties to be applied to layers which are automatically created by the program. I have also changed the loading method to use the post-initialisation s::startup function and have restructured the code used to construct the Visual LISP Command Reactor to hopefully resolve some reported issues in which the application was not automatically enabled for some drawing files.

14th June 2014

I have updated my Polyline Information program to Version 1.2 to fix a bug causing the final polyline segment to be omitted from output data when processing closed polylines.

8th June 2014

I have added a new program to the site: Dynamic Attribute Width will allow the user to dynamically alter the width factor of a selected attribute, with a real-time preview as the cursor is moved relative to the attribute.

I have updated my Incremental Array program to Version 1.7. This version fixes accumulated rounding errors appearing at item 44 onwards when incrementing a value of 1 by an increment of 1.

13th April 2014

My Reset XRef Layers program has been rewritten and the code updated to Version 1.2. The new version now also accounts for layers whose colour property has been assigned a True Colour or Colour Book colour.

I have updated my Incremental Numbering Suite program to Version 3.5 to fix a reported intermittent bug causing the program to crash when generating the first object after dimissing the program dialog with Dynamic Mode enabled.

Following the recent release of my heavily updated Incremental Array program, I have revised this program to Version 1.6 to correct a few minor bugs reported by Swamp user CAB.

I have completely rewritten my old Incremental Array program, and have updated the code to Version 1.5. This new version incorporates a more advanced incrementing engine similar to that used by my Incremental Numbering Suite application, and also allows the user to specify an increment value.

16th March 2014

My most popular and most extensively developed program, Incremental Numbering Suite has now been updated to Version 3.4. This new version fixes a number of bugs present in the previous version following bug reports submitted by numerous users which have accumulated since the release of Version 3.3 almost two years ago. For information detailing the changes to the program in this new version, please see the version history section of the program code header.

2nd March 2014

I am honoured to announce that I have been nominated to become a member of the prestigious Autodesk Expert Elite program!

27th February 2014

I have updated my Error Message Troubleshooter page to include several additional error messages and their accompanying explanations and possible causes.

23rd February 2014

I have updated my Burst Upgraded program to Version 1.2. The new version of the program has been restructured to accept a selection set argument, allowing the program to be called from other custom programs; the program will also now explode non-attributed blocks, rather than restricting the selection to only those with attributes.

I have added a new developer utility function to the site: Print List is a relatively simple (but incredibly useful) function to assist with the understanding of the structure of a given list. The function will print a supplied list to the command-line or file, with nested lists displayed in a hierarchical format so that the list structure is revealed.

16th February 2014

New program: Modelspace to Paperspace added to the site. Similar to the standard CHSPACE command, this program allows the user to copy a selection of objects from Modelspace to the current Paperspace layout, through an active viewport.

6th February 2014

I have updated my tutorial: An Introduction to Script Writing to include more detailed explanations & examples. This tutorial is a basic explanation of how to write & run your very first AutoCAD Script.

2nd February 2014

My Nested Block Counter has been updated to Version 1.5. The new version fixes a couple of bugs arising when counting nested dynamic blocks with different visibility states, and when counting multiple block references occurring several nesting levels deep.

My sincere thanks go to Helmut Schröder, who kindly brought these issues to my attention and also suggested possible fixes for the code.

I have completely rewritten my novelty Tip of the Day program; the new Version 1.1 ensures that the same tip is never displayed twice in a row, and provides the user with more control over the appearance of the tip dialog.

27th January 2014

Firstly, I would like to apologise to my readers for the distinct lack of updates to my site over the past month - my workload has increased substantially this year and my free time is unfortunately currently in short supply. To those who have contacted me directly, please know that I have received your messages, but finding the time to adequately respond to everyone in a timely manner is becoming increasingly difficult - for this I apologise.

Now to get back on topic, I am pleased to announce that my Change Block Base Point program has been published to the Autodesk Exchange App Store. I invite you to rate & review the app at your earliest convenience!

As with my other published applications, the published version of the program has a professional application installer and comes complete with a custom ribbon panel and individual toolbar icons for each command which may be used to launch the application.

The original program has also been updated to Version 1.5 to implement to some minor changes to the code in keeping with the published app.

31st December 2013

I have updated my library of Mathematical Functions to include a new set of Arithmetic Functions; such functions include calculation of the Least Common Multiple of two or more numbers, obtaining a list of Prime Factors of a number, and testing whether or not a given number is prime.

8th December 2013

I have updated the code for my old Elevation Marker program. This very simple program enables the user to create multiple elevation markers composed of a variable-width polyline and a text object displaying the UCS Y-coordinate of the picked point.

1st December 2013

New tutorial: The Apostrophe and the Quote Function. This tutorial provides a detailed explanation describing the behaviour & purpose of the apostrophe and equivalent quote function in AutoLISP.

28th November 2013

I have updated my set of Matrix & Vector Functions to update the matrix determinant function by ElpanovEvgeniy which calculates the determinant by transforming the matrix into upper triangular form; and also include my version of a matrix determinant function implementing Laplace's formula.

As a result of the modified matrix determinant function, I have also updated my 5-Point Ellipse function & Advanced Polyline Outline program to reflect the changes.

27th November 2013

I have updated the code for my Load Linetypes function to exclude known metric & imperial linetype definition files based on the value of the MEASUREMENT system variable, and also incorporate a boolean parameter to determine whether linetypes should be redefined from file if already loaded. I would like to thank Jason Bourhill from CAD Concepts for suggesting these improvements for the function.

Following a bug reported by a user, I have updated my Dynamic Block Counter program to Version 1.1. This new version fixes a bug causing the previous version of the program to error when processing non-uniformly scaled dynamic blocks, and also offers the user the ability to process a selection of blocks (rather than processing all blocks) and output the results to a Text or CSV file.

I have updated the code for my Selection Set Bounding Box function. This function returns the lower-left & upper-right coordinates of a rectangular frame bounding all objects in a supplied selection set.

17th November 2013

I have updated the code and function description for my Browse for Folder function; the code is now more concise and includes a smaller code header for a reduced footprint, and the function description page now includes an example function call with accompanying image, and a reformatted list of bit code values.

15th November 2013

Align Text to Curve Version 1.2 released.

The new version of the program has also been published to the Autodesk Exchange App Store!

The published version has a professional application installer and comes complete with a custom ribbon panel from which to launch the application. Feel free to rate & review the app!

After evaluating the wealth of feedback & suggestions submitted by numerous users of this program, I have invested some time rewriting & restructuring the entire program to implement many of the suggestions and also incorporate several new ideas of my own. This new release also improves the general performance of the program, providing a more stable and reliable program.

A number of the more significant changes and new features are detailed below:

  • New or existing Text and MText may now be aligned to Lines, Polylines, Arcs, Circles, Ellipses, Elliptical Arcs & Splines nested (to any depth) within blocks or xrefs.
  • The program now offers a new 'Settings' menu wherein the user can control the object type for new text created by the program, the justification of new text, the default offset factor & rotation, and many more settings.
  • A new 'Multiple Text Mode' allows the user to continuously place multiple text objects aligned to the same curve.
  • Text readability & rotation may now be altered during text alignment.
  • Several other program enhancements have also been implemented, but are too numerous to list here.

14th November 2013

New Show Hatch Text program added to the site. This program enables the user to clear the area of a hatch pattern obscuring selected Text and MText objects, or Text, MText and Attributes contained within selected primary & nested block references.

12th November 2013

I have added a new Length at Midpoint program to the site. This program automatically generates MText objects positioned over the midpoint of every object in a selection, with each item of MText containing a field expression referencing the length of the object.

New Field Formatting Code program added to the site. This utility enables the user to determine the field formatting code associated with the field expression held by a selected object, and may be used in conjunction with my Length at Midpoint, Areas to Field, and Area Field to Attribute programs in order to determine the correct field formatting code to use with each of the programs.

I have updated the descriptions for my Areas to Field, and Area Field to Attribute programs to update the set of instructions indicating how to determine the correct field formatting code to use with each program.

6th November 2013

I am delighted to publish a very appreciative and complimentary testimonial received from the tremendous folk at Momentum Engineering - thank you!

29th October 2013

New Offset Polyline Section program added to the site. This program enables the user to offset a section of a polyline enclosed by two selected points on the polyline.

I have updated my set of Colour Conversion Functions to improve the concision of the code for many of the functions.

25th October 2013

Added MD5 Cryptographic Hash Function to the Subfunction Library section of the site. This function is an AutoLISP implementation of the MD5 message-digest algorithm developed in 1992 by Ronald Rivest.

24th October 2013

My Error Message Troubleshooter has been updated to add the bad argument type: streamp error message, and to also include possible AutoLISP functions pertaining to the cause of each error.

23rd October 2013

I have recently updated my Minimum Bounding Box function to overhaul the old function code, include additional error trapping, and furthermore update the code formatting to meet my current standard.

18th October 2013

I am pleased to list DuctiSoft as a friend of Lee Mac Programming. Andrea Andreetti, the proprietor of DuctiSoft, is a very creative programmer whom I have had the pleasure of collaborating with in the past to create a novelty Dynamic Laser program (requires Swamp membership to view).

10th October 2013

My Extract Nested Block program has now been published to the Autodesk Exchange App Store! The published version has a professional application installer and comes complete with a custom ribbon panel from which to launch the application. Feel free to rate & review the app!

9th October 2013

I have now updated my Circular Wipeout program to Version 1.2. This version fixes a UCS bug arising when the UCS origin is not equal to the WCS origin.

2nd October 2013

I am pleased to list Paul Stafford's blog: CADsmarter as an affiliate site of Lee Mac Programming. Paul's blog is relatively new, but already contains many useful tips & tricks to help you get the most out of AutoCAD.

1st October 2013

Following a bug reported by a user, I have updated my Automatic Block Break program to Version 1.6. The updated version fixes a bug causing the program to return an error if an object intersected the bounding box of the block at only one point.

12th September 2013

I have recently updated my set of Attribute Functions to fix a few minor bugs, improve the concision of the code, and update the formatting to be consistent with my other function sets.

11th September 2013

My Steal & Associative Textbox programs have now been published and are available to download from the Autodesk Exchange App Store! These published versions come complete with professional application installers and custom ribbon panels from which to launch the applications.

You are invited to rate & review the apps!

9th September 2013

I have updated my Extract Nested Block program to Version 1.1. The updated version incorporates additional error trapping to prohibit selection of blocks nested within dynamic blocks or xrefs (with which the program is incompatible), and nested blocks residing on locked layers. The program will also now ignore non-uniformly-scaled block references (for which the previous version returned an error).

6th September 2013

My Background Mask program has now been published and is available to download from the Autodesk Exchange App Store. The published version includes an application installer and a custom ribbon panel from which to launch the application. Feel free to rate and review the app!

I am pleased to announce that gileCAD is now an affiliate of Lee Mac Programming. Gilles Chanteau, the proprietor of gileCAD, is an incredibly talented programmer who I have had the pleasure of knowing for several years, and from whom I have learnt a great deal.

3rd September 2013

My Batch Attribute Editor program is now also available to download from the Autodesk Exchange App Store! The version published at the Exchange App Store comes complete with an installer and also features a custom ribbon panel from which to launch the program.

Feel free to rate & review the app and let me know what you think!

1st September 2013

A new novelty program gift to my readers for the first post of September: Password Generator was inspired by a recent 'challenge thread' posted at TheSwamp CAD forum, and will generate a pseudo-random password string based on the parameters specified.

31st August 2013

I have updated my Nested Move program to Version 1.2. The new version implements a fix for a bug causing the program to crash when a nested attributed block or nested 2D/3D Polyline is selected.

29th August 2013

My Burst Upgraded program has now been rewritten and updated to Version 1.1. The new version has cleaner & more concise code, with additional error trapping to account for xrefs and objects on locked layers. I have also included an animated demonstration to exhibit the program capabilities.

26th August 2013

Following valuable feedback received from several users, my Nested Move program has now been updated to Version 1.1. The new version allows the user to select multiple nested objects (with the same parent) to be moved, with selection highlighting to provide visual feedback for the selected objects. The new version will also move only the 'outermost' nested object when the user has selected an object nested several levels deep - this also resolves an issue in which the user could move nested dimension components. The accompanying animated demonstration has also been updated to reflect the new functionality.

25th August 2013

List Box function rewritten and updated to Version 1.2. This updated version alters the third argument for the function to a bit-coded integer controlling whether the list box permits selection of multiple items, and also whether the function will either return a list of selected items or a list of zero-based indexes corresponding to the position of each item within the supplied data set - a necessary enhancement when working with data containing duplicate items.

I have uploaded a sample zip folder containing an example CSV file & accompanying sample drawing containing an attributed block for use with my Update Titleblock Attributes program.

21st August 2013

Added new LM:sfsp+n (Add Support File Search Paths at n) function to my set of Support File Search Path Functions. This function will add a list of paths at a position in the list of AutoCAD Support File Search Paths given by a supplied zero-based index parameter.

20th August 2013

My old Centerline program has recently been rewritten & updated to Version 1.2. The new version has cleaner code and performs successfully on a wider range of CAD platforms following a recently received bug report submitted by an avid user.

19th August 2013

I have recently updated my entire set of Dynamic Block Functions. The code for each function is now clearer & more concise, and the functions have a reduced footprint, carrying smaller code headers. A new LM:ToggleFlipState function has also been added to allow a developer to effortlessly toggle the Flip State Parameter held by a Dynamic Block reference.

14th August 2013

I am pleased to list PHCAD as an affiliate of Lee Mac Programming. Paul is a talented & certified professional draughtsman and, in addition to advertising his services, his site offers free resources in the form of LISP tips & an expanding block library.

10th August 2013

Inspired by a request posted at the Autodesk Discussion Groups, I have added a new Nested Move program to the site. This program enables the user to move a selected object nested within a block, dynamic block or xref (nested to any depth), without opening the xref source drawing.

7th August 2013

I am pleased to list Matthew Nichols' blog Talk about CAD as an affiliate of Lee Mac Programming. Matthew's blog is packed with useful information and includes several macros & DIESEL examples for LT users who unfortunately cannot take advantage of AutoLISP.

2nd August 2013

New ssget Function Reference added to the Programming References section of the site. This reference includes information gathered over the years from various sources, including information on undocumented ssget functionality and several examples to demonstrate function usage.

27th July 2013

I have extensively updated my tutorial on Debugging Code with the Visual LISP IDE to include better explanations for actions performed in the tutorial, and clearer & cleaner graphics & animation.

25th July 2013

Following a bug reported by a user, I have updated my Get Files Dialog function to Version 1.3; this update fixes a bug wherein the function would crash if the user double-clicked in empty space in the left-hand list box pane.

23th July 2013

I have now rewritten my Create Directory function to improve the concision & readability of the code. This function will recursively create each level of a supplied directory folder structure.

14th July 2013

Following the recent addition of my Match Field Formatting program, I have now also added a new Copy Field program to the site. This program enables the user to copy a field expression from a selected source object to multiple destination objects in a drawing.

My Copy to XRef program has now been completely rewritten and updated to Version 1.1; the new version incorporates substantially improved error trapping and improves code readability in general. An animated demonstration of the program in action has also been included on the program page.

12th July 2013

I have added a brand new Match Field Formatting program to the site. This program enables the user to copy the formatting from a selected source field expression to multiple destination fields in a drawing.

Following the above addition, I have also included my Field Code function in the Subfunction Library section of the site. This function is heavily utilised by my recently added Match Field Formatting program, and will return the field expression associated with a Text, MText, Attribute, MLeader, or Dimension object.

8th July 2013

My Copy to Layouts program has now been completely rewritten and updated to Version 1.1. The program enables a user to copy a selection of objects to all or selected layout tabs in a drawing; this updated version is more robust with cleaner code for improved readability.

5th July 2013

I have now updated my Copy or Rename Block Reference program to Version 1.5; this new version enables the user to copy or rename anonymous block references in a drawing.

16th June 2013

My Copy or Rename Block Reference program has now been completely rewritten and updated to Version 1.4. The code for the updated program has improved clarity, concision and readability, with additional error trapping to allow for block references residing on locked layers.

Following the recent update of my Copy or Rename Block Reference program as noted above, my Copy Block Definition function has also been rewritten and similarly improved.

I have rewritten my old Copy Block from Drawing program and have renamed the program to a more apt: Import Block. This program is the precursor of my far more generalised and extensively developed Steal from Drawing program and allows a user to import a block from a selected drawing file into the active drawing, without opening the external file.

15th June 2013

My novelty Clock application has now been completely rewritten and updated to Version 1.1. In addition to incorporating cleaner and far more efficient & readable code, the new version also includes a new runclock command, enabling the user to run the clock continuously. I have also rewritten the description found on the program page and have added a new animation to demonstrate the program in action.

I have updated my LM:RGB->ACI & LM:ACI->RGB functions as part of my set of Colour Conversion Functions, following a reported bug.

7th June 2013

I have updated my set of Column Reference Functions; these functions are ideal for converting and manipulating alphabetical 'column references' (e.g. A,B,...,Z,AA,...) as used by applications such as Excel. I have also provided alternative versions for many of the functions in order to demonstrate different ways to obtain the same result. A table of contents has been included on the page for ease of navigation.

6th June 2013

I have updated my set of Colour Conversion Functions to provide functions for conversion between all 5 colour enumerations listed on the page; a table of contents has also been included for ease of navigation.

2nd June 2013

New Object Break program added to the General Programs section of the site. This program is a generalisation and enhancement of my existing (and recently updated) Circle Break program, enabling the user to break a selected object either at two specified points, or at two points of intersection with another selected object, and apply a set of properties to the selected portion of the object.

30th May 2013

My Circle Break program has now been entirely rewritten and updated to Version 1.3. The much improved new version enables the user to use the program with ellipses in addition to circles, and apply a whole set of properties to the 'hidden' arc or elliptical arc, as opposed to simply assigning a layer as performed by the previous version. The accompanying program description has also been rewritten and a new animated demonstration has been included.

28th May 2013

My Change Block Insertion program has been completely rewritten and updated to Version 1.4; I have furthermore renamed the program to a more appropriate: Change Block Base Point. Please note that the commands for this program have also been renamed accordingly. I have also rewritten the accompanying program description, providing an explanation for each available command, and including a new animated demonstration.

26th May 2013

I have completely rewritten my set of functions which enable a user to Add & Remove Support File Search Paths and have also updated the accompanying function description found on that page.

My Area Field to Attribute & Areas to Field programs have also been completely rewritten and updated to Version 1.1 & Version 1.2 respectively, to improve the readability of the code and to enable the user to easily configure the area format of the Field generated by the programs. The accompanying program descriptions have also been heavily updated to provide instructons detailing how to determine the correct Field formatting code when configuring the area format.

I have updated my Arrow Arc program to Version 1.1; the new version incorporates an aarcsettings command to enable the user to control the length & width of the arrow heads without modifying the program source code.

I have updated and reformatted my set of Attribute Functions and Base Conversion Functions; the functions are now clearer and carry smaller code headers.

My very old Box Text program has been completely rewritten to vastly improve the readability of the code and to fix a few general bugs.

22nd May 2013

Following a bug report, I have updated my Read CSV function to Version 1.3 to correctly process some uncommon cell values containing a certain combination of comma & quote characters. I have also updated my complementary Write CSV function and have condensed the code for both functions, resulting in improved readability & performance.

I have furthermore revised my Update Titleblock Attributes program to Version 1.6 in order to incorporate the above changes to my Read CSV file parsing function and to remove the need to include the file extension when listing drawings in the CSV file read by the program.

17th May 2013

I have now updated my old Copy to Drawing program to Version 1.2 and have renamed the program: Copy to Drawings. As the new name suggests, I have now lifted the single drawing restriction, with the updated version allowing the user to copy a selection of objects to an entire set of drawings, without opening each drawing in the AutoCAD Editor.

4th May 2013

I have now included a new tutorial on the topic of Selection Set Processing to the AutoLISP & Visual LISP Tutorials section of the site. This tutorial demonstrates a variety of different methods of how to iterate over all objects in a selection set, together with a brief explanation of how each method works and the efficiency of its operation.

1st May 2013

Updated my recently released Associative Textbox program to Version 1.2 to fix a bug causing MText & LWPolyline objects residing in Paperspace Layouts to be transferred to Modelspace.

30th April 2013

Updated Associative Textbox program to Version 1.1 to fix a bug causing the program to crash during loading if other reactors with reactor data with non-string data type are already running in the active drawing session.

Added Associative Textbox program to the site. This reactor-based program enables the user to create an associative textbox surrounding a Text or MText object, with the size, position, orientation & rotation of the textbox frame automatically updated following modification to the associated Text or MText object.

Added Filtered List Box function to the Subfunction Library section of the site. Similar to my existing List Box function, this function also presents the user with a dialog interface containing a list box tile from which the user may select one or more items, however, the displayed dialog for this function also includes an edit box tile, enabling the user to filter the list of items displayed.

23rd April 2013

I have updated my Align Text program to Version 1.3; this version allows the user to reposition a selection of single-line text objects with any rotation, aligned in a direction perpendicular to the text rotation. The updated program will furthermore perform successfully with text constructed in any UCS plane.

18th April 2013

I have updated my Total Length & Area Programs to simplify the code and improve the readability & consistency of the programs.

My Get Files function has been completely rewritten and updated to Version 1.2. The updated version implements a bug fix to account for Library folders encountered with Windows 7, and also incorporates a new and improved file sorting function.

ObjectDBX Wrapper function completely rewritten and updated to Version 1.2 to include more error trapping and to condense the code, improving both readability & performance. Directory Dialog function also updated and renamed to BrowseForFolder for consistency with the method used by the function.

28th March 2013

I have updated my GrText function to Version 1.1. The function has been completely rewritten with the previous 'Extended ASCII' version now included in the main function for consistency. The redundant colour argument has also now been removed to improve compatibility when the function is used with DCL. The program page has also been overhauled to provide a far better description of the various demonstration programs, which have also been rewritten and updated.

8th March 2013

Added Text to Words program to the site. This program enables the user to convert a selection of single-line text objects into separate text objects for every word in the selection, whilst retaining all properties of the original objects.

Added Arrow Arc program to my library of General Programs. This program enables the user to construct an arc with arrowheads at each end point, aligned with the arc.

Added Drawing Version function to the Subfunction Library section of the site. This function will return a string describing the drawing version of a supplied drawing file, if possible.

5th March 2013

I have added the functions Matrix Inverse (gile / Lee Mac) & Identity Matrix to the Matrix & Vector Functions section of my Mathematical Functions page. The Matrix Inverse function uses the technique of Gauss-Jordan elimination to calculate the inverse of a given nxn non-singular matrix. The original version of this function was written by the talented gile (Gilles Chanteau), which I have modified for increased performance & concision. The included Identity Matrix function will return an nxn Identity Matrix with dimension given by the supplied integer parameter.

Updated my Dump Object utility function to Version 1.1 to improve the function structure & readability.

4th March 2013

My Automatic Block Break program has been mostly rewritten and updated to Version 1.5 to incorporate a new & improved function to calculate the rectangular bounding box of a block, resulting in accurate results when applied to Dynamic Block references; and furthermore to fix a bug wherein the program would attempt to break Multiline objects. Other minor changes have also been implemented to improve and streamline the program.

I have also updated the Automatic Block Break program page, rewriting the description to describe each available command in greater detail and to include several new animations to better demonstrate the program capabilities.

Updated my Mapcar & Lambda tutorial to reformat the examples and fix a reported broken link.

10th February 2013

Following recent development of my 5-Point Ellipse function, I have added a new Advanced Polyline Outline program to the General Programs section of the site. The program allows the user to construct an outline silhouette of an LWPolyline with straight and/or arc segments with varying or constant width.

Added 5-Point Ellipse function to the Subfunction Library section of the site. This function will return the parameters of the unique ellipse passing through five supplied points, if such an ellipse exists. The method used to determine these parameters is described on the function page linked above.

Added Matrix Determinant (by ElpanovEvgeniy) & Matrix Trace functions to the Matrix & Vector Functions section of my Mathematical Functions page; as the names indicate, these functions will respectively calculate the determinant and trace of a given nxn matrix.

6th February 2013

Updated Background Mask program to Version 1.1 to alter the command syntax for the program to bmask, since mask is an existing command in AutoCAD Civil 3D. The update also implements several other minor improvements to the code.

2nd February 2013

Added Ellipse to Arc program to the site. This program will allow the user to convert a selection of circular Ellipses & Elliptical Arcs (that is, Ellipses or Elliptical Arcs with axes of equal length) into Circles & Arcs respectively, whilst retaining all properties of the original objects.

I have also updated my Circular Wipeout program to Version 1.1. This updated version includes an additional command, c2wipe, which enables the user to convert a selection of circles to circular wipeouts.

1st February 2013

I have updated the Testimonials section of the site to include an appreciative & commendatory testimonial kindly written by Henry Blake, owner of WoodBlocX - Many thanks Henry!

29th January 2013

Added Circular Wipeout program to the site. As the name implies, this program enables the user to create a circular wipeout with a given center & radius in the drawing.

28th January 2013

I have updated my set of Unique & Duplicate List Functions to rewrite & improve many of the existing functions and moreover to include iterative versions of every function listed. I have also added a table of contents to facilitate navigation of the page.

It's a bit late in the month, but I wish all of my readers best wishes for 2013!

24th December 2012  

To keep with the festive theme of this time of year, I have published an article exploring the curious & intriguing geometrical properties of the Koch Snowflake. This program may be found under the Mathematical Endeavours section of the site.

I have also updated my study of various chaotic Attractors to include a table of contents, clearer systems of equations for each attractor, greatly improved & more readable code, and finally, a derivation for the Duffing Oscillator.

Finally, I wish all of my readers a very Merry Christmas!

18th December 2012

Added Chain Selection program to the site. This program prompts the user to select an object and generates a 'chain selection' of all objects sharing endpoints with objects in the accumulative selection.

Included Add Polyline Vertex program in the General Programs section of the site. As the name implies, this program allows the user to add a new vertex to an LWPolyline object.

14th December 2012

Updated Align Objects to Curve program to Version 1.3 to enable the user to align the selection of objects to a nested curve within a Standard or Dynamic Block or XRef, nested to any level.

11th December 2012

My Align Objects to Curve program has now been completely rewritten and updated to Version 1.2 to enable the program to perform successfully in all UCS & Views. The alignment controls offered by the program have also been refined, with the additional option to allow the user to rotate the set of objects relative to the selected curve.

I have also updated the Testimonials section of the site to include a very complimentary testimonial kindly written by Joey Smith from Arning Companies, Inc. - Many thanks Joey!

6th November 2012

Added functions LM:Reflect & LM:InsideTriangle-p to my set of Mathematical Functions. The former will reflect a given point in the axis defined by two supplied points in the plane; the latter is a predicate function which will return T if a given point lies within a triangle defined by three supplied points. In addition to the inclusion of these supplementary functions, I have also organised the library of Geometric Functions into appropriate sub-categories for ease of navigation.

31st October 2012  

As a treat for Halloween, I have added a new novelty program to the site. Lottery Numbers is a relatively simple novelty program generating a sequence of random numbers in the form of lottery balls in the drawing. Good luck!

21st October 2012

I have updated my library of Intersection Functions; this set of functions provides the ability to retrieve points of intersection between either two objects, all objects within a Selection Set or list, or between objects of two Selection Sets or lists. The functions have been completely rewritten to improve readability, concision & performance, and the entire function page has been overhauled to provide detailed information about every function, including animated demonstrations and diagrams.

16th October 2012

I have updated my Mathematical Functions page to incorporate a set of Complex Number Functions, pertaining to the arithmetic manipulation of complex numbers; and Factorial Functions, which may be used to calculate the factorial of a positive integer, in addition to the multiplication and division of two factorials. I have also renamed several of the Matrix & Vector Functions present on the page to improve consistency. Various Geometric Functions have also been updated to reflect the renamed function names and earlier modifications to the Polygon Centroid function.

Updated Polygon Centroid function to account for the case in which the coordinate scale factor is zero, and hence eliminating a potential divide-by-zero error.

I have updated the Testimonials section of the site to include a testimonial kindly received from John Hailey at CBI/Matrix Engineering - thanks John!

12th October 2012

Added set of Random Number Functions to the site. These functions involve the generation and manipulation of pseudo-random numbers using a linear congruential generator.

Updated Popup function to Version 1.1 to revise the code formatting and improve the readability of the function.

8th October 2012

I am pleased to list Paul Munford's blog The CAD Setter Out as an affiliate site of Lee Mac Programming. Paul's blog is packed with useful information on AutoCAD and Inventor, including a cornucopia of tips, tricks and tutorials exuding Paul's evident enthusiasm for everything CAD related. I also encourage followers of my site to vote for my link as your favourite CAD site on his links page here.

5th October 2012

Added Isometric Polygon program to the site. This program enables the user to construct a regular polygon projected in the active isometric plane.

19th September 2012

I have updated my Update Titleblock Attributes program to Version 1.5. The new version of the code revises the CSV file parser function to account for the use of alternative cell delimiter characters (such as a semi-colon) used by some systems.

18th September 2012

Updated Steal program to Version 1.8. This revision fixes a minor bug present in the recently released Version 1.7 wherein the program would error if all items in a selected collection were deselected by the user using the Ctrl key, and then the Import button is pressed. Furthermore, in this updated version, the active drawing will only be regenerated (following program completion) if one or more items have been imported by the program.

16th September 2012

Steal Version 1.7 released.

After evaluating the excellent feedback submitted by numerous users for this program, and having reviewed the many suggestions for improvement that were submitted since the program was first released to the public, I have invested some time implementing many of the proposed ideas and have injected a few additional features of my own into this new release of my Steal from Drawing program.

This release also improves the general performance of the program, with much of the original source code rewritten and restructured, furthermore, some previously undetected bugs have now been ironed out to provide a more stable and reliable program.

A number of the more significant changes and new features are detailed below:

  • The Steal file selection dialog will now remember the directory of the last selected drawing between drawing sessions so that the user will spend less time navigating a project folder structure when selecting a drawing to steal from.
  • Groups, Drawing Properties and Custom Properties have all been added to the list of collections from which the user can steal items. The inclusion of Drawing Properties was a popular request for the last program, so this new addition should hopefully benefit a large proportion of users.
  • A Refresh button has now been incorporated into the dialog to enable the user to refresh the drawing data after importing items with object dependencies (for example, importing blocks or groups will also import dependent layers, linetypes, nested blocks etc.).
  • The Search button has been exchanged for an appropriate bitmap icon and I have replaced the multiple alert dialogs with a rather more subtle dialog error tile for a more streamlined user experience.
  • Two new commands have been added to the program: StealLast allows the user to immediately steal from the last selected drawing (if available); and StealTemplates enables the user to steal items from a specific template file, selected from a list of template files found in the template drawing path.
  • Several other general improvements and bug fixes have also been implemented and are detailed in the program code header.

9th August 2012

Added Polyline Information program to the General Programs section of the site. This program provides the user with detailed information about every segment of a selected LWPolyline in the form of an AutoCAD Table (if available), Text file, or CSV file.

2nd August 2012

Updated my Batch Attribute Editor program to Version 1.4. This version implements a refined file and folder sorting function to emulate the Windows Explorer filename sort when selecting drawings to be processed by the program. The updated program also increases the character limits of the edit_box tiles in the dialog to allow for the use of long Field Expressions in attribute values. Other general bug fixes are noted in the program code header.

27th July 2012

Added HTML versions of many of the programs available for download on the site, allowing the user to view the program source code directly in the web browser, with the choice of three syntax-highlighting themes. Take a look at the various programs under the General Programs section of the site, and click on the 'View HTML Version' link try this new feature of the site.

21st July 2012

Added Delete Blocks program to the site. This program enables the user to quickly remove all traces of multiple blocks from a drawing.

20th July 2012

Updated List Box function to standardise code formatting and rewrite several expressions to improve clarity and readability.

18th July 2012

Updated Create Directory, Copy Folder & Apply to Block Objects functions to restructure and standardise code formatting and improve readability.

17th July 2012

I have once again updated my Nested Block Counter to Version 1.4 to implement another fix for an issue relating to counting Standard Blocks nested within Dynamic Blocks which are using different Visibility States. This issue should now (hopefully) be fully resolved.

12th July 2012

I have restructured and rewritten several sections of my Error Handling tutorial to provide clearer explanations and cleaner code samples.

11th July 2012

I have updated my Nested Block Counter program to Version 1.3. This update provides a fix for an issue arising when counting Standard Blocks nested within Dynamic Blocks which are using different Visibility States. The new version also offers the ability to extract the block report to either a Text or CSV file.

3rd July 2012

Added Write CSV function to enable a user to write a list of cell values to a CSV file. An example program is also included on the program page, demonstrating the ease of constructing a program to extract point data to a CSV file by utilising the LM:WriteCSV function.

Updated my Read CSV function to restructure the code for better readability and performance, provide support for international systems which do not necessarily use a comma as a CSV delimiter character, and improve the cell parsing function to return more accurate results for cells containing commas and quotes.

Minor updates to my Bulge Conversion Functions to update the code formatting, shorten and improve the test functions and re-order the returned values for my Arc->Bulge function to reflect the order in which the values are used when constructing an LWPolyline.

23rd June 2012

Updated set of Draw Order Functions to Version 1.1. This update is a complete overhaul of the code for both the draw order functions and example custom draw order programs found on the program page. The functions now provide support for 64-bit systems, and the example programs will now process objects on locked layers.

18th June 2012

Incremental Numbering Suite Version 3.3 released.

After much planning, experimentation, redesign and deliberation of ideas for new features, I have finally released the new version of by far my largest, most popular and also most extensively developed program:

I present Version 3.3 of my Incremental Numbering Suite.

This release includes more changes and is packed with more new features than any other release since the program was first drafted. The Program Description has also been predominantly rewritten to document all of the new program functionality.

A number of the more significant changes and new features are detailed below:

  • I have added the ability to increment multiple sections of the incrementing string: the previous radio button controls which were used to allow the user to decide which section of the string is to be incremented have now been replaced with toggle controls to enable the user to increment any or all sections of the string, alphabetically or numerically simultaneously.
  • I have added the ability to create an array of incrementing Text, MText or Block objects, with the selected object aligned or perpendicular to the array, or with rotation set to an entered arbitrary angle, or an angle picked from the drawing. This is probably the most significant addition to the program operation, providing an additional method for the user to generate the incrementing text in a drawing, with all of the existing formatting options applied. This new functionality is described in more detail on the program page under the section Creating an Array, which also includes several animated examples to demonstrate.
  • Included a set of controls within the Formatting section of the dialog to give the user the ability to control MText Background Mask offset factor and colour. The controls are very similar to my existing Background Mask program, so frequent users of my programs will already be familiar with how to operate this section.
  • Added the ability to specify the block scale as an arbitrary value, a value picked from the drawing, or based on the value of a selected System Variable. In previous versions of the program, a block would always be inserted at 1:1 scale, offering no option to change this scale. This new version not only allows the user to enter or pick any scale value, but the scale can also be directly dependent upon the current settings of a selected System Variable.
  • Provided the user the option to pick the Text Height value from the drawing. This change is to conform with the other edit box input sections of the dialog which require a numerical value, allowing the user to pick a value from the drawing itself.
  • Text & MText Border Offset is now a factor of text height where an offset factor of 1.0 exactly fits the Text or MText object, a factor of 1.5 extends the border by 0.5 times the text height etc. This emulates the behaviour of the newly implemented MText Background Mask, and enables the user to easily create a rectangular border around the background mask by specifying the same offset factor for both. This to me seemed more intuitive.
  • Added the ability to increment the string during placement by pressing the I / i key. This change followed from the 'toggle counter' control (T / t), and allows the user to increment the string independently.
  • As a rather more aesthetic change: I have redesigned 'About' dialog to include appropriate bitmap images and a stylized program title. Following with the aesthetic theme, I have also redesigned all object selection and pick buttons to conform with standard AutoCAD dialog interfaces to make users feel more 'at home' with the program.
  • Finally, where general bug maintenance is concerned: I have fixed a bug causing program to crash if the Object type is set to 'Text' and Text Alignment is set to 'Left', then the Object type is switched to 'MText'.
  • I have also fixed a bug in which the program would check for possible incorrect border parameters when the Object type is set to 'Block' (in which no border may be used).

16th June 2012

Added Consistent rtos function to the Subfunction Library section of the site. This fairly simple wrapper for the rtos function will always return the result of evaluating the rtos function with the DIMZIN System Variable set to 0, thus eradicating any incongruency when using this function in different drafting environments.

14th June 2012

Added Version 1.1 of my Label program to the site. This program is a stripped down, faster & improved version of my previously published Align Text to Curve program; the program has been streamlined to allow the user to create MText 'labels' dynamically aligned to a selected primary or nested object, with additional placement controls available at the command-line.

10th June 2012

Modified the following programs to both update code formatting and improve the flow & readability of the code:

18th May 2012

Added Extract Nested Block program to the General Programs section of the site. This program will allow the user to convert a nested block into a primary block inserted at the same position for each reference of the nested block, with the same scale, rotation, orientation and all other properties possessed by the original nested block.

5th May 2012

My Batch Attribute Editor has now been upgraded to Version 1.3. This update implements several new features in addition to remedying a couple of minor bugs present in the previous versions.

A brief summary of the notable improvements have been included below:

  • The attribute modification module has been completely rewritten to utilise Visual LISP methods, enabling processing of Multiline Attributes and also permitting the use of Field Expressions in attribute values.
  • I have added the ability to use incrementing attribute values in attribute data. If an attribute value contains markers <# and #> surrounding numerical data, the numerical section between these markers will be incremented by one for each drawing processed by the program. More information about this feature is detailed in the program description, under the section entitled: Incrementing Attribute Values.

29th April 2012

Updated my Steal program to Version 1.6. Amongst other general updates to the program code, this version fixes a bug causing the program to crash for versions in which some collections are not available.

24th April 2012

Updated Layer Director to Version 1.1. In this version, the majority of the program has been rewritten to streamline the code. The previous Command Reactor toggle has been removed in lieu of two separate commands to switch the program on & off; this alteration follows reports by users that the previous version would toggle on then promptly off when loaded through the Startup Suite.

20th April 2012

Updated Quick Field program to Version 1.1. This version implements a fix for a reported bug which was causing the program to crash when used in 64-bit environments.

16th April 2012

Added Background Mask program to the site. This program allows the user to manipulate all properties of the background mask for a selection of Multiline Text (MText) and Multileader (MLeader) objects.

14th March 2012

Areas to Field program completely rewritten to incorporate better support for 64-bit systems and also improve code readability. GIF demonstration added to the program description page.

5th March 2012

I have updated my Batch Attribute Editor program to Version 1.2. This update hopefully implements a fix for the scripting bug present in previous versions of the program, and also offers the user the ability to select multiple attributed blocks from the active drawing whose attribute values may be added to the list of items to be modified. This should no doubt greatly reduce the tediousness of manually inputting the attribute information.

2nd March 2012

Updated Incremental Numbering Suite program to Version 3.2. This update fixes a number of bugs, the most prominent pertaining to the collection of attributed block data.

26th February 2012

Rewritten the code for Copy Block from Drawing program to make it consistent with many of my more recent programs and furthermore to improve code readability.

22nd February 2012

I have completely rewritten my Slinky Text program and have updated the program to Version 1.4. This new version has cleaner code and includes several performance enhancements which should allow the program to run smoother.

18th February 2012

Added Format DCL program to the Utilities section of the program page. This program will read a selected DCL file and create a formatted version of the DCL code in the same directory as the selected file.

10th February 2012

Updated Batch Attribute Editor to Version 1.1. This update fixes some scripting issues reported in the last version and splits the main dialog into two separate screens to account for those users without access to a widescreen resolution. More information about the update can be found in the program code header.

8th February 2012

ObjectDBX Wrapper function completely rewritten. I have also extensively updated the program description and have included several examples demonstrating how to use the program.

30th January 2012

In June of 2009 I put together the first version of my Global Attribute Extractor & Editor program, offering the user the ability to extract attribute data from multiple blocks in many drawings, and edit several attributes in a block across multiple drawings.

This program used ObjectDBX to process many drawings very quickly, but this approach also included drawbacks stemming from the underdevelopment of the ObjectDBX interface, which, to this day, still has bugs. Furthermore, the Editor part of the program only offered the ability to modify attributes in a single block.

Almost three years later, I am now offering a new Batch Attribute Editor program. This program allows the user to modify the values of multiple attributes residing within multiple attributed blocks across multiple drawings. A full description of this new and improved program may be found on the dedicated program page.

20th January 2012

Added Escape Wildcards function to the Subfunction Library. This function will escape wildcard characters found in a supplied string, ensuring such characters are interpreted literally.

Updated the Testimonials section of the site to include a very kind testimonial from Clint Hill at Innophos, Inc. Many thanks Clint!

19th January 2012

Added LISP Command Logger program to the site. This program will automatically (and silently) record daily LISP command usage in every drawing to a CSV Log File, saved to a folder specified in the program source code.

17th January 2012

Added Nested Block Counter program to the list of General Programs. This program will generate a report detailing the individual quantities of primary and nested blocks, dynamic blocks & XRefs in a selection or an entire drawing.

16th January 2012

Updated Read CSV function to return the correct content of CSV cells containing commas and quotes, and to correctly read CSV files generated using OpenOffice software.

Previously, when reading a CSV file with the following content:

Example CSV

The old ReadCSV function would incorrectly return the list:

(("abc" "\"a" "b" "c\"" "\"\"\"abc\"\"\"" "\"\"\"a" "b" "c\"\"\""))

The updated function now correctly returns:

(("abc" "a,b,c" "\"abc\"" "\"a,b,c\""))

As a result of the updated Read CSV function noted above, I have subsequently updated my Update Titleblock Attributes program to Version 1.4 to allow for CSV files containing commas and quotes.

12th January 2012

I found a few minor bugs in the code for my recently added Get Files Dialog function pertaining to the behaviour of mode_tile statements for the Add Files and Remove Files buttons. These have now been fixed and the code has been updated to Version 1.1.

11th January 2012

Added Get Files Dialog function to the Subfunction Library. This function is analogous to the AutoLISP getfiled function, however allows the user to select multiple files from several directories.

9th January 2012

First post of 2012: a Happy New Year to my readers!

Added Read CSV function to the Subfunction Library. This function will read an Excel Comma Separated Value (CSV) file and return a matrix list of the cell values, that is, a list of lists where each sublist is a row of cell values.

30th December 2011

The code for my Unformat String function has been completely rewritten; the new version should be more robust with far more error trapping. The Unformat String function will remove all MText formatting codes from a supplied string.

29th December 2011

Updated Open function code and included an extra example demonstrating how the function may be used to open an arbitrary file selected by the user.

Reformatted the code for the Ortho Point function and included a 'Vector Calculus' version of the same function to demonstrate another approach.

27th December 2011

Revised the Update Titleblock Attributes program to Version 1.3. This version implements a modification to allow the program to correctly process CSV files generated using OpenOffice software.

24th December 2011  

Updated the Iterated Function Systems mathematical program to Version 1.2. This is a complete rewrite of the program, including an update to the Barnsley's Fern program on the main page.

23rd December 2011

Updated Fractal code to remove unnecessary expressions and hence improve performance.

21st December 2011

Updated the Dynamic Block Functions page and added a Contents section to ease navigation of the various functions.

17th December 2011

Added Polygon Centroid function to the Subfunction Library. This function will return the centroid (expressed relative to WCS) of an LWPolyline Polygon, that is, a non-self-intersecting closed LWPolyline consisting entirely of straight segments.

Also added PolyCentroid function to my set of Geometric Functions.

Updated Attribute Functions page to reformat all code and include new function: SetAttributeValues.

Added a Contents section to the Attribute Functions page.

7th December 2011

Added Get Anonymous References function to the Subfunction Library. This function will iterate over the block table and return a list of the names of all anonymous references associated with a supplied block name; armed with such a list, an appropriate ssget filter list may be constructed to include only those references which are relevant to a specific dynamic block.

2nd December 2011

Added 3-Point Circle & Arc Functions to the Subfunction Library. These functions return the data required to construct a Circle or Arc from three supplied points. A variety of non-dynamic and dynamic test programs are also included.

Added mid, 3PCircle & 3PArc to my set of Geometric Functions.

Added v1 function to my set of Matrix & Vector Functions. This function will return a unit vector representation of a supplied vector.

27th November 2011

Updated Reset XRef Layers program to Version 1.1. This version incorporates code to search the working directory and AutoCAD support directories for the XRef source file, should such file not be found at the filepath encoded in the XRef.

24th November 2011

Tweaked the style of the Programs page.

19th November 2011

Added Reset XRef Layers program to the General Programs section of the site. This program enables the user to reset all or specific layer properties of XRef dependent layers to match the properties present in the XRef source drawing file.

16th November 2011

Added Minimum Enclosing Circle program to the General Programs section of the site. This program offers two commands to allow the user to make a selection of one or more objects, then proceed to construct the unique minimum enclosing circle containing all objects in the selection.

A minor update to the Entity to Point List function to include Point Entities.

11th November 2011  

Added Minimum Enclosing Circle function to the Subfunction Library. This function will compute the centre & radius of the smallest circle containing a set of points.

9th November 2011

Added Entity to Point List function to the Subfunction Library. This function will return a list of points describing or approximating a supplied entity, whilst minimising the length of the returned point list where possible.

6th November 2011

Added Quick Field program to the site. This function is designed to enable the user to quickly and easily design & create custom programs for inserting multiple fields into a drawing. This could be for use in situations in which the user is required to create many fields in a drawing, with each field referencing the same object property, and continued use of the Field Command Dialog can become tedious.

5th November 2011

Added Get Field Objects function to the Subfunction Library. This function requires a single parameter: an entity containing a Field, and will return a list of entities referenced by the supplied Field.

3rd November 2011

Added Friends of Lee Mac Programming to the homepage sidebar. If you wish to become a friend of Lee Mac Programming and feel that your site has suitable content which is relevant to my site, feel free to contact me.

Whether or not your site is suitable to become an affiliate of Lee Mac Programming feel free to display my microbar on your site, I appreciate you linking to my site.

1st November 2011

Added to the Subfunction Library a function to compute the Convex Hull of a set of points. The Convex Hull is the set of points describing the minimum convex polygon enclosing all points in a given set. The function shown implements the Graham Scan algorithm to compute the Convex Hull - a description of this algorithm including a visual demonstration of the process is included on the program page.

In other news... Lee Mac Programming is a year old!

30th October 2011

Updated Area Label program to Version 1.9. This update fixes a bug causing the program to crash when Region Objects were selected.

29th October 2011

Tweaked the code for the Entity List utility. The program has now been renamed and more accreditation has been included to recognise the author of the program on which the utility is based.

Redesigned the site Contact Form.

24th October 2011

Added Testimonials section to the About page. This section includes a few paragraphs from companies who have hired my services, detailing their experiences working with me and my programs.

If you or your company wish to share your thoughts about my site, or working with me or my programs in the form of a testimonial, feel free to contact me.

23rd October 2011

Added Draw Grid program to the site. This program will prompt the user for a number of rows and columns then proceed to dynamically construct a grid composed of Line Entities between two corner points.

20th October 2011

Added Automatically Label Attributes program to the site. This program uses multiple reactors to automatically label / number a specific attribute in a set of blocks, automatically renumbering if blocks are added, copied or erased.

11th October 2011

Updated Incremental Numbering Suite to Version 3.1. This fixes a bug concerning a null variable when an Annotative Text Style is set and the Object type is set to use an Attributed Block.

10th October 2011

Incremental Numbering Suite Version 3.0 released.

The program is now faster & smoother and has become my largest and most developed application, with many new features and updates included in the new version, a handful of which I have listed below.

I have also completely rewritten the program description to give a more complete overview of the program capabilities.

  • Program completely rewritten to improve program performance, update code formatting to improve readability and include the following new features:
  • Ability to use Text, MText or an arbitrary Attributed Block to house incrementing string.
  • Ability to change Text / MText Alignment.
  • Ability to toggle the use of a Background Mask with MText.
  • Ability to specify and pick both dimensions for the fixed size Slot / Rectangular border.
  • Vastly improved alphabetical text incrementing.
  • Improved handling of negative numbers with decimals or leading zeros.
  • Dialog interface completely redesigned to make it more user-friendly and intuitive to navigate.
  • Immensely improved non-dynamic mode interface & functionality.
  • Program works in all UCS/Views correctly.

7th October 2011

Coming Soon!

Version 3.0 of my Incremental Numbering Suite program.

Following the popularity of this program on my site, I am currently working on a new version which promises to be smoother, faster and packed with new features.

Click here to read about some of the planned new features and see a preview of the new interface.

3rd October 2011

Added set of Text Case Functions to the Subfunction Library. These functions demonstrate how to convert a text string to various text cases and formats. Included are functions to enable conversion of a text string to Sentence Case, Title Case, or finally, the case of each character in a string may be switched using the Toggle Case function.

2nd October 2011

Copy to Drawing program completely rewritten and updated to Version 1.1. When rewriting this program I have significantly condensed the code, reformatted the code style to make the source code more readable and easier to follow, and hopefully improved the performance of the program.

30th September 2011

Updated Automatic Block Break program to Version 1.4. Included in this version is an option to enable or disable the automatic rotation of the block if a curve object is found at the block insertion point.

Added set of Assoc++ Functions to the Subfunction Library. These functions may be used to increment the associated value of a key in an association list, or a nested key as part of a hierarchy of keys in a nested association list. Such functions are useful when counting the number of occurrences of distinct items in a set, or when counting items which are dependent upon other items. These functions are used in many of my programs: Block Counter, Text Counter, Count Attribute Values & Dynamic Block Counter to name a few.

Updated Incremental Array program to Version 1.4. This version fixes a bug when arraying and incrementing attributes on locked layers.

28th September 2011

Added Clockwise-p and ListClockwise-p to my set of Geometric Functions. These functions may be utilised to determine whether 3 or more points are clockwise oriented, that is, whether a path passing through the points follows a clockwise direction.

24th September 2011

Implemented a facility to allow users to change the width of pages on the site, depending on their preference. Users may select a Fluid, Wide, Medium or Narrow width setting. The default width is Fluid in which the width of the page is set by the width of the browser. Other settings may be more suitable for various screen resolutions.

21st September 2011

Added Pad Between Strings function to the subfunction library. This function returns a string of a minimum specified length which is the concatenation of two supplied strings, padded between using a supplied character. Such a function is extremely useful when printing reports or lists to the command-line, and is used extensively in my Dynamic Block Counter program.

20th September 2011

Implemented a facility to allow users to alter the size of text on my site, increasing readability.

Added Custom Programming Services section to the Home page, for those companies looking to automate repetitive tasks in their procedures via the use of custom programming, potentially saving hours of valuable time.

11th September 2011

Added Dynamic Block Counter program to the site. Very similar to my Block Counter program, this program will count all blocks in the current layout of a drawing - be they standard, dynamic, or XRef; generating a report of the quantities at the command-line. Furthermore, for every dynamic block with a Visibility Parameter present, the number of blocks assuming every Visibility State of the dynamic block is detailed in the output report.

10th September 2011

Added Get Visibility Parameter Name, Get Visibility State, & Set Visibility State functions my set of Dynamic Block Functions. These functions allow the user to manipulate the Visibility Parameter of a Dynamic Block.

Updated SelectionSet Bounding Box function and test program to make the code more succinct and increase function performance.

7th September 2011

Updated Steal from Drawing program to Version 1.5. This version implements a number of changes to improve the program:

  • Added the ability to use Wildcard Patterns in the ItemList parameter to allow all items in a collection which match the supplied wildcard pattern to be imported.
  • Added Materials and Named Viewports to the list of collections.
  • Added StealAll command to allow the user to automatically steal everything from a selected drawing file.
  • Added StealTemplate command to enable the user to quickly steal items from the QNew template file (or other template file, if the QNew template file is not set).

5th September 2011

Updated Polyline Outline program to Version 1.1. This version includes a fix for a minor bug relating to incorrect processing of the ending width of the final polyline segment.

3rd September 2011

Added Polyline Outline program to the site. This program will create one or more LWPolylines along the boundary of a supplied LWPolyline with varying or constant width.

28th August 2011

Upgraded Update Titleblock Attributes program to Version 1.2. This version removes case-sensitivity from the 'Drawing Filename' column of the CSV Drawing Register so that both the drawing filename data (first column) and layout data (optional, second column) are not case-sensitive. I have furthermore added a GIF animation providing a succinct demonstration of how the program may be used to link a set of drawings to a drawing register.

25th August 2011

Updated Copy or Rename Block program to Version 1.3. This version allows the user to copy and rename External References (XRefs) in addition to Standard and Dynamic Blocks; retaining any XClips associated with the selected block.

24th August 2011

Added Incremental Array program to the site. This program will array a selection of objects, whilst incrementing any numerical content found in objects containing text within the selection.

19th August 2011

Added Elevation Marker program to the site. This relatively simple program allows the user to continuously place elevation markers composed of an LWPolyline and Text object at specific points in a drawing.

14th August 2011

Added Minimum Bounding Box function to the subfunction library. This function uses a brute-force method to determine the minimum rectangular bounding box framing all objects in a supplied selection set.

6th August 2011

Added Visual LISP IDE tutorial: A Shortcut to Localising Variables to help relieve the tedium of localising many variables in larger programs, reducing the task to a simple copy & paste operation.

5th August 2011

Updated Text Counter to Version 1.1. This program will count the number of occurrences of distinct text strings in a selection of objects. In addition to reformatting the code for this program, this updated version includes the ability to count MLeader text and Dimensions with a text override. Annotative text styles have also been taken into consideration when determining the size of the resultant table object.

3rd August 2011

Added Error Message Troubleshooter to the Tutorials page. This page provides a brief guide detailing the possible causes of a selection of common error messages received when executing an AutoLISP program.

Updated my Automatic Block Break program to Version 1.3. This update implements a complete change to the method used to detect intersections between the inserted block and surrounding objects, improving program performance. The new version of the program will now exclude attributes from the trimming operation, and will trim objects surrounding blocks whose insertion points do not lie on a curve object (in previous versions such objects were not trimmed). Finally, a new command: 'ABBS' (AutoBlockBreakSelection) has been added to allow users to make a selection of multiple blocks to be processed by the AutoBlockBreak subfunction.

27th July 2011

Added Edit Box subfunction to the site. This very simple function utilises a predefined AutoCAD dialog definition to display an interface allowing the user to input a text string.

22nd July 2011

It has been almost a year since I have worked on my Batch Find & Replace Text program, and considering its apparent popularity amongst the other programs on my site, I felt it was about time that I updated it.

The majority of the program code has hence been rewritten and reformatted in line with my other more recent programs, and the following enhancements have been incorporated:

  • Added 'Where to Search' panel to the Options dialog to enable users to restrict the Find & Replace operation to Model space, Layout space or both.
  • Added ability to perform the Find and Replace operation on objects within Block Definitions.
  • Added ability to process All Open Drawings.
  • Changed format of Saved Searches file for easier manual editing.
  • Added Current Directory toggle to directory selection panel to allow the user to quickly select the current working directory of drawings for processing.
  • Fixed tab stops in main dialog so that the user may navigate between the Find and Replace edit boxes more intuitively.
  • Incorporated ability to add items to the Find & Replace list by pressing Enter from within either edit box.
  • Added ability to press Enter after specifying Save Reference to avoid the need to click the OK button.
  • Added ability to press Enter from within either edit box of the Edit Entry dialog, to avoid the need to click the OK button.
  • General bug fixes and function improvements.

15th July 2011

Added String Wrap function to the site. This subfunction will break a supplied string at spaces (if possible) into a list of substrings, each of a specified length or less.

9th July 2011

Added set of Bulge Conversion Functions to the subfunction library. These functions demonstrate various methods to convert between the quantities used to define a Polyline Arc segment and those used to define an Arc Entity, with diagrammatic explanations of the calculations used in each method.

8th July 2011

Updated List Box Synchronisation tutorial to fix a few typos.

2nd July 2011

Added set of List Box Functions to the subfunction library. These functions may be used to manipulate the order of multiple items in a DCL List Box, as demonstrated by my TabSort program and Layer Draw Order program.

1st July 2011

Added Centered Measure program to the site. This program is designed to emulate the behaviour of the standard AutoCAD Measure command, however, the resultant measured intervals are centered on the selected object, as opposed to extending along the object from one end.

28th June 2011

Added SubList function to the subfunction library. This subfunction is the list equivalent of the AutoLISP substr function, and will return the sublist of a supplied list from a specified starting index and with a specified length.

Added List Collinear-p, Coplanar-p and List Coplanar-p predicate functions to set of Geometric Functions. These functions offer the ability to test the collinearity of a list of points, or the coplanarity of four or more points.

27th June 2011

Added Collinear-p and Perpendicular-p functions to set of Geometric Functions. These predicate functions may be used to test the collinearity of three points, or the perpendicularity of two vectors.

23rd June 2011

Updated Change Block Insertion program to Version 1.3. This version fixes a reported bug pertaining to the position of the selected block reference not being retained when nested in other blocks in the drawing. When called with 'CBIR', the program will now update the position of every reference of the selected block (nested to any level) in all block definitions.

20th June 2011

Updated Layer Draw Order program to Version 1.2. This version allows the user to select specific layers for which to change the draw-order from a filterable list of non-XRef dependent layers, whilst retaining the inherent draw-order of entities on the other remaining layers in the drawing. Furthermore, selected layers may be ordered above or below the other layers in the drawing. A Help button is also included to assist the user.

18th June 2011

Updated Layer Draw Order program to Version 1.1. This version increases the height of the layer list to ease use in drawings with a large number of layers. The updated program also offers the ability to add a wildcard pattern to the list of layers in order to group a set of layers matching the pattern.

16th June 2011

Added Layer Draw Order program to the site. Similar to the Express Tools' CDOrder program, this program enables the user to control the draw order of all entities on each layer in a drawing, relative to other layers.

13th June 2011

Added Parse Numbers function to the site. This function will extract numbers represented in decimal format from a supplied string, returning a list of all numerical values found in the string.

12th June 2011

Added both a Visual & Vanilla LISP version of an Effective Block Name function to the site. These subfunctions demonstrate methods to obtain the true name of a block reference as per its associated block definition in the block collection of the drawing in which it resides.

Tweaked ArcSine and ArcCosine functions as part of the set of Trigonometric Functions to make the code more readable.

11th June 2011

Added List Difference function to the site. This function will return a list expressing the difference or relative complement of two or more lists, that is, a list of items appearing exclusively in one list but not the other(s).

Added List Symmetric Difference function to the site. This subfunction will return a list expressing the symmetric difference of two or more lists, that is, a list of items appearing exclusively in each list and not in the intersection of any pair of lists.

10th June 2011

Added List Union and List Intersection functions to the subfunction library section of the site. These functions will return a list expressing the union and intersection, respectively, of two or more supplied lists.

Added Line-Circle Intersection function to set of Geometric Functions. This function will return the point(s) of intersection between a line and a circle.

9th June 2011

Added iterative versions of Subst Once, Subst Nth, Remove Once and Remove Nth subfunctions to the site.

8th June 2011

Added some extra functions to the Unique & Duplicate List Functions page. This page contains various functions engineered for manipulating lists in which items appear more than once.

7th June 2011

Added List Box subfunction to the subfunction library of the programs page. This subfunction displays a dialog with a List Box interface enabling the user to select one or more items from the supplied data set.

5th June 2011

Added Strikethrough Text program to the site. This program will create an LWPolyline passing through the centre of selected Text or MText objects to create a strikethrough text effect.

Updated set of Intersection Functions to include functions to return the intersection points between objects in a list, two sets, or two lists.

4th June 2011

Updated Circle Break program to Version 1.2 following a received bug report.

3rd June 2011

Added RGB->HSL and HSL->RGB conversion functions to set of Colour Conversion Functions. These functions will convert between Red, Green, & Blue colour values and Hue, Saturation & Luminance values for the two colour models.

2nd June 2011

Renamed Copy Block program to Copy or Rename Block since the program now provides the ability to copy or just rename a single selected block reference.

Updated Copy Block program once more to Version 1.2. I realised there was a much easier way to implement the transference of block properties from the source block to the copied block. This approach has consequently removed a lot of excess code from the previous version.

1st June 2011

Completely rewrote my Copy Block program, which has now been updated to Version 1.1. This program will allow the user to copy and rename a block (which may be dynamic) in the working drawing. The program uses an ObjectDBX Document as an intermediary in which the block definition can be copied and renamed without resulting in a duplicate key in the Block Collection of the working drawing.

Added 'Preview' GIF animation to Copy Block page demonstrating program usage on a dynamic block example.

Updated the Change Block Insertion program to Version 1.2. This program was written around the same time (if not earlier) as my recently updated Add Objects to Block program. Hence this update carries forward many of the changes applied to that program.

Updated ObjectDBX Wrapper program to reflect changes to Get All Files subfunction.

Updated Circle Break program to Version 1.1 to utilise upgraded Select If subfunction and new Clockwise-p subfunction.

31st May 2011

Updated the Add Objects to Block program to Version 1.1. I first wrote the code for this program in June of last year and have now implemented knowledge I have since gained to remove some excess code from the program to hopefully streamline the process. The AddObjectstoBlock subfunction has also been rewritten to require a VLA Document Object parameter, enabling the developer to utilise the subfunction on blocks in arbitrary documents (i.e. also through ObjectDBX).

Updated the Align Text program to Version 1.1. Once again, removing excess code to increase the performance of the program and to bring the coding style in line with my other programs.

30th May 2011

Added Popup subfunction to the site. This function uses the Popup method of the Windows Script Host Shell Object to display a customisable pop-up message box.

29th May 2011

Added Permutations function to subfunction library. This recursive subfunction will return a list of all possible permutations of elements in a supplied list.

Added Insert Nth function to subfunction library. This function will insert an item at the nth position in a list.

Added Remove Items function to the site. This function will remove items at specified indexes from a list.

28th May 2011

Added set of Geometric Functions to Mathematical functions page.

27th May 2011

Added 3D Reflection function (including test functions) to set of Matrix Transformation Functions. This function will reflect a target (VLA-Object or List of 3D Points) in an arbitrary plane.

26th May 2011

Added 3D Rotation function (including test functions) to set of Matrix Transformation Functions. This function will rotate a target (VLA-Object or List of 3D Points) by a given angle about an axis defined by two 3D points.

Renamed 'SubstN' program to Subst Nth to be consistent with similar Remove Nth program.

25th May 2011

Added set of Base Conversion functions to demonstrate methods of converting a number between numeral systems using different bases or radixes.

Updated Directory Dialog subfunction to incorporate better error trapping and a more concise and structured code layout.

Updated Get All Files subfunction to remove excess code and hence improve performance and readability.

Updated ACADDOC.lsp Creator program to Version 1.1 to incorporate the updated Get All Files and Directory Dialog subfunctions and other upgraded subfunctions used by the program.

Updated subfunctions enabling the user to Add & Remove Support Paths to make the code more concise and readable.

Added Remove Once subfunction to the site, a function which enables the developer to remove the first occurrence of an item from a list.

Added Apply to Block Objects subfunction to the site. This subfunction will evaluate a supplied function on all objects in a block definition and return a list of the return of each function evaluation.

24th May 2011

Tweaked site formatting to make table text on program pages more readable.

19th May 2011

Added Update Titleblock Attributes program to the site. This program offers the ability to automatically update drawing titleblock attributes with values sourced from a CSV drawing register. When a drawing is opened, a CSV Drawing Register may be automatically read by the program, and titleblock attributes are updated using values corresponding to the drawing entry in the register.

18th May 2011

Updated Select If subfunction to apply the optional predicate function to the entity selection list returned by the selection function, and also return this entity selection list; this provides the developer with the ability to use other elements in the selection list to validate the predicate function in addition to the selected entity name. An optional keyword argument (in the form of a list of parameters to be supplied to the initget function) is also included.

Added a selection of Clockwise-p subfunctions to determine whether three points are oriented clockwise; complete with brief explanations of the mathematical methods utilised by each function.

Added 'Jump To' quick navigation bar to sidepanel of site so that visitors can find what they need faster.

17th May 2011

Updated TabSort program to Version 2.2. This program was written back in late 2009 and so I figured it needed a little updating. In the end, I decided to rewrite the entire program. I haven't added any new functionality, but the program should be more robust and run smoother than the previous version, with a few bugs squashed in the process. The Find and Replace engine has been completely overhauled, now permitting the user to use self-referencing find and replace terms (for example, replacing 'ABC' with 'AB'), and the visual feedback during the find and replace process has been improved significantly. With the vast number of changes to the program, I expect there are still a few bugs lurking, but in my preliminary tests, I haven't found anything as yet.

15th May 2011

Added Object Lock program to the site - a purely academic piece of code demonstrating the ability to prevent modification of a set of objects using reactors.

14th May 2011

Added Associative Centerlines program to the site. This reactor based program enables the user to create associative circle centerlines which will automatically update following modification of the associated circle.

Updated the set of Attribute Functions to remove case-sensitivity from the attribute tag argument and also add a couple of recursive variations to the Vanilla subfunctions.

Updated the set of Dynamic Block Functions to remove case-sensitivity from the dynamic block property argument.

Fixed a bug found in the Area Label program (updated to Version 1.8).

12th May 2011

Added Area Label program to the site. This versatile program enables the user to annotate picked areas or selected objects with custom labels and either display the labels and associated areas in an AutoCAD Table Object, or write the data to file.

Added Steal from Drawing program to the site. This program allows the user to import (humourously: 'steal') items from another drawing into the current drawing. The user can choose to import multiple items from a list of Blocks, Layers, Linetypes, Dimension Styles, Text Styles, Table Styles, MLeader Styles, MLine Styles, Layouts, Page Setups, User Coordinate Systems, Views, Layer States & Scales.

8th May 2011

Updated the ObjectDBX Wrapper subfunction and associated test function.

7th May 2011

Added program to allow the user to dynamically align a selection of objects to a selected curve. The user is prompted to make a selection of objects to align to a selected curve, and a base point to use during alignment. The objects are then dynamically aligned to the curve in real-time, whilst the user may refine the alignment using additional controls offered at the command-line.

textsize

increase · reset · decrease

My Friends

Designed & Created by Lee Mac © 2010