Quick English-Metric Conversion
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Quick English-Metric Conversion

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting
Author Message
Matthew Kuehl
Guest





Posted: Tue Nov 09, 2004 9:50 pm    Post subject: Quick English-Metric Conversion Reply with quote

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

Back to top
Matthew Kuehl
Guest





Posted: Tue Nov 09, 2004 10:12 pm    Post subject: Re: Quick English-Metric Conversion Reply with quote

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
Back to top
Jerry
Guest





Posted: Wed Nov 10, 2004 6:56 am    Post subject: Re: Quick English-Metric Conversion Reply with quote

What does that have to do with metric conversion?

Matthew Kuehl <nospam@address.withheld> wrote in message
news:13829825.1100020357517.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
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


Back to top
Huw
Guest





Posted: Wed Nov 10, 2004 12:09 pm    Post subject: Re: Quick English-Metric Conversion Reply with quote

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

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

Matthew Kuehl <nospam@address.withheld> wrote in message
news:13829825.1100020357517.JavaMail.jive@jiveforum1.autodesk.com...
Wow! Check out what I found...
Back to top
Matthew Kuehl
Guest





Posted: Wed Nov 10, 2004 8:32 pm    Post subject: Re: Quick English-Metric Conversion Reply with quote

Actually, it turns out that one doesn't work so well. Any other ideas? Thanks,
Matt
Back to top
Brad Yarger
Guest





Posted: Thu Nov 11, 2004 8:08 pm    Post subject: Re: Quick English-Metric Conversion Reply with quote

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@jiveforum1.autodesk.com...
Quote:
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?
Quote:
Thanks,
Matthew Kuehl
Back to top
lsaapedd
Guest





Posted: Fri Nov 12, 2004 4:09 am    Post subject: Re: Quick English-Metric Conversion Reply with quote

Search the help for cvunit. It may help.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB