AutoCad LISP Repository

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #162887
    Jon Quackenbush

    I thought that this could be a good discussion to have on here.  List your favorite and most handy LISP’s here.



    ;; ============ PolyMatch.lsp ===============
    ;; FUNCTION:
    ;; Will match the Elevation, layer, colour
    ;; Linetype, linetype scale, and lineweight
    ;; of a selected Polyline to every Polyline
    ;; in a selection set.
    ;; (Will unlock any locked layers)
    ;; SYNTAX: pmtch
    ;; AUTHOR:
    ;; Copyright (c) 2009, Lee McDonnell
    ;; (Contact Lee Mac,
    ;; No Restrictions,
    ;; only tested in ACAD 2004.
    ;; VERSION:
    ;; 1.0 ~ 14.04.2009
    ;; ====================================

    (defun c:pmtch (/ ent cObj lay col lt lts lw el ss)
    (if (and (setq ent (car (entsel "nSelect Polyline to Match: ")))
    (eq "AcDbPolyline" (vla-get-ObjectName
    (setq cObj (vlax-ename->vla-object ent)))))
    (setq lay (vla-get-layer cObj)
    col (vla-get-color cObj)
    lt (vla-get-linetype cObj)
    lts (vla-get-linetypescale cObj)
    lw (vla-get-lineweight cObj)
    el (vla-get-Elevation cObj))
    (if (setq ss (ssget (list (cons 0 "*POLYLINE")
    (if (getvar "CTAB")
    (cons 410 (getvar "CTAB"))
    (cons 67 (- 1 (getvar "TILEMODE")))))))
    (progn (vlax-for lay (vla-get-layers
    (vla-put-lock lay :vlax-false))
    (foreach Obj (mapcar 'vlax-ename->vla-object
    (vl-remove-if 'listp
    (mapcar 'cadr (ssnamex ss))))
    (vla-put-elevation Obj el)
    (vla-put-layer Obj lay)
    (vla-put-color Obj col)
    (vla-put-linetype Obj lt)
    (vla-put-linetypescale Obj lts)
    (vla-put-lineweight Obj lw)))
    (princ "n<!> No Polylines Selected <!>")))
    (princ "n<!> No Polyline Selected <!>"))
    Jon Quackenbush

    This will match the Elevation, layer, color, Linetype, linetype scale, and lineweight of a selected Polyline to every Polyline in a selection set.

    Jon Quackenbush

    Turns those old fashioned leaders into more convenient MLeaders

    Jason T. Radice

    Great topic. I could never get the match elevation thing to work….maybe this one will. Thanks!

    Jon Quackenbush

    It does, found it today after a long time of seraching… very handy so far.  I had a grading plan done by another firm that had no elevation information, so to manually go through and click every polyline and go to the properties dialogue was waaay too tedious.  Found this one and it works great.  I put an elevation on the first segment, and change the color to something else to keep track of my progress and plod away.  So much easier.

    Chris Markham, RLA

    Does anyone have a LISP for putting parking spaces on a curve?

    David Barbarash

    I tend to cheat in these situations and make a block out of a single parking space line, then use the MEASURE or DIVIDE command, select the edge of pavement line, specify the block to use and the spacing being sure to align to the source object. Then just select the lines the command created and explode them to return them to the polylines they should be.


    Many years ago I worked for a company that only used Microstation as our cad program.  I used a third party add on called Triforma for Landscape Architecture.  It was a great program.  Lots of similarities in its ease of use like Land FX, however it had a site planning component that allowed such crazy things as placing parking spaces on a curve with great accuracy.  I cannot believe there isn’t something out there that will do this. 


    What I do today works great.  Set your arc’d curve of your parking, then offset the depth of the the space (18′-0″).  Now create a circle with radius 9′-0″ (9′ stall width).  Determine the starting point of your first parking space then snap / copy a circle along the offset line every 9′.  Making sure the center of the circle intersects with the line and the next circle.  Once you have the circles along the curve in place then just simply snap to intersection of the circle and snap perpendicular to your original curve.  Your parking spaces will be accurately spaced. 



    Jason T. Radice

    I too recall seeing something like this years ago in another program I think was more civil based, but not in autocad. I generally draw a few lines at the measurement I want perpendicular to the curve, do a UCS align to the last space and mirror. Rinse…repeat. Because you are mirroring more spaces each time, you get exponentially faster. Faster than trying to figure out a divide or array which you will still have to mess with. I’m lazy and proud.


    Jon Quackenbush

    Curved parking.  Seems to work, but test it out.

    Run it with “a-p” at the command line.

    Tonie C.

    I haven’t tried this yet, but thanks Dennis and Jon for such specific info!

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Lost Password