Jump to content

Programs and Scripts

AutoLISP, VisualLISP and VBA Programs are for use with AutoCAD software.

39 files

  1. TSP.ZIP (Travelling Salesman Problem) - AutoLISP

    Here are 6 variants of TSP*.lsp...
     
    First one : TSP.lsp - wrapper for grid and rnd disposition - LISP and ObjectARX...
    Second one : TSP-ALL.lsp - gathered plenty of subfunctions to pull out best results by permutations of point clouds...
    Third one : TSP-cheapestpath.lsp - Similar to TSP.lsp (wrapper) but without choosing for grid and rnd dispositions...
    Fourth one : TSP-MMR.lsp - FAST grid and rnd disposition with Evgeniy Elpanov's optimization with 2 factor permutation...
    Fifth one : TSP-MMR+ALL.lsp - combination of TSP-MMR.lsp and TSP-ALL.lsp...
    Sixth one : TSP-MR-AROUND-CONCAVE.lsp - very nice little routine to make stars from radially disposition of points...
     
    Big thanks to Daniel from www.theswamp.org for providing *.arx and *.brx files for AutoCAD 2025 and BricsCAD V25...
    More info and newly added *.arx, *.brx, ... at this link : https://www.theswamp.org/index.php?topic=58049.0
     
    HTH.
    M.R.

    8,271 downloads

       (0 reviews)

    0 comments

    Updated

  2. packing-nesting.lsp

    Here is uploaded "packing-nesting.lsp" file that was discussed in many topics on www (https://www.theswamp.org/index.php?topic=52260.0) among others and I decided to share this version here at cadtutor / download as I think that it may be useful for many CAD users... The main difference between this version and others is that this version is using (vla-getboundingbox) method for determining extends of selected entities that may be anything that lie in 2D WCS...
    I hope you'll benefit if you find it useful...
    Best wishes in CAD processings and happy coding...
    Regards, author : Marko Ribar, d.i.a. (architect)

    2,669 downloads

       (0 reviews)

    0 comments

    Updated

  3. autodim.lsp

    This file is about very common request by almost every user of CAD software in search for automatic dimensioning routine... This is one example regarding solving this issue, but many specific questions were asked that this routine can't handle, but solutions were provided by others in quest for helping users that asked for help...
    So here is one of my versions that may help in automatic dimensioning architectural drawings (i.e. walls and openings)...
    I hope that this version may prove very useful to others, if nothing than for studying the uploaded "autodim.lsp"...
     
    If reference LWPOLYLINES, LINES or ARCS are in some 3D UCS aligned so that they lie in it, while dimensioning their elevation and elevation of dimensions can be changed, so you have to pick firstly some point on any dimension except dimradial and then you should 3DORBIT and apply "(c:autodim-dimtozero)" that is added to the end of "autodim.lsp" to dimradial dimensions to make them all at elevation 0.0 both all dimensions and reference entities that were dimensioned...

    HTH.
    Regards, M.R. (architect)
     

    3,776 downloads

       (1 review)

    0 comments

    Updated

  4. HIPPED ROOF ROUTINES

    This ZIP file contains AutoLisp routines for drawing and modelling hipped roofs solutions based on polyline shapes in AutoCAD or BricsCAD...
    Basically this is collection of useful things that were already posted on www and are now improved and publiced again with authors additions - edits and new files not publiced already...
    Author is not responsible for eventual bugs or failures, but all posted routines were well tested and coded so that errors can occur only very rarely...
    As this topic was discussed thouroughly on www, it is considered as challenge for programming and therefore all suggestions and improvements are very welcomed and highly appriciated...
    Further developments are possible, but author is not obligated to do so in any way, as this collection is free for using and editing for anyone faimiliar with AutoLisp API for AutoCAD...
     
    In hope that coded improvements and newly coded material are useful and have practical and theoretical benefit,
    author will be pleased and thankful for paying attention to this computational process that can help and give insight for better and smarter visualization in finding projecting solutions...
     
    Author : Marko Ribar, d.i.a. (architect)

    164,262 downloads

       (1 review)

    1 comment

    Updated

  5. BreakObjects.lsp

    Here is one oldie, but goldie... It's classic by Charles Alen Butler (aka CAB) from www.theswamp.org... After long time I decided to public here also, as I improved it and made it more advanced... I don't know is it OK to double attachments, but this one is little different... You have more command functions (c:...) and little different DCL which you can call it with (c:MyBreak)... Anyway now it's here too, but version is 2.4, since last CAB's was 2.3...

    8,162 downloads

       (1 review)

    0 comments

    Updated

  6. PLINETOOLS and BLOCK routines and MAKE PATTERN (pat) files for ACAD

    Just a link for topic where PLINETOOLS.ZIP is publicly posted...
     
    Block routines for AutoCAD can be found in this link :
    https://www.theswamp.org/index.php?topic=55186.msg594547#msg594547
    (you have to be logged at theswamp.org to access web page and download files...)
     
    Make pattern files (*,pat) for AutoCAD/BricsCAD can be found in this link :
    https://www.cadtutor.net/forum/topic/70417-make-pat-files/page/4/#comments
     
    HTH.
    Regards, M.R.

    189 downloads

       (0 reviews)

    0 comments

    Updated

  7. SuperBoundary • The superior boundary creation tool

    AutoCAD users often have to deal with the BOUNDARY (BPOLY) command, which allows creating boundaries (mostly enclosed polylines) from existing objects forming an enclosed area around the point specified. Unfortunately, its performance as well as the quality and the accuracy of the boundaries (contours) created when run in complex drawings leaves much to be desired. To eliminate these common drawbacks of the standard BOUNDARY command, a project called "SuperBoundary" was implemented.
     

     
    While BOUNDARY command generates simple contours quite efficiently in relatively simple drawings with a small number of objects on screen, SuperBoundary is intended to provide the user with comfortable workflow in drawings of any complexity. In other words, SuperBoundary is the utility based on the BOUNDARY concept supplemented by super-speed and some super-features.
     

     
    Key features:
    High performance. A powerful program engine allows analyzing and generating thousands of boundaries in seconds. High accuracy. When generating a boundary, all elements larger than the specified tolerance factor are considered. The possibility to create boundaries in areas having significant gaps between adjacent objects. The possibility to quickly detect and generate all the enclosed areas in the selected drawing or its part. Easy and accurate external outlines generation in complex drawings. Polylines generation from spline- and ellipse-based boundaries using piecewise-linear approximation Flexible adjustment of the boundaries generated. These are width, color and layer. Simple and convenient installation with classic installer.  
    List of commands:
    _SBND - launch the app in classic mode _SBND_PICK - for quick usage in "pick point" mode _SBND_ALL - for quick usage in "build all" mode _SBND_CONFIG - for export / import current settings data as an external INI file

    3,578 downloads

       (2 reviews)

    0 comments

    Updated

  8. TotalBoundary • Outline creation tool

    TotalBoundary (Pro) is a professional plugin for generating 2D outline drawings of various degrees of complexity with AutoCAD®. The outline drawings it creates are closed polylines marking the boundaries of various types of objects, which can include elementary entities (lines and arcs) as well as complex blocks and curves (ellipses and splines).
    What sets the TotalBoundary (Pro) utility apart from AutoCAD's built-in tools (such as BOUNDARY, BPOLY) and from other third-party programs is its high productivity and stability, and also the quality of the outlines it generates. The inbuilt algorithm for detecting spacing (gaps) between neighboring objects allows users to create enclosed outline polylines with exceptional accuracy. The program can process tens of thousands of objects extremely efficiently (in a matter of seconds), flawlessly generating highly complex outline polylines in the selected drawings.
     

     
    Key features:
    The program's powerful engine allows it to build enclosed polylines rapidly along the perimeter of selected drawing fragments. The original drawing needs no advance preparation (removing superfluous unconnected lines, creating an additional enclosed boundary polyline around the original drawing fragment). When the program creates an outline, it automatically identifies and removes gaps in places where primitives meet. The maximum size of these gaps can be set directly by the user. The program replaces splines and ellipses used in defining an outline with true polylines created by means of piecewise linear approximation. The user can also easily set the thickness and color of the polylines the program generates, if required. The program offers an automatic filling (solid hatching) option for the outlines it generates.

    3,779 downloads

       (4 reviews)

    6 comments

    Updated

  9. AreaTester • Calculating areas in AutoCAD

    AreaTester is a efficient plug-in for AutoCAD. It allows you to quickly measure the area in AutoCAD and gives you advanced capabilities to process the results of the calculations in the further workflow (annotate the the areas in the drawing, convert the received data to different spreadsheet formats, etc.).

    The plugin calculates not only the areas of enclosed objects, such as a polyline or circle, but also any other shapes formed by the intersection and connection of various types of objects, which include lines, arcs, splines and many other AutoCAD basic objects. At the same time, to calculate the area of any enclosed shape, you only need to point the crosshair of the cursor on it and the area value will be instantly displayed in the context window above the cursor. In addition, the user can create the necessary list of the areas in the main application window for the further workflow. All these areas are summed automatically in the created list. The total result of the summation is displayed at the bottom of the main window of the app.

    One of the main features of AreaTester, compared to the standard AutoCAD tools, is the ability to determine the area value of any bounded shape excluding the areas formed by objects that have got inside such an shape (the so-called "islands"). This option significantly simplifies the user’s work on calculating areas in AutoCAD, eliminating the need for additional mathematical operations.
    Key features of the AreaTester for AutoCAD plugin: Automatic calculation of the all areas in a drawing. Annotating the areas directly in a drawing. Drawing boundaries of the shapes in the form of polylines. Exporting the generated list of areas to the clipboard or some convenient data format (* .txt, * .csv). Adding the table of the area list to a drawing. For more information visit the official website of the AreaTester app.

    6,855 downloads

       (7 reviews)

    0 comments

    Updated

  10. mcr.lsp & mcrot+osnap

    This file is another version of MOCORO command... This one is what I am using from long time ago and it's my favorite from my library...
    Play if you find time with this one to find out what can be able to produce... It is simple when you get used to it and you can easily fall in love with this one...
     
    Dedicated topic :
    https://www.theswamp.org/index.php?topic=40547.msg481693#msg481693
    https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-to-modify-code-quot-rotate-block-for-preview-prior/m-p/12785679/highlight/true#M466304

    6,123 downloads

       (0 reviews)

    0 comments

    Updated

  11. dd.lsp dw.lsp ww.lsp

    Here you can find simple ways to create door, windowed door and windows in floor plans if you are in process of inserting those during drawing plans of house(s)...
    Link is here and codes are posted in code tags : https://www.cadtutor.net/forum/topic/78637-block-points/
     
    I hope it may prove useful,
    HTH.
    Regards, M.R.

    1,723 downloads

       (0 reviews)

    0 comments

    Updated

  12. LC.lsp AC.lsp VC.lsp

    Small but effective lisp routines for insertion of tabelar presentation of lengths (LC.lsp), areas (AC.lsp) or volumes (VC.lsp) with unit conversions... Tables can use FIELDs as presentation of values...
    It could be useful but also comperable with already posted Lengths variant of master Lee Mac...
    Anyway here there are for fresh new usage...
    HTH.
    M.R.

    612 downloads

       (1 review)

    0 comments

    Updated

  13. AlignH.lsp AlignHM.lsp AlignB.lsp AlignBM.lsp

    Hi, it's me again...
    I've searched my library of codes and run into Gian Paolo Cattaneo's AlignHatch routine, and guess what : I've founded that I've updated it into 4 variants : AlignH.lsp ; AlignHM (multiple) ; AlignB ; AlignBM (multiple) ... AlignB stands for Align Block...
    So I've decided to share all 4 as I think that they could be useful like Gian explained with his animated *.gif files...
    Anyway, since it's already public - I mean original version, I've redefined all 4 of them to work and in BricsCAD as BricsCAD don't have (c:cal) function...
    That's all from me for today...
    I just hope no one won't bother or be mad at me for posting this beautiful routines at download section...
    Original link : https://www.cadtutor.net/forum/topic/41902-alignh-align-hatch-on-curved-path
    Regards, M.R.

    2,784 downloads

       (1 review)

    1 comment

    Updated

  14. Trace linear-curve pipe trees (by lengths or by branchings)

    Hi, all
    It's me again...
    I'd like to share these 2 routines for linear tree branching... One is for picking start point and branching is performed all to the ends of all linear-curve entities and second one - you enter desired distance and branching is performed from start-picked point to desired lengths... All routines should operate on any type of linear-curve entities : POLYLINE(open), LWPOLYLINE(open), LINE, SPLINE(open), ELLIPSE(arc), ARC, HELIX...
    https://www.cadtutor.net/forum/topic/75840-trace-specify-length-on-pipe-network/?do=findComment&comment=600231
    https://www.cadtutor.net/forum/topic/76008-auto-route-and-show-lenght-all-branch-of-tree-line/?do=findComment&comment=601097
    That's all from me till now...
    Regards and take care, M.R.

    1,330 downloads

       (0 reviews)

    0 comments

    Submitted

  15. snake-LM.lsp

    This small *.lsp file is novelty program designed to attract user...
    It was posted long time ago here : https://www.cadtutor.net/forum/topic/54093-novelty-lisp-program
     
    But my intervernition is allowing it to work and on BricsCAD...
    Original Lee Mac's version was tested on AutoCAD before BricsCAD gained popularity, and now little snake works on both platforms...
     
    Regards, M.R.

    621 downloads

       (0 reviews)

    0 comments

    Updated

  16. DrawIt.lsp

    This novelty routine was written by @fuccaro and represent capeabilities of multiple various caledioscope curve creations...
    All valuable info you can find at this link : https://www.cadtutor.net/forum/topic/64130-drawing-machine
     
    I hope that you'll enjoy this one too, like snake by Lee Mac...
     
    Regards, M.R.

    964 downloads

       (0 reviews)

    0 comments

    Updated

  17. Align To Direction

    Are you someone who likes to get details in your drawings done neatly? Then look no further! Here I present you a program that does just that.
     
    This program aligns selected objects to any direction the user wants to align them to. This provides that the objects possess at least one of the following properties:
     
    Insertion Point Text Position Text Alignment Position Center  
    Upon issuing the command ATD, the user will be prompted a selection of objects without any filters, which the program will then filter based on the above (and xrefs excluded). The objects to be aligned will then be highlighted, and the user will be prompted a direction relative to the UCS. This can be in one of five ways:
     
    Clicking two points to determine direction Typing "X" - to align direction to X axis of UCS. Typing "Y" - to align direction to Y axis of UCS. Typing "PErpendicularToCurve" - the user specifies a point on any curve, and if a curve is detected, aligns perpendicular to the curve at that point. Typing "ALongCurve" - the user specifies a point on any curve, and if a curve is detected, aligns at the direction of the curve at that point Curve detection is compatible within all sorts of complex objects, such as nested blocks (with dynamic properties), xrefs, tables, dimensions, etc. regardless of depth, and fully functional under all UCS.  
    Following this, the user can then specify an optional distance that would be used to align the objects, or choose the "Through" option. This makes up an exactly identical feature to the built-in AutoCAD OFFSET command. If a distance is specified, the user will also be specified a point that will be used to calculate the specified distance away from the point.
     
    If "Through" is chosen, the user will then be prompted the point to place the objects. If the distance has been chosen and specified, the user can click on the side that the user wishes to place the objects at that distance from the point.
     
    Objects that I've successfully worked with this program include:
     
    Tables Blocks OLE/Raster images Dimensions Texts and MTexts (regardless of alignment) Circles  
    This program will work under any UCS settings provided that the objects to be translated lies in the same XY plane as the UCS. 

    2,321 downloads

       (0 reviews)

    0 comments

    Updated

  18. Block Overkill

    Here I give you guys a program that will either delete duplicate blocks or move them to a user-input layer that could be accidentally placed on top of another.
    The determination to do such program in place of the OVERKILL command is to remove unwanted dynamic blocks with different visibility parameters, leading to blocks having an "undefined name". This leads to the original OVERKILL command to fail. As such, I introduce you this program that catches all types of blocks (excluding xrefs).
     
    Be careful that it delete blocks matching all the criteria below:
     
     The blocks in comparison share the same insertion point through a given tolerance. The blocks in comparison share the same effective name. The blocks in comparison share the same effective scale.  
    So if the three criteria above match while the rotation of the blocks differ, it will still be deleted.
     
    I've had many occasion on using block counting routines that reports excessive values for this very reason. This routine has helped me fix those nasty errors that would otherwise be almost, if not entirely, impossible to detect with the human eye. As thanks for helping me solve many problems that I've posted in the LISP forum, this is the least I can offer, so I hope it's of some use.
     
    More details on this forum.
     
    Type BOVERKILL to start command.
     
    I welcome all suggestion, feedbacks, comments, and criticisms you have. Feel free to add your ideas, and I will try to improve them.
     
    Enjoy.
     
     

    3,704 downloads

       (0 reviews)

    0 comments

    Updated

  19. Label pline intersected point

    This lisp label block intersect point between plines.

    Date create: February 2020
     
    Lisp start with command: Int
    .
     At line 103 change try2 with your block name
    The lisp work only with plines,
    1.Select pline
    2.Write which letter is the line
    3.When you are ready pres ENTER
    4.Select line
    5.Write which number is the line
    6.When you are ready pres ENTER
     

    1,263 downloads

       (1 review)

    4 comments

    Updated

  20. Import point file with N X Y Z D

    This lisp import point from txt file with № X Y and if have (H and D).
    In the lisp can add records and delete records.
    command: PointIn

    1,496 downloads

       (0 reviews)

    0 comments

    Updated

  21. Date Picker

    It's been quite a while since I put up something up here, so I thought I might as well share something that could potentially be useless hours of my work, but a bit useful (hopefully). This could potentially be somewhere already that I could not find, but I'll post it here anyways.
     
    This program would not have been possible had it not been for the function LM:GrText, therefore huge credits to Lee Mac for his amazing function to assist with this program.
     
    For you programmers who mainly deal with dates, here's a subfunction that uses a dialog box to visualize a calendar for the selection of a specific date. Call the function JH:DatePicker to start the function. The function takes in three arguments, which could all be nil for defaults, or the following below:
     
    The first argument takes in a string that represents the title of the dialog box to display. Supplying nil or a blank string will use "Date Picker" by default on the title. The second argument takes in a list of three integers, representing the year, month, and day respectively to highlight on initializing the dialog. Supplying nil will highlight the current date by default. The third argument takes in a function to only allow specific dates in the calendar for selection and disable others. Supplying nil will enable all dates for selection. If a function is supplied, it should comply with the following. The function should take in three integers: the year, month, and day respectively. If the function returns nil, those dates in the calendar will be disabled for selection. If the function returns a non-nil value, those dates in the calendar will be enabled for selection.  
    In the end, the function shall return a list of three integers, in the form of year, month, and day.
     

    421 downloads

       (0 reviews)

    0 comments

    Submitted

  22. Table to excel.lsp

    This is a simple answer to export a Autocad/Bricscad table to excel, it expects a Title line as 1st line, then data etc . Simply pick the table excel will open and be auto filled, you can save then to what ever name required. Can be used as a library file just (load " Table to excel") as it will run automatically.

    955 downloads

       (1 review)

    0 comments

    Submitted

  23. Multi Radio Buttons.lsp

    This is a dynamic dcl creator for radio button choices, a good replacement for Initget, you just make a list of the button labels, it can be vertical or horizontal. You can use the returned value or the button number for user choice.
     
    Examples are in the top of the code, any questions info@alanh.com.au

    774 downloads

       (0 reviews)

    0 comments

    Submitted

  24. Attribute Block Finder

    Have you ever wished that you had a Quick Select tool to find blocks by their attribute tags/values? Well, here you have it.
     
    This LISP routine mimics the Quick Select behavior for the selection of the blocks. Upon issuing the command ABF, the user will be prompted a dialog for criteria inputs. The user can specify the tag/value names and add it to the list for selection. This way, the program can identify whether all the item should match the searching criteria or any one match for the block to be selected.
     
    The searching criteria offers case-sensitivity, wildcard match, and patterns that Microsoft Office offers: equals, begins with, ends with, and contains. This can be set for tags and values alike. 
     
    Should you have any ideas, comments, and criticisms, leave them down in the comments below as I look forward to improving my codes/routines. Enjoy!

    1,601 downloads

       (0 reviews)

    0 comments

    Updated

  25. Text Operation

    Hi guys,
     
    Here I present a program that allows you to perform a mathematical operation between a list of numbers parsed from a string, and a user-input number. This program references two different other LISP authors (Lee Mac with "Parse Numbers" and Alan H with "MultipleToggles.lsp") for their great contribution to the community, and I thought it'd be splendid to see how their programs blossom very well in this program. However, I tweaked both functions slightly in order to suit the needs of this program.
     
    Upon invoking the TOP command, the user is prompted for a single object selection. It can be anything that has an editable Text property (except blocks). Using Lee's Parse Numbers, it parses numbers found within that string. These list of numbers are then passed onto the MultipleToggles.lsp dialog by Alan H to prompt for the numbers the user wishes to include for calculation. This process is repeated until the user is satisfied and presses Enter or types "End".
     
    The user is then prompted the operation to perform. I've included 7 operations (built-in AutoLISP functions): Add (+), Subtract (-), Multiply (*), Divide (/), Exponential (expt), Minimum (min), and Maximum (max). After the user selects the logical operation to perform, the user is then prompted for a second number associated with this operation. The program will proceed to evaluate every number that is checked and performs the operation. The original object will then be modified with the new result.
     
    If you are familiar with how to use AutoLISP and defining functions, you can create your own user-defined functions to perform your own logical operation. For example, you can replace the numbers with another, or round down the numbers to some multiple.
     
    I welcome all feedback, criticisms, opinions, and insults that you have and I'll have a look at them. Enjoy.

    562 downloads

       (0 reviews)

    0 comments

    Submitted


×
×
  • Create New...