Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Calculating numeros text statistics

Anonymous

Calculating numeros text statistics

Anonymous
No aplicable

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 Me gusta
Responder
Soluciones aceptadas (1)
506 Vistas
6 Respuestas
Respuestas (6)

В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)
  )

 

Anonymous
No aplicable

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 Me gusta

ВeekeeCZ
Consultant
Consultant

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

 

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

0 Me gusta

Anonymous
No aplicable

Jeez, what´s with the attitude?

 

Whatever,

thanks for your help

0 Me gusta

В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 Me gusta

R_Tweed
Advisor
Advisor
Solución aceptada

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)