Results 1 to 7 of 7

Thread: Quick English-Metric Conversion

  1. #1
    Matthew Kuehl Guest

    Quick English-Metric Conversion

    Hi.
    I need to convert a bunch of spot elevations in a survey from english to metric. Does anybody have a quick lisp routine or other command that might do this?
    Thanks,
    Matthew Kuehl

  2. #2
    Matthew Kuehl Guest
    Wow! Check out what I found...

    ********TeXt Math********
    (defun c:txm ( / texts func xx n text textentget textent oldtext textreal result
    newtext)
    (princ "\nSelect texts you want to operate mathematically upon:")
    (setq texts (ssget))
    (princ "\nWhat function do you wish to
    apply<Add,Subtract,Multiply,Divide,sQuare,Root>?")
    (setq func (strcase (getstring)))
    (cond
    ((= func "A")
    (princ "\nAdd what number:")
    (setq xx (getreal))
    )
    ((= func "S")
    (princ "\nSubtract what number:")
    (setq xx (getreal))
    )
    ((= func "M")
    (princ "\nMultiply by what number:")
    (setq xx (getreal))
    )
    ((= func "D")
    (princ "\nDivide by what number:")
    (setq xx (getreal))
    )
    )
    (setq n 0)
    (while
    (setq text (ssname texts n))
    (setq textentget (entget text))
    (setq textent (assoc 1 textentget))
    (setq oldtext (cdr textent))
    (setq textreal (atof oldtext))
    (cond
    ((= func "A")
    (setq result (+ textreal xx))
    )
    ((= func "S")
    (setq result (- textreal xx))
    )
    ((= func "M")
    (setq result (* textreal xx))
    )
    ((= func "D")
    (setq result (/ textreal xx))
    )
    ((= func "Q")
    (setq result (* textreal textreal))
    )
    ((= func "R")
    (setq result (sqrt textreal))
    )
    )
    (setq newtext (rtos result 2 3))
    (setq textentget (subst (cons 1 newtext) textent textentget))
    (entmod textentget)
    (setq n (1+ n))
    )
    (princ)
    )
    ;********TeXt Math********

    Enjoy!
    Matthew Kuehl

  3. #3
    Jerry Guest
    What does that have to do with metric conversion?

    Matthew Kuehl <nospam@address.withheld> wrote in message
    news:13829825.1100020357517.JavaMail.jive@jiveforu m1.autodesk.com...
    Wow! Check out what I found...

    ********TeXt Math********
    (defun c:txm ( / texts func xx n text textentget textent oldtext textreal
    result
    newtext)
    (princ "\nSelect texts you want to operate mathematically upon:")
    (setq texts (ssget))
    (princ "\nWhat function do you wish to
    apply<Add,Subtract,Multiply,Divide,sQuare,Root>?")
    (setq func (strcase (getstring)))
    (cond
    ((= func "A")
    (princ "\nAdd what number:")
    (setq xx (getreal))
    )
    ((= func "S")
    (princ "\nSubtract what number:")
    (setq xx (getreal))
    )
    ((= func "M")
    (princ "\nMultiply by what number:")
    (setq xx (getreal))
    )
    ((= func "D")
    (princ "\nDivide by what number:")
    (setq xx (getreal))
    )
    )
    (setq n 0)
    (while
    (setq text (ssname texts n))
    (setq textentget (entget text))
    (setq textent (assoc 1 textentget))
    (setq oldtext (cdr textent))
    (setq textreal (atof oldtext))
    (cond
    ((= func "A")
    (setq result (+ textreal xx))
    )
    ((= func "S")
    (setq result (- textreal xx))
    )
    ((= func "M")
    (setq result (* textreal xx))
    )
    ((= func "D")
    (setq result (/ textreal xx))
    )
    ((= func "Q")
    (setq result (* textreal textreal))
    )
    ((= func "R")
    (setq result (sqrt textreal))
    )
    )
    (setq newtext (rtos result 2 3))
    (setq textentget (subst (cons 1 newtext) textent textentget))
    (entmod textentget)
    (setq n (1+ n))
    )
    (princ)
    )
    ;********TeXt Math********

    Enjoy!
    Matthew Kuehl

  4. #4
    Huw Guest
    The elevations are probably in whole feet, so it's a simple mathematical conversion for him.

    Jerry wrote:
    What does that have to do with metric conversion?

    Matthew Kuehl <nospam@address.withheld> wrote in message
    news:13829825.1100020357517.JavaMail.jive@jiveforu m1.autodesk.com...
    Wow! Check out what I found...

  5. #5
    Matthew Kuehl Guest
    Actually, it turns out that one doesn't work so well. Any other ideas? Thanks,
    Matt

  6. #6
    Brad Yarger Guest
    What format are your spot elevations in? Is it a 2D CAD file? Are they
    survey points in a txt or CSV format? If they are in 3D CAD, all you would
    have to do is scale them.

    If you have Land Desktop, export your points. Bring them into Excel, insert
    columns between the northings, eastings and elevations. Multiply the
    northings, eastings and elevations by the conversion factor in the new
    columns, and then save them back as a txt or csv. Close the file and then
    reopen so that you are working with the saved txt or csv. Delete the
    English value columns. Save again as a txt or csv file. Erase all the
    points you have modified from your original Land Desktop file. Import the
    updated points.

    --
    Brad Yarger

    "Matthew Kuehl" <nospam@address.withheld> wrote in message
    news:10907629.1100019051509.JavaMail.jive@jiveforu m1.autodesk.com...
    Hi.
    I need to convert a bunch of spot elevations in a survey from english to
    metric. Does anybody have a quick lisp routine or other command that might
    do this?
    Thanks,
    Matthew Kuehl

  7. #7
    lsaapedd Guest
    Search the help for cvunit. It may help.

Similar Threads

  1. JOB: Bilingual (English/Mandarin) AutoCAD Drawer, Queens, NY
    By Superior Staffing Solutio in forum AutoCAD
    Replies: 1
    Last Post: 11-18-2005, 01:10 AM
  2. how do you change a drawing from metric to English
    By Clark Bowdry in forum Drafting
    Replies: 1
    Last Post: 06-29-2005, 10:09 AM
  3. Replies: 0
    Last Post: 06-27-2005, 03:00 PM
  4. [OT] Technical words in english
    By frankyz in forum AutoCAD
    Replies: 1
    Last Post: 02-27-2005, 02:00 AM
  5. Metric Piping
    By mr.T in forum SolidWorks
    Replies: 2
    Last Post: 02-20-2005, 02:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum