daveacad 发表于 2022-7-6 14:55:39

Table + attributes (for BOM, b

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.

dave buckberry 发表于 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

daveacad 发表于 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

Hardeight 发表于 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

Hardeight 发表于 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.

H2Powerman 发表于 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.

chavlji 发表于 2022-7-6 15:42:35

To update table when attribute changes you would probably need to use a reactor.

wizman 发表于 2022-7-6 15:52:05

here's through field:
 
http://forums.cadalyst.com/showthread.php?t=6430

Hardeight 发表于 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 lenghtyBut 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.
页: [1]
查看完整版本: Table + attributes (for BOM, b