Jump to content

Recommended Posts

Posted

Hello!

Is this possible?

Usualy I have in my drawings bunch of text objects that only contain number values like 150, 12, 45.45

Is it possible to select them all at once and sum all the values?

Posted
Hello!

Is this possible?

Usualy I have in my drawings bunch of text objects that only contain number values like 150, 12, 45.45

Is it possible to select them all at once and sum all the values?

 

Give this a shot

 

(defun C:SUM  (/ sum ss)
 (vl-load-com)
 (prompt "\n\t\t***\tSelect text objects\t***")

 (if

   (setq ss (ssget "_:L" '((0 . "TEXT"))))
    (progn
      (setq sum
      (apply '+
	     (mapcar 'atof
		     (mapcar 'vla-get-textstring
			     (mapcar 'vlax-ename->vla-object
				     (vl-remove-if
				       'listp
				       (mapcar 'cadr (ssnamex ss)))))))
     )
      (alert (strcat "Summ = " (rtos sum 2 3)))
      )
    )
 (princ)
 )
(prompt
 "\n\t\t***\tProgram loaded. Type SUM to execute...\t***")
(princ)

 

~'J'~

Posted

Fixo youre the greatest!

Thanx a bunch!

 

:-)

Posted
Fixo youre the greatest!

Thanx a bunch!

 

:-)

C'mon, you're welcome

Get to work :)

 

~'J'~

Posted

FIXO THAT IS GREAT!

 

Mind taking a look at this attachment? Is there a way to run the same lisp and it give you the result to paste where the yellow number is? Or alter the yellow number to the sum of the selection?

 

What do ya think?

SUM FLSG.dwg

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...