Jump to content

change sign in bulk on multiple numbers


cat3appr

Recommended Posts

Hi all,

 

I have these drawings with numbers on the side, vertically placed. I need to reverse each one of the number , so for instance the 3.15 has to become -3.15

Screenshot - 27_07_2016 , 09_55_36.jpg

 

thanks in advance for any input!

Screenshot - 27_07_2016 , 09_55_29.jpg

Link to comment
Share on other sites

What sort of entities are the numbers?

How were they generated?

Are they externally linked?

 

Hopefully not by the spreadsheet from Hades with 40,000+ points in your other thread.

Link to comment
Share on other sites

Perhaps you could use one of the lisps that operate on numbers in a drawing, and multiply your numbers by -1

 

That sounds like just the ticket eldon! :beer:

Link to comment
Share on other sites

Perhaps you could use one of the lisps that operate on numbers in a drawing, and multiply your numbers by -1

 

That sounds like just the ticket eldon! :beer:

 

So, does anyone know how to do this?

Link to comment
Share on other sites

So, does anyone know how to do this?

 

I use a lisp called TextMath, but it is quite old and there are more modern ones about. The key words to search for are "math" and "text" or variations on those words!

Link to comment
Share on other sites

My $0.05 worth, should have known to go to Lee-mac first but it only took a few minutes a day ago.

 

; adds a suffix or prefix to text  
; 
; by Alan H July 2016
(defun sufftxt ( / ss obj txtstr suffix)
(alert "Make sure you have only the correct text layer on\n \nPress Esc now if you need to exit\n \nUse Layiso")
(if (not AH:getval2) (load "getvals"))
(ah:getval2 "Enter new text" 25 24 "+ or - for prefix suffix" 3 2)
(setq suffix val1)
(setq ans val2)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)

(setq ss (ssget))
(setq y (sslength ss))
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss (setq y (- y 1)))))
(if (= (vla-get-ObjectName obj) "AcDbText")
 (progn
 (setq txtstr (vla-get-textstring obj ))
 (if (= ans "+")
   (vla-put-textstring obj (STRCAT suffix " " txtstr))
   (vla-put-textstring obj (STRCAT txtstr " " suffix))
 ) ;if
 )  ; progn                   
)  ; if                            
)  ; repeat
(setvar "osmode" oldsnap)
) ; defun
(princ )
(sufftxt)

GETVALS.lsp

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...