Metric line

Discussion in 'AutoCAD' started by jmckinnon, May 14, 2004.

  1. jmckinnon

    jmckinnon Guest

    I would like a LISP that would draw a line at a imperial length, but request it in a metric value.
    eg. enter 12.1 (meters) and the line would be 39.7 feet long and
    would allow direct distance entry with rubber banding.
     
    jmckinnon, May 14, 2004
    #1
  2. jmckinnon

    OLD-CADaver Guest

    Okay you need to look for a couple of lisp functions. Look in Developer Help for:
    (setq
    (getpoint
    (getdist
    (*
    (command
     
    OLD-CADaver, May 14, 2004
    #2
  3. jmckinnon

    Rudy Tovar Guest

    (defun c:MD (/ p1 p2 d a)
    (setq p1 (getpoint "\nPick Start: "))
    (if p1
    (progn
    (setq p2 (getpoint p1 "\nStretch Direction and [E]nter distance: "))
    (if p2
    (progn
    (setq d (* (distance p1 p2) 25.4)
    a (angle p1 p2)
    )
    (setq p2 (polar p1 a d))
    (entmake (list (cons 0 "LINE")(cons 10 p1)(cons 11 p2)))
    )
    )
    )
    )
    (princ)
    )
    --

    AUTODESK
    Authorized Developer
    http://www.Cadentity.com
    MASi
     
    Rudy Tovar, May 14, 2004
    #3
  4. jmckinnon

    jmckinnon Guest

    Thank you!
    To do the conversion from meters to inches we need to change 25.4 to 39.37007 I believe.
    Just what the doctor order.
     
    jmckinnon, May 14, 2004
    #4
  5. jmckinnon

    Rudy Tovar Guest

    I was using MM.
     
    Rudy Tovar, May 14, 2004
    #5
  6. jmckinnon

    jmckinnon Guest

    I'am new to discussion groups.
    Your input is very helpful.
    I would request one more LISP if you have time.
    How about doing OFFSET in the same manner?
     
    jmckinnon, May 14, 2004
    #6
  7. jmckinnon

    Rudy Tovar Guest

    Thanks for trying 'J', but take a stab at it, and we'll assist.

    We really want you to learn...
     
    Rudy Tovar, May 14, 2004
    #7
  8. jmckinnon

    jmckinnon Guest

    BEST I CAN DO.

    ;Metric dimension to imperial offset
    (defun c:m2io()
    (setq obj1 (get "\nPick Object: "))
    (if obj1(progn
    (setq Val (getval "\n[E]nter offset amount in meters: "))
    (if Val
    (progn
    )
    (setq p2 (polar p1 a d))
    (entmake (list (cons 0 "Offset")(cons 10 p1)(cons 11 p2)))
    )
    )
    )
    )
    (princ)
    )
     
    jmckinnon, May 15, 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.