乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 10|回复: 8

[编程交流] Table Extraction -Pls help

[复制链接]

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:13:27 | 显示全部楼层 |阅读模式
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
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 11:24:53 | 显示全部楼层
What is the formula to calculate weight by description?
 
~'J'~
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:30:13 | 显示全部楼层
 
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.
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 11:39:41 | 显示全部楼层
Ok, if you won't to show your secret formula so do it by yourself
I'm busy today
 
  1. (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'~
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:47:11 | 显示全部楼层
 
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
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 11:57:57 | 显示全部楼层
 
We have a Victory Day today
 
I could help you tomorrow only
 
~'J'~
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 12:02:03 | 显示全部楼层
 
No problem.
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 12:09:35 | 显示全部楼层
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
  1. (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'~
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 12:16:37 | 显示全部楼层
 
Thank you So much.
 
Can you explain the selection method "+.:S:N"?
 
And do you have any other methods?
 
Yours
Muthu.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 11:16 , Processed in 0.413820 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表