datalife Posted January 28, 2013 Share Posted January 28, 2013 Hello, I have tons survey points of text drawn which is in imperial (ft). I need to change it to metric (m). Is there a lisp to change the text by "fence" the text and convert immediately to metric (m) in the screen. Thanks:) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 28, 2013 Share Posted January 28, 2013 Simple drawing might help a lot ( showing current and after ) Quote Link to comment Share on other sites More sharing options...
datalife Posted January 28, 2013 Author Share Posted January 28, 2013 Hello Tharwat..... Not quite understand your answer? Would be appreciate if a LISP can do the job in saving time Thanks Quote Link to comment Share on other sites More sharing options...
Dadgad Posted January 28, 2013 Share Posted January 28, 2013 It sounds to me like what you may actually want to do is change the -dwgunits of your drawing from whatever Imperial unit they are currently to your preferred metric unit of measure. I could be wrong, it would be helpful to see a sample .dwg file, as Tharwat suggested. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 28, 2013 Share Posted January 28, 2013 Hello Tharwat.....Not quite understand your answer? Would Just upload a sample drawing as you have did in the other posts . Quote Link to comment Share on other sites More sharing options...
pBe Posted January 28, 2013 Share Posted January 28, 2013 perhaps this (defun _I2M (str m d) (if (distof str) (rtos (* (distof str) (* 0.0254 (if m 1000 1)) ) 2 (if m 0 d)) ) ) T for Milimeters (_i2m "6'-11\"" t 2) "2108" nil for meters 2 Decimals places (_i2m "6'-11\"" nil 2) "2.11" (_i2m "6'-11\"" nil 4) "2.1082" HTH Quote Link to comment Share on other sites More sharing options...
datalife Posted January 28, 2013 Author Share Posted January 28, 2013 Hello all, I have received this drawings from surveyor which the text show the survey points in imperial (ie in feet) units. I extract part of the drawing; as mentioned earlier; I wish to have a lisp that "fence" the text and replace the text in metric (ie in meter) units Thanks imperial.dwg Quote Link to comment Share on other sites More sharing options...
Dadgad Posted January 28, 2013 Share Posted January 28, 2013 I checked the drawing units of your drawing and they are meters, so that looks appropriate. It look like Lee Mac's http://www.lee-mac.com/textcalculator.html lisp may be able to do this. I've never noticed this one before amidst all of Lee's other shareware gems on his site, but I figured I would be remiss if I didn't take a look. Thanks Lee! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 28, 2013 Share Posted January 28, 2013 This may work .... (defun c:f2m (/ ss) (if (setq ss (ssget "_:L" '((0 . "*TEXT")))) ((lambda (i / sn st e) (while (setq sn (ssname ss (setq i (1+ i)))) (if (numberp (setq st (read (cdr (assoc 1 (setq e (entget sn))))))) (entmod (subst (cons 1 (rtos (* 0.3048 st) 2 2)) (assoc 1 e) e)) ) ) ) -1 ) (princ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
datalife Posted January 28, 2013 Author Share Posted January 28, 2013 Thanks Tharwat.......it works. Wonderful Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 28, 2013 Share Posted January 28, 2013 Thanks Tharwat.......it works.Wonderful You're welcome any time . Quote Link to comment Share on other sites More sharing options...
irneb Posted January 29, 2013 Share Posted January 29, 2013 Just be careful of using "magic" numbers. Probably not much of an issue here, but I tend to use the cvunit function just since it's easier to understand the code's purpose and thus modify later if the units are different: http://www.theswamp.org/index.php?topic=41407.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.