Calculating numeros text statistics

Calculating numeros text statistics

Anonymous
Not applicable
1,089 Views
6 Replies
Message 1 of 7

Calculating numeros text statistics

Anonymous
Not applicable

Hello,

I have this layer, with numeros text objects and I´m trying to figure out statistics about them

for example

amosweislib_0-1585663279549.png

here I want to calculate Max, Min and Average of the selected texts

Anybody knows how do I do it?

 

Thanks

0 Likes
Accepted solutions (1)
1,090 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant

Yes, learn to program! Prob the simplest would be a LISP:

 

(vl-load-com)
  
(defun c:TextStats ( / lst)
  (if (and (setq lst (ssget '((0 . "TEXT"))))
	   (setq lst (mapcar '(lambda (x) (distof (cdr (assoc 1 (entget x))))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex lst))))))
    (princ (strcat "\nMin: " (vl-princ-to-string (apply 'min lst)) " - Max: " (vl-princ-to-string (apply 'max lst)) " - Avr: " (rtos (/ (apply '+ lst) (float (length lst))) 2 3))))
  (princ)
  )

 

Message 3 of 7

Anonymous
Not applicable

Hey, Thanks for the reply!

I'm struggling a bit with your solution,

Iv'e put your code in the command line and nothing turned out,

I guess that's not the way to do it

could you please be more specific?

Thanks

 

I must say that I usually dont work with CAD so I'm not really from that world

0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

How about use google to learn how to run a LISP ?!

 

http://www.lee-mac.com/runlisp.html

0 Likes
Message 5 of 7

Anonymous
Not applicable

Jeez, what´s with the attitude?

 

Whatever,

thanks for your help

0 Likes
Message 6 of 7

ВeekeeCZ
Consultant
Consultant

Well, there is no other solution than write a program that will do that.

And you're not even capable to search how to use it. So. Sorry that I wrote that program, I should not.

0 Likes
Message 7 of 7

R_Tweed
Advisor
Advisor
Accepted solution

Hello,

There is another option available that doesn't require you to learn a programming language. If you are familiar with excel the calculations are pretty easy to do. The max, min and average functions are straight forward.

 

1. use the dataextraction wizard to extract the values by layer to an xls file.

2. open the xls file and add your functions.

3. You can also import the data into a table within autocad and add formulas at the bottom. (something to explore)