乐筑天下

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

[编程交流] Table + attributes (for BOM, b

[复制链接]

3

主题

10

帖子

7

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-6 14:55:39 | 显示全部楼层 |阅读模式
hi evrb!
i need a big help.
i'm working to make quiet easier and faster my activity of measurment for BOM with autocad. i'm not a programmer, so viva all autocad forums!
 
what i'm looking for has two order of problem to solve
 
1.
i'm looking for a lisp or something like, to put values of a block with attributes in a table (acad 2007): if i have in the block 5 attributes, i need to write in a table the values of them.
in the first column should be write the first attribute value, in the second, the value of the second attribute, and so on.
 
2.
the second part of the problem is something like "dynamic blocks". if one or more value(s) of attribute(s) in a block(s) are changed, the same value should be automatically updated (in the table).
 
 
can someone give a help? maybe with the possibility to select more than one block at time (not one by one) and then pick the table where to write in.
 
 
hope i've been clear with my request.
 
dave.
回复

使用道具 举报

2

主题

9

帖子

7

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 15:05:19 | 显示全部楼层
Why Dont you Use Data extraction In Autocad this Will Give you both Of Your answers in 1 hit
回复

使用道具 举报

3

主题

10

帖子

7

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-6 15:16:19 | 显示全部楼层
 
...
becouse Data extraction (both, normal and via express tools) is the last step of the work, when you need to export data to excel or openofiice or anithing like.
 
what i need i a tool easy to use to connect data stored in a block with a table.
 
and also, before someone else suggest to use the table creation wizard, that way is not useful for the work.
 
cheers,
dave
回复

使用道具 举报

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 15:25:20 | 显示全部楼层
Here is some code that I use to do almost the exact same thing.
 
Gathers blocks by name
Changes layer of block to an attribute in the block
Filters out duplicates
Clears out existing schedule if it exists
Inserts lines into the schedule with info from the blocks
回复

使用道具 举报

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 15:27:28 | 显示全部楼层
I also use some subroutines in this that automatically extract and insert info into the blocks.
 
AVALUE
NAVALUEAnd also a sort routineBSORT
Also, not sure if you will need it or not but I use ADOLisp Subroutines to access a MSACESS Database and get info from it. You can search for ADOLisp to find all of those codes. 
As far as the dynamic thing, I'm not even sure if it can be done. You might have to write a separate code to make changes to your table and upon completion it refreshes the data. Maybe Someone else will have some ideas on that one.
Hope this helps.
回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 15:40:06 | 显示全部楼层
 
This looks fantastic! Just to reinterate a minute. This will build a BOM from the blocks that you add to your drawing, correct?
 
I am a pretty big newb to the AutoCAD world and received a need to have something similar. I have a drawing set with multiple blocks of several PID configurations we for multiple layouts in the same drawing. I had a question on how to change this to ask me what is being shown in the layout tab? Or is there a way to assign a tag to the properties of the items being displayed and have it update a table with the reference tag. So I assign part xyz1 and then in the table I make it into variable text of IF xyz1 exists then TRUE, True = string "xyz1 part #" if FALSE then "". And finally if xyz1 > 2 = "new part #"
 
Thoughts?
 
Thanks in advance, I hope I was somewhat clear.
回复

使用道具 举报

33

主题

73

帖子

40

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
165
发表于 2022-7-6 15:42:35 | 显示全部楼层
To update table when attribute changes you would probably need to use a reactor.
回复

使用道具 举报

1

主题

316

帖子

311

银币

初来乍到

Rank: 1

铜币
29
发表于 2022-7-6 15:52:05 | 显示全部楼层
here's through field:
 
http://forums.cadalyst.com/showthread.php?t=6430
回复

使用道具 举报

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 16:01:00 | 显示全部楼层
 
Yes you could change the info being put into the table with an if or cond statement. They might be kinda lenghty  But it wouldn't be a problem. Just do search for the values and depending on what was in them insert a different block with different info slots. This is kind of a long routine for a beginner but hey we all started some place right? My best advice is dont be afraid to get in there and get your hands dirty with some data. learn how to fully use your VLIDE and set some breakpoints and keep an eye on what kind of data your code is coming back with. Work on one routine at a time . That was what helped me the most. And the good fellas at the forum.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 21:30 , Processed in 0.328932 second(s), 70 queries .

© 2020-2025 乐筑天下

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