Table Extraction -Pls help
Dear friends,Please refer the attached drawing with table. How can i convert all the part description under the column "DESCRIPTION" to a list. Then i can calculate weight and put it the Weight Column.
Please help.
yours,
Muthu.
table.dwg What is the formula to calculate weight by description?
~'J'~
I have a function to calculate the wt for a given description and it will return the weight.
Ex.(cal_wt_part "5X150X6500") it will return
4.875.
But i have to know that where i can place this value and how can i get the row and column number of the Description cells.
Yours,
Muthu. Ok, if you won't to show your secret formula so do it by yourself
I'm busy today
(if(setq sset (ssget "+.:S:L" '((0 . "ACAD_TABLE"))))(progn(setq atable (vlax-ename->vla-object (ssname sset 0)))(setq column 2 row 2)(while (< row 9)(setq lst(cons (vla-gettext atable row column) lst))(setq row (1+ row)))))(setq lst (reverse lst))
~'J'~
I thing u misunderstand me. Actually we have so many types of descrptions and standard parts and weigts.So it is a big function to calculate weight. Anyhow i will attach the files for your reference.
;;fuction is
(wt_cal_single_desc sk_part sk_mark sk_part_quantity)
;; arguments sk_part - Description such as "5X150X6100", "S-CL01", "IPEA200X6500" etc...
;;sk_mark - Piecemark such as "OF-1" IF-1" "HR-1" "EP-1" etc...
;;; sk_part_quantity - aty of the qty column.
Thank you so much for your reply.
Your Sincerly,
Muthu.
TOOL.zip
We have a Victory Day today
I could help you tomorrow only
~'J'~
No problem. Unfortunatelly I can't test the code below
because of my AutoCAD is crashed at all
Here is just a quick and dirty that partially was written from memory
(defun get_wt_by_desc (desc)(cond ((= "6X300-500X5546" desc) 104.49) ((= "10x0-95x142" desc)1.06) ((= "10x0-80x80"desc) 0.25) ((= "5X80X180"desc) 1.70) ((= "6X150X5546"desc) 39.18) ((= "6X150X5550"desc) 39.21) ((= "16x200x652"desc) 16.38) ) )(defun C:RECALC (/ atable column descript en ent lst row rows sset total wt)(vl-load-com) (setq sset (ssget "+.:S:N" '((0 . "ACAD_TABLE")))) (setq atable (vlax-ename->vla-object (ssname sset 0))) (vla-put-regeneratetablesuppressed atable :vlax-true) (setq column 2 row 3 total 0.0 rows (vla-get-rows atable)) (while (/= row rows) (setq descript(vlax-variant-value (vla-getvalue atable row column 0))) (if (setq wt (get_wt_by_desc descript)); (setq row 0);;here may be the wrong part (change by yourself): (while (wcmatch (vla-gettext atable row column) "*WEIGHT SUM*" ) (setq row (1+ row)) ) (vla-settext atable row (1+ column) (rtos total 2 2)) (vla-put-regeneratetablesuppressed atable :vlax-false) (princ) )
~'J'~
Thank you So much.
Can you explain the selection method "+.:S:N"?
And do you have any other methods?
Yours
Muthu.
页:
[1]