AutoCAD 2010/2011/2012

Reply
Active Member
Maccadin
Posts: 7
Registered: ‎02-21-2012
Message 1 of 4 (253 Views)
Accepted Solution

Updating all text to add 10 to the current value

253 Views, 3 Replies
10-07-2012 10:51 PM

To anyone who can help,

 

I have around 700 pieces of dtext that all need to have their values raised by 10 is there any easy way of doing this?

 

Thanks in advance,

Maccadin

 

*Expert Elite*
Alfred.NESWADBA
Posts: 8,866
Registered: ‎06-29-2007
Message 2 of 4 (249 Views)

Re: Updating all text to add 10 to the current value

10-07-2012 11:02 PM in reply to: Maccadin

Hi,

 

>> is there any easy way of doing this?

If development of such tool is easy, then yes, there is an easy way getting that done :smileywink:

If you describe more about your type of text (DTEXT, MTEXT, dimension-text, block-attribute-text, LEADER-text, ...) and do these text-objects have some prefix or suffix, .... or when you upload a drawing maybe someone does it for you.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
3wood
Posts: 968
Registered: ‎03-25-2009
Message 3 of 4 (238 Views)

Re: Updating all text to add 10 to the current value

10-08-2012 04:01 AM in reply to: Maccadin

Please try attached routine.

Settings as below:

altext.png

 

You can search from left or right depending on what text string structure it is.

Active Member
Maccadin
Posts: 7
Registered: ‎02-21-2012
Message 4 of 4 (187 Views)

Re: Updating all text to add 10 to the current value

10-10-2012 06:34 PM in reply to: Alfred.NESWADBA

The text was a mix of DTEXT and MTEXT with 2 decimal places, all the text had numerical values only. I found a lisp that ended up doing what i wanted.

 

Here it is for future reference. Thanks for replying.

 

(defun c:addn ( / ss)
(vl-load-com)
(if (and (setq ss (ssget "X" (list (cons 0 "*text"))))
(setq amt (getreal "\nPlease type the amount you would like to add: ")))
(progn
(mapcar '(lambda (z) (vla-put-textstring z (rtos (+ (atof (vla-get-textstring z)) amt) 2 3)))
(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))))
)
)
(princ)
)

 

EDIT: I missed that response ALTEXT is perfect! thank you so much.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube