Sathya narayanan Posted August 7, 2019 Share Posted August 7, 2019 Can any body convert the below lisp which is in decimal feet system format which i require to be in metric system...? The below lisp works for Imperial cad template file well, but I require to function in a Metric template. I want a lisp to convert an elevation text (ex: El. 245.00) to El. 255.00 when I apply this command and move a relative distance of 10 m....? Hope I explained clearly... this would be very useful to me... (Defun c:BT() (Setq sst(ssget) sset(ssget "p" '((0 . "text"))) tv (cdr(Assoc 1 (Entget(ssname sset 0))))) (command "move" sst "" "@" "@") (setq lset (ssget "p" '((0 . "line")))) (Setq st 1) (while (= 0.0 (ATOF (substr tv st 1))) (Setq st (+ 1 st))) (Setq et 1) (while (/= "\"" (substr tv et 1)) (Setq et (+ 1 et))) (setq str(distof (substr tv st (- et st)))) (command "copy" sset "" (setq a (getpoint "\n Specify the source point: ")) (Setq b(getpoint "\n Specify the Desitnation point: " a))) (if (< (- (cadr a )(cadr b)) 0) (command "change" (entlast) "" "" "" "" "" "" (strcat "EL. "(rtos (+ str (- (cadr B )(cadr A)))4 2)"")) (command "change" (entlast) "" "" "" "" "" "" (strcat "EL. "(rtos (+ str (- (cadr B )(cadr A)))4 2)""))) (command "Copy" lset "" a b) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 7, 2019 Share Posted August 7, 2019 Replace 4 with 2 and try again. 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.