vailin Posted April 21, 2020 Posted April 21, 2020 Hi all, I hava a Reinforced statistics table, i need one lisp to produce the aggregate result. Hope the helping. I'm vietnamese, I write english don't well ! Reinforced statistics table.dwg Quote
hanhphuc Posted April 23, 2020 Posted April 23, 2020 9 hours ago, vailin said: Does anyone help me? Hi, not all of us involve in the same career like yours need to explain quantity? or total length? http://www.lee-mac.com/lengthfield.html or this link : 1.select partial text value & lines (eg: start at column 4 to 13 ) export all to EXCEL 2.apply formula in EXCEL is much easier 3.copy paste back the result back to ACAD p/s: post example before & after 1 Quote
BIGAL Posted April 23, 2020 Posted April 23, 2020 The answer is fairly straight forward add the total lengths up for a section D1 etc with regard to the reinforcement bar diameter. Big problem is its not a table so need to get the text values and would have to sort and other stuff to make it work. A big task. It would be much easier if take step back and make a table first. Agree use excel can do sort of rows D1 using bar dia, then count, repeat D2. 1 Quote
vailin Posted April 25, 2020 Author Posted April 25, 2020 Thanks everyone !. I tried and found a lisp. However, it does not match the requirements. Can you fix it for me? Reinforced statistics table.dwg thkl sua.lsp Quote
hanhphuc Posted April 26, 2020 Posted April 26, 2020 (edited) 14 hours ago, vailin said: Thanks everyone !. I tried and found a lisp. However, it does not match the requirements. Can you fix it for me? Reinforced statistics table.dwg 64.18 kB · 2 downloads thkl sua.lsp 2.83 kB · 2 downloads It does not match the requirements because this is your assignment not others! since AcTable "Bang Tong Hop" is not formatted text quick & dirty 1.populate value/text from Table "Bang Tong Hop" 2.filter 3 list use cond matched criteria 3.sum each list 4.put MText at Reinforced Statistics Table (defun c:BTH (/ 10<?<18 ?<=10 ?>18 en l pt foo ) (defun foo (l / ls) (if l (setq ls (cons (list (car l) (cadr l) (caddr l) (cadddr l)) (foo (setq l (cddddr l))) ) ) ) ls ) (if (and (setq en (car (entsel "\nPick Table Bang tong hop.. "))) (= (cdr (assoc 0 (entget en))) "ACAD_TABLE") (setq l (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 1)) (entget en) ) ) ) (= (car l) "Bang tong hop") ;remove header ("STT" "DK" "CD" "KL") (foreach x (cdr (foo (cdr l))) (cond ((<= (distof (cadr x)) 10) (setq ?<=10 (cons (distof (cadddr x)) ?<=10)) ) ((< 10 (distof (cadr x)) 18) (setq 10<?<18 (cons (distof (cadddr x)) 10<?<18)) ) ((>= (distof (cadr x)) 18) (setq ?>18 (cons (distof (cadddr x)) ?>18)) ) (t) ) ) ) (or (and (setq pt (getpoint "\nPick 1st KL cell at Reinforced Statistic table " ) ) (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") '(50 . 0) (cons 40 0.6) (cons 10 (trans pt 1 0)) (cons 1 (apply 'strcat (mapcar '(lambda(x) (if x (strcat (rtos (apply '+ x ) 2 2) "\\P") ) ) (list ?<=10 10<?<18 ?>18) ) ) ) ) ) ) (princ "\nInvalid point!!") ) (alert "Invalid Bang Tong Hop AcTable!\nPlease try again! ") ) (princ) ) Edited April 26, 2020 by hanhphuc "ACAD_TABLE" & remove (eval x) 1 Quote
vailin Posted April 26, 2020 Author Posted April 26, 2020 Thanks you. I mean use lisp BTH 1. Use the BTH command 2. Select region 3. results Thanks for all the help ! Reinforced statistics table.dwg Quote
hanhphuc Posted April 26, 2020 Posted April 26, 2020 6 minutes ago, vailin said: Thanks you. I mean use lisp BTH 1. Use the BTH command 2. Select region 3. results Thanks for all the help ! Reinforced statistics table.dwg 59.49 kB · 0 downloads you must load your "thkl sua.lsp" command THKL to select region to create AcTable "Bang tong hop" at the first place! after done Table command BTH to pick the newly created "Bang tong hop" table then place result. 1 Quote
vailin Posted April 26, 2020 Author Posted April 26, 2020 I know that. But it would be great if you edit lisp "thkl sua" so that it gives the final result as shown below. Quote
vailin Posted April 26, 2020 Author Posted April 26, 2020 In the Vietnamese dictionary: "hanhphuc" is equivalent to "Happy". Thanks you very much ! 1 Quote
hanhphuc Posted April 26, 2020 Posted April 26, 2020 38 minutes ago, vailin said: I know that. But it would be great if you edit lisp "thkl sua" so that it gives the final result as shown below. DO IT YOURSELF !! look at your "thkl sua.lsp" , just add (c:BTH) at the last line before (princ) Quote (defun c:thkl (/ doc) ;;<snippet> (princ "\nKhong chon duoc Block thuoc tinh.")) (c:BTH) ;<----- here (princ) ) look at BTH update Quote (defun c:BTH (/ 10<?<18 ?<=10 ?>18 en l pt str) (if (and ;;(setq en (car (entsel "\nPick Table Bang tong hop.. "))) ;; <-- delete this line if you don't want picking table (setq en (entlast)) ; <--- add this line (= (cdr (assoc 0 (entget en))) "ACAD_TABLE") (setq l ;;<snippet>;;;;; p/s: you can copy paste all BTH in your "thkl sua.lsp" 1 Quote
vailin Posted April 26, 2020 Author Posted April 26, 2020 I have followed the instructions: New lisp thkl sua= load thkl + bth thkl sua.lsp Quote
Recommended Posts
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.