Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Value Lisp

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
390 Views, 8 Replies

Change Value Lisp

Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Depends on how you want to use it. Would FIND, with the Replace option, do what you want? It works in both. Kent Cooper, AIA "Tim Duzan" wrote... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan
Message 3 of 9
Anonymous
in reply to: Anonymous

I've got to raise every piece of mtext that has an elevation up the same difference. -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D "Kent Cooper, AIA" wrote in message news:412f97b4_2@newsprd01... Depends on how you want to use it. Would FIND, with the Replace option, do what you want? It works in both. Kent Cooper, AIA "Tim Duzan" wrote... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan
Message 4 of 9
Anonymous
in reply to: Anonymous

Well, then, FIND is definitely not your answer [unless they all happen to be the SAME elevation, but duh...]. Sounds hard -- you'd have to extract the number parts and convert them to actual numbers instead of text, to add to/subtract from them, and then convert them back to text again. Kent Cooper, AIA "Tim Duzan" wrote... I've got to raise every piece of mtext that has an elevation up the same difference. "Kent Cooper, AIA" wrote... Depends on how you want to use it. Would FIND, with the Replace option, do what you want? It works in both. Kent Cooper, AIA "Tim Duzan" wrote... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan
Message 5 of 9
Anonymous
in reply to: Anonymous

TRY THIS: (setq PREC (getint "\nEnter decimal precision for text: ")) (setq INCR (getreal "\nEnter incremental change for each number in selection: ")) (prompt "\nPick text to be changed.") (setq SELSET (ssget (LIST(cons 0 "text")))) (setq INDEX 0) (setq N (sslength SELSET)) (repeat N (setq ITEM1 (entget (ssname SELSET INDEX))) (setq INDEX (1+ INDEX)) (setq ITEM (assoc 1 ITEM1)) (setq VALUS (cdr ITEM)) (setq VALU (atof VALUS)) (setq VALUNEW (rtos(+ VALU INCR) 2 PREC)) (setq NEWTXT (subst (cons 1 VALUNEW) ITEM ITEM1)) (entmod NEWTXT) );end repeat (princ) ) "Tim Duzan" wrote in message news:412f95ab$1_2@newsprd01... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D
Message 6 of 9
Anonymous
in reply to: Anonymous

OOPS: REPLACE THE 4TH LINE WITH THIS (THE "*" PRIOR TO TEXT SHOULD CATCH MTEXT AS WELL AS TEXT). "Tim Duzan" wrote in message news:412f95ab$1_2@newsprd01... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D
Message 7 of 9
Anonymous
in reply to: Anonymous

(setq PREC (getint "\nEnter decimal precision for text: ")) (setq INCR (getreal "\nEnter incremental change for each number in selection: ")) (prompt "\nPick text to be changed.") (setq SELSET (ssget (LIST(cons 0 "*text")))) (setq INDEX 0) (setq N (sslength SELSET)) (repeat N (setq ITEM1 (entget (ssname SELSET INDEX))) (setq INDEX (1+ INDEX)) (setq ITEM (assoc 1 ITEM1)) (setq VALUS (cdr ITEM)) (setq VALU (atof VALUS)) (setq VALUNEW (rtos(+ VALU INCR) 2 PREC)) (setq NEWTXT (subst (cons 1 VALUNEW) ITEM ITEM1)) (entmod NEWTXT) );end repeat (princ) ) "Scott Mcfarren" wrote in message news:412fa58b$1_1@newsprd01... OOPS: REPLACE THE 4TH LINE WITH THIS (THE "*" PRIOR TO TEXT SHOULD CATCH MTEXT AS WELL AS TEXT). "Tim Duzan" wrote in message news:412f95ab$1_2@newsprd01... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D
Message 8 of 9
Anonymous
in reply to: Anonymous

What do I type in after I load the lisp? -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D "Scott Mcfarren" wrote in message news:412fa70a_1@newsprd01... (setq PREC (getint "\nEnter decimal precision for text: ")) (setq INCR (getreal "\nEnter incremental change for each number in selection: ")) (prompt "\nPick text to be changed.") (setq SELSET (ssget (LIST(cons 0 "*text")))) (setq INDEX 0) (setq N (sslength SELSET)) (repeat N (setq ITEM1 (entget (ssname SELSET INDEX))) (setq INDEX (1+ INDEX)) (setq ITEM (assoc 1 ITEM1)) (setq VALUS (cdr ITEM)) (setq VALU (atof VALUS)) (setq VALUNEW (rtos(+ VALU INCR) 2 PREC)) (setq NEWTXT (subst (cons 1 VALUNEW) ITEM ITEM1)) (entmod NEWTXT) );end repeat (princ) ) "Scott Mcfarren" wrote in message news:412fa58b$1_1@newsprd01... OOPS: REPLACE THE 4TH LINE WITH THIS (THE "*" PRIOR TO TEXT SHOULD CATCH MTEXT AS WELL AS TEXT). "Tim Duzan" wrote in message news:412f95ab$1_2@newsprd01... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D
Message 9 of 9
Anonymous
in reply to: Anonymous

I got it to work, but the only way I know how to execute it is to load it through "appload" everytime. Is there another way? Also, I asked the wrong question what I really needed. What I really need to change is an attribute. Does anyone know of something that will change the numeric value for an attribute? TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D "Tim Duzan" wrote in message news:412fa887_1@newsprd01... What do I type in after I load the lisp? -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D "Scott Mcfarren" wrote in message news:412fa70a_1@newsprd01... (setq PREC (getint "\nEnter decimal precision for text: ")) (setq INCR (getreal "\nEnter incremental change for each number in selection: ")) (prompt "\nPick text to be changed.") (setq SELSET (ssget (LIST(cons 0 "*text")))) (setq INDEX 0) (setq N (sslength SELSET)) (repeat N (setq ITEM1 (entget (ssname SELSET INDEX))) (setq INDEX (1+ INDEX)) (setq ITEM (assoc 1 ITEM1)) (setq VALUS (cdr ITEM)) (setq VALU (atof VALUS)) (setq VALUNEW (rtos(+ VALU INCR) 2 PREC)) (setq NEWTXT (subst (cons 1 VALUNEW) ITEM ITEM1)) (entmod NEWTXT) );end repeat (princ) ) "Scott Mcfarren" wrote in message news:412fa58b$1_1@newsprd01... OOPS: REPLACE THE 4TH LINE WITH THIS (THE "*" PRIOR TO TEXT SHOULD CATCH MTEXT AS WELL AS TEXT). "Tim Duzan" wrote in message news:412f95ab$1_2@newsprd01... Does anyone happen to have a lisp that will change the value of numbers, regardless if it's single line text or mtext? I've got one that works only in single line text, but don't want to explode all of my mtext to accomplish this if I don't have to. TIA, -- Tim Duzan Jones & Boyd, Inc. LDT 2005 & Civil 3D

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost