Offset Delete

Discussion in 'AutoCAD' started by Casey, Jul 14, 2004.

  1. Casey

    Casey Guest

    Does anyone have a routine that will offset an object using the offset
    command and then delete the original object?

    A simple one I may be able to muster up but I'd prefer one that uses the
    offset command so I can continue offsetting until I right click or end the
    offset command.

    Thanks,

    Casey
     
    Casey, Jul 14, 2004
    #1
  2. Casey

    Tom Smith Guest

    Does anyone have a routine that will offset an object using the offset
    Here's an oldie of mine:

    ;OE.LSP

    ;OFFSET AND ERASE:

    (defun c:OE(/ oce f m1 d s o m2 e p)
    (setq oce (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (command "undo" "group")

    (princ" OFFSET & ERASE")
    (setq
    f t
    m1"\nOffset distance or Through"
    d(getvar"offsetdist")
    s(strcat m1
    " <"
    (if(< d 0)
    "Through"
    (rtos d))
    ">: ")
    o(initget 6"T")
    o(if(setq o(getdist s))
    o
    (if(< d 0)
    "T"
    d))
    d(if(="T"o)
    -1
    o)
    m2(if(< d 0)
    "\nThrough point: "
    "\nSide to offset? "))
    (setvar"offsetdist"d)
    (while f
    (if(setq e(entsel"\nSelect object to offset: "))
    (progn
    (redraw(car e)3)
    (setq p(getpoint m2))
    (redraw(car e)4)
    (if p
    (progn
    (command"offset"o e p"")
    (entdel(car e)))
    (setq f nil))
    (setq e nil))
    (setq f nil)))

    (command "undo" "end")
    (setvar "cmdecho" oce)
    (princ)
    )

    (princ)
     
    Tom Smith, Jul 14, 2004
    #2
  3. Or, for a simpler approach:

    [Offs,Erase]*^C^COFFSET \(setq old (entsel "Select item to Offset & Erase:
    ")) \\ ERASE !old ;

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Jul 14, 2004
    #3
  4. Casey

    Casey Guest

    Hey thanks, does what it needs to.



     
    Casey, Jul 14, 2004
    #4
  5. Casey there is mine. Choose whichever works best for you.
    John

    (defun c:eek:e (/ obj ofs)
    (setq obj (entsel "\nSelect object to offset: "))
    (setq ofs (getstring "Offset Distance: "))
    (princ "Click in the direction of offset.")
    (command ".offset" ofs obj pause "")
    (command ".erase" obj "")
    (princ "Done!")
    (princ)
    )
     
    John Georgiev, Jul 14, 2004
    #5
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.