Jump to content

Reinforced statistics table


vailin

Recommended Posts

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 

 

  • Thanks 1
Link to comment
Share on other sites

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.

 

 

 

 

  • Like 1
Link to comment
Share on other sites

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 by hanhphuc
"ACAD_TABLE" & remove (eval x)
  • Like 1
Link to comment
Share on other sites

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.

 

  • Like 1
Link to comment
Share on other sites

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"

 

  • Like 1
Link to comment
Share on other sites

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