Dimensioning the length of a curve

Discussion in 'AutoCAD' started by glenn.brown, Jun 30, 2004.

  1. glenn.brown

    glenn.brown Guest

    I'm after a lisp routine that will dimension the length of a curve. I want the routine to work like this; you select the curve (arc or polyline) select the two end points and then position of the dimension. I want the dimension line to be curved as well.

    Does anyone have one?

    Thanks
    Glenn
     
    glenn.brown, Jun 30, 2004
    #1
  2. glenn.brown

    C Witt Guest

    i've seen and used one just like that in 2K4.. though for the life of me
    i can't find the command in 2K5. not that that helps you much.
     
    C Witt, Jun 30, 2004
    #2
  3. glenn.brown

    shaw.n Guest

    DO YOU MEAN SOMETHING LIKE THIS?
    ^C^C_pedit;\;;_list;@;;_explode;last;_dimangular;@;t;$M=$(rtos,$(getvar,PERIMETER),2,$(getvar,dimdec));\

    ITS NOT A LISP ROUTINE THOUGH, ONLY A DIESEL MACRO.
    HOPE IT HELPS :)
     
    shaw.n, Jun 30, 2004
    #3
  4. I've never seen a core "arc-dim" command
    in plain AutoCAD.
     
    Jason Piercey, Jun 30, 2004
    #4
  5. glenn.brown

    C Witt Guest

    I admit my memory has a fuzz-factor, but i'm sure it was there..
     
    C Witt, Jun 30, 2004
    #5
  6. ; for Arc, PolylineArc (also nested in blocks) - NOT LwPolyline
    (defun C:ALE_DIMARC ( / arc_sel ent edata len_arc len_fac mtx)
    ;(setvar "OSMODE" 0)
    (while (null ent)
    (setq
    arc_sel (nentsel "\nSelect arc: ")
    ent (car arc_sel)
    len_fac 1
    )
    (cond
    ( (null ent) (prompt "\nNo object selected, retry.") )
    ( (/= (DXF 0 (setq edata (entget ent))) "ARC")
    (alert
    (strcat "Entity it is not an arc but: " (DXF 0 edata) " ")
    )
    (setq ent nil)
    )
    ( (and
    (= (length arc_sel) 4)
    (setq
    mtx (caddr arc_sel) arc_sel (cadr arc_sel)
    len_fac (nth 2 (caddr mtx))
    )
    (not (= (caar mtx) (cadadr mtx)))
    )
    (alert "\nNot valid, mirrored or not uniformly scaled block.")
    (setq ent nil)
    )
    (T
    (setq
    len_arc
    (*
    (DXF 40 edata)
    (if (minusp (setq len_arc (- (DXF 51 edata) (DXF 50 edata))))
    (+ pi pi len_arc) len_arc
    )
    )
    )
    (command "_.DIMANGULAR" arc_sel "_T" (rtos (* len_fac len_arc)))
    (while (= (logand (getvar "cmdactive") 1) 1) (command pause))
    )
    );cond
    );while
    (princ)
    )

    (defun DXF (code elist)
    (cdr (assoc code elist))
    )
     
    Marc'Antonio Alessi, Jul 1, 2004
    #6
  7. glenn.brown

    ajm Guest

    This works for me.

    Just set your dimension style first.
    Also you may have to play around with some variables below.

    ;|

    DIMARC.LSP - Dimension an arc with length, rather than angle
    (c) 1998 Tee Square Graphics

    |;

    (defun C:DA (/ arc ent obj l)

    (setq cmd (getvar "cmdecho")
    arc (entsel "\nPick ARC to dimension: ")
    ent (entget (car arc))
    obj (cdr (assoc 0 ent)))
    (if (= obj "ARC")
    (progn
    (setvar "cmdecho" 1)

    (setq dv1 (getvar "dimtih"))
    (setq dv2 (getvar "dimtoh"))
    (setq dv3 (getvar "dimse1"))
    (setq dv4 (getvar "dimse2"))
    (setq dv5 (getvar "dimexe"))
    (setq dv6 (getvar "dimexo"))
    (setvar "dimtih" 0)
    (setvar "dimtoh" 0)
    (setvar "dimse1" 0)
    (setvar "dimse2" 0)
    (setvar "dimexe" (* (getvar "ltscale") 0.05))
    (setvar "dimexo" (* (getvar "ltscale") 0.03))

    (setq l (* (cdr (assoc 40 ent))
    (if (minusp (setq l (- (cdr (assoc 51 ent))
    (cdr (assoc 50 ent)))))
    (+ pi pi l) l)))

    (command "_.dimangular" arc "_t" (strcat "ARC. " (rtos l 2 0)))

    (while (= (logand (getvar "cmdactive") 1) 1)
    (command pause))
    (setvar "cmdecho" cmd))
    (alert "Object selected is not an ARC."))

    (setvar "dimtih" dv1)
    (setvar "dimtoh" dv2)
    (setvar "dimse1" dv3)
    (setvar "dimse2" dv4)
    (setvar "dimexe" dv5)
    (setvar "dimexo" dv6)

    (princ)
    )
     
    ajm, Jul 1, 2004
    #7
  8. glenn.brown

    Kerry Brown Guest

    Perhaps this will suit you.
    http://www.cadvault.com/forums/showthread.php?t=2140

    .... also lets you choose dim points on the arc, and can use continuable
    dims.

    Regards.Kerry

    I'm after a lisp routine that will dimension the length of a curve. I
    want the routine to work like this; you select the curve (arc or
    polyline) select the two end points and then position of the dimension.
    I want the dimension line to be curved as well.

    Does anyone have one?

    Thanks
    Glenn
     
    Kerry Brown, Jul 1, 2004
    #8
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.