Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3d drawing --> excel part list (sizes, material, colour, name) 1

Status
Not open for further replies.

threeway

Technical User
Jul 2, 2004
7
0
0
NL
Hello,

Here is the problem I'm facing:
I need to create a standard Excel sheet, from a 3d drawing in autocad 2004. The excel sheet must contain, per part, sizes, material and colour. The drawing contains cabinets/furniture, with around 20 different parts. The excel sheet is needed so the parts can be build and the cabinets/furniture can be assembled.

I'm looking for a standard solutions, because it must be done for around 90 different cabinets and furniture.

I can create a block per part (with all the right information), but with around a 1000 different parts, it would just take to much time.

My thoughts were that I used the list function per drawing and then extract all the data, but at first I don't know how to create a program for the extraction and second, some parts contain a carve, and the list function only reports the bounding box (aka sizes), layer (material) and colour.

Thanks in advance and sorry for my pour english,

Bart Boonacker
 
Bart,

I know what you want to do, but I don't know what you are working with. These cabinets and furniture items, are they blocks now, or are they just 3D solids/sufaces etc.

What you are trying to accomplish is not difficult and for what its worth, here's my two cents:

Create blocks for each part, and attach attributes to each part which may include Part Name, Part No., Options, etc.

Then using then canned AutoCAD attribute extract command ("attext" at the command prompt), you can extract the attributes you want to a CDF (comma delimited file) which Excel will readily import. The attext command allows you to use template files to set up your extraction the way you want, so you'll need to experiment a bit with this feature but it should more than do what you want.

HTH
Todd
 
hello TCarpenter,

I have tried this, the ATTEXT way, but what I found was that I needed do my own input about heigt and length of the parts. When I should do it this way, it would be easier to create an Excel sheet at once, since I need to fill in my data manually aswell.

If I could get the sizes from BoundingBox automatic it would be great. I don't know if I can add this to the attributes automaticly. But I then still needed to fill in the PartName, material and I need to create a block, for each part (~1000 parts in total).

I'm now trying to get the information with Visual Basic, but don't know how it works. I found out that there are functions like GetBoundingBox and layer, but I know need to put that in a file which makes a text/Excel file of it.

The tutorials I have are only about making lines and dialog boxes in VBA, but I need a tutorial on how get information from a drawing.
 
Bart,

If I understand correctly, you need to process around 1000 drawings, collecting say: drawing name, model space entity count, and bounding box sizes for each entity; and then export this information into an Excel spreadsheet where you can perform any data clean-up, and/or populate things like part name, part number etc. You then want to reprocess these items, this time adding attributes to one to many entities to generate a working library of components.

You then, finally, want to utilize the library to generate finished drawings which can then generate a bill of materials in Excel for build.

If I've got all this correct - you do have a big job in front of you. And if I understand your question, you need to know how to extract certain information - correct?

If so here is how I have done it:
Code:
Sub ExtractDrawingInfo()
  
  ' Variable declarations
  Dim AcadDoc     As AcadDocument ' Drawing
  Dim strDwgName  As String       ' Drawing/File name
  Dim Ent         As AcadEntity   ' Drawing entities lines, arcs etc.
  Dim strEntName  As String       ' Entity name
  Dim lngEntHnd As Long           ' Entity Handle
  Dim strEntColor As String       ' Entity color
  Dim strEntLayer As String       ' Entity layer
  Dim lngEntCnt As Long           ' Number of drawing entities
  Dim varMin, varMax As Variant   ' XYZ coordinates for bounding box info
  
  Set AcadDoc = ThisDrawing
  
  strDwgName = AcadDoc.Name
  lngEntCnt = AcadDoc.ModelSpace.Count
    
  ' Output drawing information
  Debug.Print strDwgName
  Debug.Print "  Contains: " & lngEntCnt & " entities"
    
  For Each Ent In AcadDoc.ModelSpace
    ' Entity identification
    strEntName = Ent.ObjectName
    lngEntHnd = Ent.Handle
    
    ' Entity color, layer and bounding box information
    strEntLayer = Ent.Layer
    strEntColor = Ent.Color
    Ent.GetBoundingBox varMin, varMax
    
    ' Output entity information
    Debug.Print strEntName
    Debug.Print lngEntHnd
    Debug.Print strEntLayer
    Debug.Print strEntColor
    Debug.Print "MinPoint: X-" & varMin(0) & _
                        ", Y-" & varMin(1) & _
                        ", Z-" & varMin(2)
    Debug.Print "MaxPoint: X-" & varMax(0) & _
                        ", Y-" & varMax(1) & _
                        ", Z-" & varMax(2)
      
  Next Ent
     
End Sub

Hope this helps, if not, let me know.
Todd
 
Thanks a lot.
You got all the assumptions right, I'm fitting the code into Acad.
I only had one problem:

Dim lngEntHnd As Long ' Entity Handle

I changed it from Long to a String.

Thanks for the help.
I'm now trying to transfer it into an Access database.
 
Well, I can't get this to work :(

The connection between Access isn't working so now I'll save the information into an Excel file, at least I'm trying to.

Anyone got some suggestions about this ?
 
Ok, I finally have everything working.

I created a standard table in Access, and everytime I run my code, it clears the Table and adds the new info.
Now I have all the items I want and I can work with this.
I converted the ACI code to a RGB color and added the names to it.
It works, and I'm very happy with it, BUT..... :)

I want to add additional information to each entity, but there isn't a function for it (at least I can't find it)
The information I want to add is which handling must be added to the process, for instance a CNC action.

Can I add the info in autocad to each entity ? Or do I need to add attributes ?
I want to make the input of information as easy as possible, and, if possible, connect it to the Entity handle.
 
Bart,

Sorry for the late reply, just got back from vacation...

If you haven't already figured out your Access trouble, post back an I'll give you a hand, same with your AutoCAD entity info.

Todd
 
Hello Todd,

Thanks for the Reply.
I got it working now, You can add the information to each entity, I added 2 lines for that, one to name the object, and one to add a number of the process. Only when all the entity's got additional information you can export it into Access. This is just a little coding that has to be done.

All the information is then xsable in Access, so everyone can create their own bills.

Thanks a lot for your help.
 
This is exactly what you need and it is ready to go.

SmartLister, including SmartModeling, normally costs $1,195.00, but you can buy it now for only $100.00.

Conditions

1. In order to take advantage of this great limited time offer you must provide us with a receipt for the purchase of a machine or software for $500.00 or more dated within the last 5 years with your company's name on it.

2. This promotional offer does not include a year worth of updates for free. If you wish to have your software updated with new releases, you can purchase the maintenance package for $195.00 at any time.

3. Your order must be received over the phone.

4. This offer can end at any time, without notice.

5. SmartListerDemo must work on your machine before you order. This is to insure the software will not have any compatibility problems

6. This includes up to one hour of technical support on the phone for setup and a basic walk through of the software.

7. You must watch all the video tutorials on our Video Tutorials page.

8. All amounts are in United States currency.

9. We reserve the right to refuse sales for any reason.


Click here to view a 2 1/2 minute overview video on SmartLister.

SmartLister will automatically measure your selected 3D AutoCAD® solids and then quickly and easily create Bill of Materials, Cut Lists and Mill Lists. SmartLister will also allow you to control the visibility of objects independent of the use of layers.

SmartModeling, bundled with SmartLister, will allow you to easily stretch multiple 3D solids and assemblies in one operation, as well as move, copy, erase, mirror, array and copy-rotate multiple holes in multiple solids in one operation.

Automatically measuring multiple solids with orientation information, and stretching multiple solids are not found in any other CAD application.

SmartLister and SmartModeling give you the tools for design freedom, manufacturing and speed. You can throw away parametrics, formulas, rules and constraints. Your drawings stay in a native AutoCAD® format for collaboration with other trades. It is fast, easy, and only takes 20 minutes to learn!

SmartLister is a straightforward no-nonsense approach that actually works today.

What could be simpler and more straight-forward then just drawing the objects you want, stretching them if you need to change their size, and then automatically measuring them to create a cut list?. Detailing can actually be a fun and fulfilling job. We put creativity and functionality back in your hands, where it belongs.
--
David Wishengrad
President & CTO
MillLister, Inc.
Software for BOM, measuring, stretching and controlling visibility of multiple 3D solids.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top