TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: A_LOTA_NOTA on March 18, 2008, 11:24:44 AM

Title: Extracting BOM info to Excel
Post by: A_LOTA_NOTA on March 18, 2008, 11:24:44 AM
Attached is a typical BOM from our drawings. I would like to be able to extract the “Description” “Length” “Dimensions” & “Drawing” fields from this BOM and add it to an excel sheet.

How do I extract this info using LISP?
Title: Re: Extracting BOM info to Excel
Post by: Guest on March 18, 2008, 11:44:58 AM
What are you using to create the BOM?  When I opened the drawing and listed the BOM, it said it was a PROXY object.
Title: Re: Extracting BOM info to Excel
Post by: A_LOTA_NOTA on March 18, 2008, 02:12:11 PM
We use an add on package called "DesignLink". Maybe I can't extract the info I need.
Title: Re: Extracting BOM info to Excel
Post by: Guest on March 18, 2008, 02:51:01 PM
We use an add on package called "DesignLink". Maybe I can't extract the info I need.

With a name like DesignLink, I'd like to believe that you can "link" your "design" to a BOM.   :-)
Title: Re: Extracting BOM info to Excel
Post by: kozmos on March 19, 2008, 03:15:12 AM
if DesignLink does not support export, maybe you have to 1st convert the DesignLink table into a common table with lines and texts or mtexts. Then you can find many way to extract a normal table into Excel
Title: Re: Extracting BOM info to Excel
Post by: A_LOTA_NOTA on March 19, 2008, 02:32:36 PM
I found the file it exports (it was .VMX but I renamed it so I could up load it). So now I guess I need to try & sort out what I need.
Title: Re: Extracting BOM info to Excel
Post by: kozmos on March 20, 2008, 04:22:29 AM
So it seemed that you only have two choises:
1: Proceed the data in AutoCAD and convert an AutoCAD normal table into Excel liek what I have told u.
2: Proceed with the .VMX file, so additional particular program is needed to read data in VMX and convert it into a format that Excel can read such as .CSV file.
Title: Re: Extracting BOM info to Excel
Post by: A_LOTA_NOTA on March 20, 2008, 11:16:39 AM
So it seemed that you only have two choises:
1: Proceed the data in AutoCAD and convert an AutoCAD normal table into Excel liek what I have told u.
2: Proceed with the .VMX file, so additional particular program is needed to read data in VMX and convert it into a format that Excel can read such as .CSV file.


I have never used tables in AutoCAD so I guess I need to do some reading on that subject. Can this be done in 2006?

I was thinking I could use lisp to read the .VMX file & sort out the data I need. But maybe this is not as easy as it sounds.
Title: Re: Extracting BOM info to Excel
Post by: T.Willey on March 20, 2008, 11:22:23 AM
If all you did was change the extension on the file, then you can read it with lisp.  It looks like it's in xml format (guessing), so it might not be that hard once you understand how it is set up because it breaks stuff down in groups.
Title: Re: Extracting BOM info to Excel
Post by: A_LOTA_NOTA on March 20, 2008, 11:34:17 AM
If all you did was change the extension on the file, then you can read it with lisp.  It looks like it's in xml format (guessing), so it might not be that hard once you understand how it is set up because it breaks stuff down in groups.

Yes,
Code: [Select]
(setq VMX_File (open File "r")) will read the file.
Title: Re: Extracting BOM info to Excel
Post by: kozmos on March 20, 2008, 10:58:01 PM
The way i used to convert ur DesignLink table into normal AutoCAD table with lines and (m)texts.
1: without loading DesignLink, the DesignLink table will be shown by ACAD_PROXY_OBJECT
2: Explode the Proxy table
3: Move the new created objects to another position out the source table as u can not edit the source proxy table.
4: Convert the 3DFACEs used as the border line of new creaded table into lines. I recommend these steps becoz no program is needed:
4.1: Change all table contents to a new individual layer and turn it off
4.2: Run WMFOUT and select the left 3DFACEs
4.3: WMFIN the WMF file with scale=2
4.4: Move the WMFIN empty table to the same position of the 3DFACE table
4.5: Erase all 3DFACEs in table
5: Explode the WMFIN table, turn on the content layer and then u will have a normal AutoCAD drawn table

That is not the native ACAD_TABLE, it is a drawn table and when u have it, you can then choose a software to convert the drawn table into Excel.