Thread Content
When drawing overall plans, it is often necessary to calculate the total weight of the equipment. If there are many components, adding up the values one by one can be quite cumbersome. I would like to ask fellow CAD users: does CAD have any functions for handling numbers, such as automatically summing a set of numbers as mentioned above?
It seems to be able to be used only with Word or Excel.
Just find a small plugin and load it
You can also write your own Lisp program. If all the numbers you mentioned are on the drawing and the file type is text, that’s fine. For simple calculations, you can enter the command: cal
;*******************************************Numeric accumulation (DEFUN C:NLJ () (SETQ ADDIT NIL SS NIL EN NIL ED NIL AS NIL A_TXT NIL NEW_TXT NIL ) (SETQ A_TXT 0) (PROMPT "\nSELECT TEXT TO ADD TOGETHER (Please select the numbers you want to add together): ") (SETQ SS (SSGET)) (WHILE (> (SSLENGTH SS) 0) (SETQ EN (SSNAME SS 0)) (SETQ ED (ENTGET EN)) (SETQ AS (CDR (ASSOC ‘0 ED))) (IF (= AS “TEXT”) (_TXT)) (SSDEL EN SS) ) (SETQ ADDIT NIL SS NIL EN NIL ED NIL AS NIL A_TXT NIL NEW_TXT NIL ) (PROMPT (STRCAT “\nTOTAL NUMBER IS (Their sum is): ” NEW_TEXT)) ) (DEFUN _TXT () (SETQ A_TXT (+ (DISTOF (CDR (ASSOC ‘1 ED)) 3) A_TXT)) (SETQ NEW_TEXT (RTOS A_TXT 2 2)) (SSDEL EN SS) )
I tried using it, but I felt there were issues – the results were incorrect. Please improve it further
By using software developed with CAD platforms, the total weight is automatically calculated when the weights of each component are entered. Examples include PCCAD from Tsinghua Tianhe and various mechanical engineering software; it’s quite easy to meet your requirements in this way.
I’ve never heard of such a feature; I’ll just use Excel instead