sanju2323 Posted March 10, 2014 Posted March 10, 2014 I want Required lisp Selected Text As Chainage Format Example. 100.00 Required 0+100.00 or See Attachment Image Quote
BIGAL Posted March 10, 2014 Posted March 10, 2014 Good time to learn lisp rather than relying on every one else to give up their time. Anyway you can change the text using entmod or a vlisp put you also need to just check the first character if 0 use the Substr function. Here in Aus we would accept 01234.456 as a chainage. Here something though to get you started. ;Adds a fixed amount to a number (Alert "TO USE JUST TYPE A2LM") (DEFUN c:A2LM () (setvar "cmdecho" 1) (setq olddimzin (getvar "Dimzin")) (setvar "dimzin" 0) (setq v2 (getreal "\nEnter ht adjustment ")) (setq ss (ssget (list (cons 0 "Text")))) (setq len (sslength ss)) (setq x 0) (repeat len (setq en1 (ssname ss x)) (setq el1 (entget en1)) (setq v1 (atof (cdr (assoc 1 el1)))) (setq a (+ v1 v2)) (setq b (rtos a 2 3)) (setq el (subst (cons 1 b) (assoc 1 el1) el1)) (entmod el) (setq x (+ x 1)) ) ; repeat (setq el nil) (setq en nil) (setq a nil) (setq v1 nil) (setq ss nil) (setvar "cmdecho" 1) (setvar "dimzin" olddimzin) (princ) ); END DEFUN Quote
sanju2323 Posted March 11, 2014 Author Posted March 11, 2014 Good time to learn lisp rather than relying on every one else to give up their time. Anyway you can change the text using entmod or a vlisp put you also need to just check the first character if 0 use the Substr function. Here in Aus we would accept 01234.456 as a chainage. Here something though to get you started. ;Adds a fixed amount to a number (Alert "TO USE JUST TYPE A2LM") (DEFUN c:A2LM () (setvar "cmdecho" 1) (setq olddimzin (getvar "Dimzin")) (setvar "dimzin" 0) (setq v2 (getreal "\nEnter ht adjustment ")) (setq ss (ssget (list (cons 0 "Text")))) (setq len (sslength ss)) (setq x 0) (repeat len (setq en1 (ssname ss x)) (setq el1 (entget en1)) (setq v1 (atof (cdr (assoc 1 el1)))) (setq a (+ v1 v2)) (setq b (rtos a 2 3)) (setq el (subst (cons 1 b) (assoc 1 el1) el1)) (entmod el) (setq x (+ x 1)) ) ; repeat (setq el nil) (setq en nil) (setq a nil) (setq v1 nil) (setq ss nil) (setvar "cmdecho" 1) (setvar "dimzin" olddimzin) (princ) ); END DEFUN Thanks for reply, your lisp was added values in selected text. I need "+" sign value in selected text. Thank you Quote
BIGAL Posted March 11, 2014 Posted March 11, 2014 Good time to learn lisp the code posted was a starting point for you not an answer to the exact request. Quote
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.