Offset from an arc

Discussion in 'AutoCAD' started by dth, Oct 29, 2004.

  1. dth

    dth Guest

    I am trying to write a routine that draws a line offset 3" from an arc and I
    am not sure where to start. I know that for a line you can do:

    (setq a (angle pt1 pt2 pt3)
    pt11 (polar pt1 (+ a (dtr 90)) -3)
    pt12 (polar pt2 (+ a (dtr 90)) -3)
    pt13 (polar pt3 (+ a (dtr 90)) -3)
    )

    How would I accomplish the same thing on the curve after having the user
    pick the three points on the arc?
     
    dth, Oct 29, 2004
    #1
  2. dth

    dth Guest

    Never mind ... found a work around (unless there is a better way)

    (setq pt1 (getpoint "\nPick first point..."))
    (if pt1 (setq pt2 (getpoint "\nPick point on curve...")))
    (if pt2 (setq pt3 (getpoint "\nPick end point...")))
    (command "arc" pt1 pt2 pt3 ))
    (setq $arc (ssget "l"))
    (setq $arcp (getpoint "\nPick side of curve to hatch..."))
    (command "offset" "3" $arc $arcp "")
    (command "erase" $arc "")
     
    dth, Oct 30, 2004
    #2
  3. dth

    CAB2k Guest

    Here are two way it can be done.
    (defun c:arcoffset (/ useros pt1 pt2 pt3 vobj)
    (setq useros (getvar "osmode"))
    (setvar "osmode" 0)
    (if (and (setq pt1 (getpoint "\nPick first point..."))
    (setq pt2 (getpoint "\nPick point on curve..."))
    (setq pt3 (getpoint "\nPick end point..."))
    )
    (progn
    (command "arc" pt1 pt2 pt3)
    (setq vobj (vlax-ename->vla-object (entlast)))
    (vlax-invoke vobj 'offset 3)
    (vlax-invoke vobj 'delete)
    )
    )
    (setvar "osmode" 0)
    (princ)
    )

    (defun c:arcoffset2 (/ useros vobj entold entnew)
    (setq useros (getvar "osmode")
    entold (entlast))
    (setvar "osmode" 0)
    (command "arc" pause pause pause)
    (if (not (eq entold (setq entnew (entlast))))
    (progn
    (setq vobj (vlax-ename->vla-object entnew))
    (vlax-invoke vobj 'offset 3)
    (vlax-invoke vobj 'delete)
    )
    )
    (setvar "osmode" 0)
    (princ)
    )
     
    CAB2k, Oct 30, 2004
    #3
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.