offset to layer

Discussion in 'AutoCAD' started by RikH, Jan 13, 2004.

  1. RikH

    RikH Guest

    There used to be a lisp routine around at one time that would allow you to
    offset to a specified layer and repeated until you were finished.
    Can anyone help?
    Thanks in advance..
    RikH
     
    RikH, Jan 13, 2004
    #1

  2. see below. (No idea who did it):

    (defun C:OFLY ()
    (setvar "cmdecho" 0)
    (initget 1)
    (setq wd (getdist "\nOffset Width : "))
    (setq ly (getvar "clayer") n 50)
    (while (> n 0)
    (setq a (entsel "\nSelect Entity to Offset :"))
    (setq ent (car a) pt (cadr a))
    (setq b (getpoint pt "\nOffset Direction : "))
    (command "OFFSET" wd pt b "")
    (setq c (entlast))
    (command "CHPROP" c "" "LA" ly "")
    (setq col (substr (getvar "cecolor") 1 2))
    (if (= col "BY") (command "CHPROP" "L" "" "C" "bylayer" "")
    (progn (setq col (atoi col))
    (command "CHPROP" "L" "" "C" col "")
    )
    )
    (setq n (1- n))
    )
    )
     
    Michael Bulatovich, Jan 13, 2004
    #2
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.