• Blog posts

    Bio

    By Dennis Collin

    AutoCAD_Tip_-_Enhanced_Offset_AutoLisp_routine_-_1.JPG

    I often get asked if AutoCAD can be customised or programmed to get a standard command to perform in a certain way. The answer is often yes provided you know what to do!

    AutoCAD_Tip_-_Enhanced_Offset_AutoLisp_routine_-_2.JPG

    Recently a question was raised if a line could be offset in two directions at once rather than having to do one half at a time e.g. a pipe or a wall needs to be drawn from a centre line with a specified offset or thickness. This can be achieved in many ways, but typically AutoLisp can be used. Lisp has been around for many years and many useful routines can be accessed and added to users AutoCAD start-up suite of bespoke commands.

    I have posted some useful resources here: https://www.cadlinecommunity.co.uk/hc/en-us/articles/360002856597-AutoCAD-Automating-tasks-in-AutoCAD-with-AutoLISP

    A routine that performs this task can be easily found after only a few minutes of searching one of the free Lisp repositories.

    AutoCAD_Tip_-_Enhanced_Offset_AutoLisp_routine_-_3.JPG

    Of course, some users might argue that AutoCAD’s multi-line feature can do this, however multi-lines are somewhat inflexible if a width needs to be changed, and ultimately the elements are usually exploded down to lines anyway. The standard offset command has improved in recent versions, but it still lacks an offset in both directions, found in other software, but this omission is addressed by this routine.

    AutoCAD_Tip_-_Enhanced_Offset_AutoLisp_routine_-_4.JPG

    Use the Appload function to load DOF.lsp into your AutoCAD session. To make this a permanent addition to the bespoke set of tools, ensure the desired routines are added to AutoCAD’s start-up suite. The command can then be accessed by typing DOF, in the same way as AutoCAD’s standard commands.

    To retain the centre line element remove the entry marked in red in Notepad or similar.

    AutoCAD_Tip_-_Enhanced_Offset_AutoLisp_routine_-_5.JPG