Jump to content

AutoCAD Lisp Help: Attribute Extraction into Excel BOM


ml3428

Recommended Posts

I was able to find this Lisp Routine "ATTOUT" forexctracting attributes into an Excel document. I currently have blocks createdthat contain 4 different attribute values. These attributes are exctracted in creating B.O.M's to automate Mfg. processes in conveyor equipment construction.In devloping the B.O.M a specific format is required by the company I work for.Currenntly the Lisp routine does not extract the data in the format I wouldlike. I need this Lisp to "count"the number of blocks and output them into an excel table that follows the format

 

"Qty" "Part #" "Descripition" (See BOM Tab of attached DWG).

 

Model space contains a sampleof some of the blocks that are being used. I have very little experience writing Lisp, and in order to modify the codewould be beyond my abilities. Any helpthat can be provided would be greatly appreciated.

 

Thank You

LayoutExample.dwg

ATTOUT.LSP

Link to comment
Share on other sites

block counter seems is close to what i need; but is there a way to extract the attributes in the block also? It seems that only the block name is being exctracted. Is this correct?

Link to comment
Share on other sites

block counter seems is close to what i need; but is there a way to extract the attributes in the block also? It seems that only the block name is being exctracted. Is this correct?

 

Correct, my existing block counter program will only count blocks by name, since two block references of the same name may (and most probably will) contain different attribute values. However, given the criteria by which you wish to count and differentiate between your block references, I would be more than happy to construct a custom program to meet your exact requirements - feel free to contact me if you are interested and we can discuss the project further.

Link to comment
Share on other sites

Look into the DATAEXTRACTION command. I ran it against your example DWG and got different results from your BOM, but it may get you closer with some fiddling.layoutexample.jpg

Link to comment
Share on other sites

Thank You for the response. I have looked into"DATAEXTRACTION" and the desired format can be accomplished through this command. Unfortunatelyit is a bit more "tedious" then I am looking for and I would wantsomething more efficient.

Link to comment
Share on other sites

Thank You for the response, but the "Jeffery P. Sanders Blocks program" is not quite what I am looking for. It seems this program does not combine "like" attributes. This is something I would need to accomplish in completing the data extraction I am looking for.

Link to comment
Share on other sites

This is very similar to something I asked about on the AUGI forum.

 

http://forums.augi.com/showthread.php?t=136467&page=2

 

I can create a table within a drawing based on selected blocks.

Then extract direct to Excel without using the tedious "dataextraction"

 

Help was given to me by Fixo, who is also a regular poster on this forum.

Link to comment
Share on other sites

This is very similar to something I asked about on the AUGI forum.

 

http://forums.augi.com/showthread.php?t=136467&page=2

 

I can create a table within a drawing based on selected blocks.

Then extract direct to Excel without using the tedious "dataextraction"

 

Help was given to me by Fixo, who is also a regular poster on this forum.

 

This solution is quite good. (I see that you have already posted that it isn't quite what your looking for.) I have another parser that works for me, but my blocks and attributes to filter by are hard coded. This post has inspired me to update it. There are several ways to go about it, but in order to go in the right direction for you, can you supply a dwg with a sample of the blocks you wish to tally?

Link to comment
Share on other sites

See attached.

 

It's a spawn of hard-coded block tally. Now updated to be (I hope) universal.

 

Need to already have loaded two of Lee-Mac.com functions if you want to batch process (not needed otherwise).

LM:ODBX

LM:GetFiles

 

 

 

 

You need to go get the functions from Lee because:

  1. There not mine
  2. You get the latest version
  3. You get to see other golden nuggets

Features:

  • Process current dwg or batch process
  • Group BOM by drawing or Master BOM
  • Select whether to allow the block name to be part of the comparison or just attributes. This feature allows you to use attribute affinity for grouping, which allows for blocks with different names to be tallied together if the attributes match (also prevents the header from being printed excessively)
  • Select output file (tab delimited)

BOMTally.LSP

Edited by wishbonesr
Tinni ittie bittie bug
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...