Lisp to Give RL to contour

Discussion in 'AutoCAD' started by Daniel Blake, Jul 27, 2004.

  1. Daniel Blake

    Daniel Blake Guest

    I am after a small lisp routine that I can use
    to give a selected RL to a contour polyline. (Using the move command will
    do)

    So if I type GRL
    it should ask for a RL ie - 10
    and then ask for objects to move to the selected RL.

    Does anyone have such a Lisp ??

    Regards
    DB.
     
    Daniel Blake, Jul 27, 2004
    #1
  2. Daniel Blake

    David Kozina Guest

    Take it easy on the acronyms, bud. :)
     
    David Kozina, Jul 27, 2004
    #2
  3. Daniel Blake

    dblaha Guest

    RL = Refrigerated Lager?
     
    dblaha, Jul 27, 2004
    #3
  4. <mmmm> Lager...
     
    R. Robert Bell, Jul 27, 2004
    #4
  5. Daniel Blake

    scuba Guest

    what the hell does he want?
     
    scuba, Jul 27, 2004
    #5
  6. He wants the RL to combibniate with the GRible which we all know is
    tifpancitic with the garblefrabble.
     
    R. Robert Bell, Jul 27, 2004
    #6
  7. Daniel Blake

    dblaha Guest

    No problem:

    (defun GRL ()
    (if (= RL "Refrigerated Lager")
    (while (setq contour (list garblefrabble tifpan nil nil))
    (if combib (setq RL (cons RL GRible)))
    )
    (princ "I'm still thirsty...")
    )
    (princ)
    )
     
    dblaha, Jul 27, 2004
    #7
  8. Hi,

    Love this.

    Just for the record RL = Reduced Level in Survey/Civil Engineering terms.
    Equivalent to Elevation or Z in AutoCAD terms.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Jul 27, 2004
    #8
  9. Daniel Blake

    Daniel Blake Guest

    Sorry guys - doesn't everyone do civil drawings.

    RL - yes reduced level
    GRL - Give Reduced Level - Could be anything just a shotcut label.

    So in summary I want to move a selected polyline to a fixed
    elevation. I get sick of typing move from 0,0,0 to 0,0,10 for example.

    Cheers - thinking about lager now too.
    DB
     
    Daniel Blake, Jul 28, 2004
    #9
  10. Daniel Blake

    Mark Propst Guest

    while reducing the level of lager in my container I burped up the following
    Not elegant or fancy, but does what you described.

    (Defun C:RL( / newElev ssRL i vo)
    ;Give Reduced Level - if that's really what you call it.

    (Setq newElev(GetReal"\nElevation: "))
    (if newelev
    (progn
    (prompt"\nSelect contours")
    ;you said you wanted polylines - adapt filter for other entities
    (Setq ssRL(ssget'((0 . "LWPOLYLINE"))))
    (if ssrl
    (progn
    (setq i 0)
    (Repeat(sslength ssRL)
    (setq vo(Vlax-ename->vla-object(ssname ssRL i)))
    (vlax-put-property vo 'elevation newelev)
    (setq i(1+ i))
    );repeat
    )
    )
    )
    );if
    );def
     
    Mark Propst, Jul 28, 2004
    #10
  11. Please feel free to modify for your needs....

    (defun C:ReduceLevel ()
    (setvar "cmdecho" 0)
    (while (setq ES (entsel "\nSelect Contour Line or Beer Can ? "))
    (setq EG (entget (car ES)))
    (if (member (cdr (assoc 0 EG)) (list "LWPOLYLINE" "CANOFBEER"))
    (progn
    (setq ZZ (cdr (assoc 38 EG)))
    (princ (strcat "\nCurrent Reduced Level = " (rtos ZZ 2 4)))
    (setq NZZ (getreal "\nInput New Reduced Level ? "))
    (command "_move" (cdr (assoc -1 EG)) "" (list 0 0 ZZ) (list 0 0 NZZ))
    (if (< NZZ ZZ)
    (princ (strcat "\nYou have reduced the level by = " (rtos (- NZZ ZZ) 2
    4)))
    (princ (strcat "\nCongratulations... You have increased the level by =
    " (rtos (- ZZ NZZ) 2 4)))
    )
    )
    )
    )
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Jul 28, 2004
    #11
  12. Daniel Blake

    DB Guest

    Thank you all
     
    DB, Jul 28, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.