乐筑天下

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

[编程交流] CELL EDIT in a Table -Help

[复制链接]

55

主题

133

帖子

78

银币

后起之秀

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

铜币
280
发表于 2022-7-6 11:15:01 | 显示全部楼层 |阅读模式
Dear friends,
 
Is it possible to update a cell automatically based on the text edit of one cell.
 
Ex.
If we edit the part in the follwing sample table, the description cell should have the corresponding size of the part.
 
PART      Description
CL-01    "PL5X80X155"
CL-02    "PL6X80X180"
 
Help will be highly appriciatable.
 
Yours,
Muthu.
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 11:49:12 | 显示全部楼层
 
Here is quick and dirty example
test it just after you would finished to edit the desired cells
  1. (defun C:demo(/ columns pair part_list row rows table_ent table_obj);; change your part list here:  (setq part_list (list   (cons "CL-01" "PL5X80X155")   (cons "CL-02" "PL6X80X180")   (cons "CL-03" "PL7X80X200")   (cons "CL-04" "PL8X80X240")   (cons "CL-05" "PL9X80X300") )) (setq table_ent (entsel "\nSelect table >> ")) (setq table_obj (vlax-ename->vla-object (car table_ent))) (setq rows (vlax-get-property table_obj 'Rows)) (setq columns (vlax-get-property table_obj 'Columns)) (setq row 0) (if (eq :vlax-false (vla-get-titlesuppressed table_obj))   (progn   (setq row (1+ row))    (setq rows (1- rows)))   ) (if (eq :vlax-false (vla-get-headersuppressed table_obj))       (progn   (setq row (1+ row))    (setq rows (1- rows)))   )   (repeat rows   (if (setq pair  (assoc (vla-gettext table_obj row 0) part_list))   (vla-settext table_obj row 1 (cdr pair)))   (setq row (1+ row))  ) (vla-update table_obj) (princ) )(vl-load-com)
 
~'J'~
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

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

铜币
280
发表于 2022-7-6 12:01:30 | 显示全部楼层
 
Dear fixo,
 
Thank you so much.
Instead of calling separate function, how can we assign this function to that same cell to update automatically depends of the part list.
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 12:31:24 | 显示全部楼层
Search forum how to use vlr-object-reactor
I have not have an experience with this thing
 
~'J'~
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 11:20 , Processed in 0.641666 second(s), 60 queries .

© 2020-2025 乐筑天下

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