PDA

View Full Version : material list



tihs-ho
01-09-2004, 07:35 PM
anyone have suggestion in automating material list or bill of material? or lisp routines?

architech
01-09-2004, 09:23 PM
See link below.
I'd look at the same softwares suggested here.

http://www.autocadeverything.com/phpBB/ftopic518.php

:mrgreen:
Later guy.

solarBreeze
08-09-2004, 02:32 PM
do you want to create a spreadsheet, or link to access?


My programming skills are pretty poor, but I've written a couple of functions in VBA to run to excel.

This will export all your blocks and attributes to a spreadsheet
(if you're lucky). I have had problems with it, and you will need to put some formatting in

but maybe something in this will help

good luck





Private Sub CommandButton3_Click()
'this function will launch excel and create certain sheets


Dim Excel As Object
Dim elem As Object
Dim excelSheet As Object
Dim defaultname As String
Dim tryit As String
Dim element As Object
Dim ArrayAttributes As Variant
Dim I As Integer
Dim rows, cols As Integer

Dim block As AcadBlockReference


defaultname = ("hello")
MsgBox ("This is export all the blocks and attributes in your drawing to excel. X-reffed data is ignored")


' Start Excel
' On Error Resume Next

' Set Excel = GetObject(, "Excel.Application")
Me.ListBox1.AddItem ("About to Create a Spreadsheet")

Set Excel = CreateObject("Excel.Application")

Excel.Visible = True
Excel.Workbooks.Add

Me.ListBox1.AddItem ("About to Creating worksheet " & ThisDrawing.Name & ".xls")

Excel.Sheets("Sheet1").Select
Set excelSheet = Excel.ActiveWorkbook.Sheets("Sheet1")


Excel.ActiveWorkbook.Sheets("Sheet1").Name = ThisDrawing.Name


'excelSheet.SaveAs (ThisDrawing.Name & ".xls")

rows = 1
cols = 1



With excelSheet
.cells(rows, cols).Value = "Attribute Spreadsheet for " & ThisDrawing.Name

.cells(rows + 2, cols).Value = "Start of Data Transfer"
'this is the start of data transfer
.cells(5, 1).Value = "Block Name"

For cols = 1 To 14
.cells(5, cols).Value = "Field " & cols


Next


rows = 5
cols = 1


Me.ListBox1.AddItem ("Refreshing Data, researching for data")


For Each element In ThisDrawing.ModelSpace

If element.EntityType = 7 Then 'Test if it is a block
Set block = element
rows = rows + 1

If element.HasAttributes = True Then 'Test if block has attributes
cols = 1

.cells(rows, cols).Value = block.Name





ArrayAttributes = element.GetAttributes
cols = 2

For I = LBound(ArrayAttributes) To UBound(ArrayAttributes)

.cells(rows, cols).Value = (ArrayAttributes(I).TextString)
cols = cols + 1

Next
End If
End If
Next


End With









End Sub

mom of 3
08-09-2004, 04:28 PM
ok, a couple questions here.......... :?: :?:
where would I enter all this information so that this would work?
(I'm technologically illiterate) :oops:
would this work from excel to Acad2004?
if I change the info in excel, will it automatically change in the drawing?
can I just have of you technologically literate people just fly out here & do it for me??????????? :?
(yeah, the last part was a joke....HA HA..........)
:mrgreen:

csiarch
08-09-2004, 05:23 PM
Look at the attached.......

Re: Someone else doing it for you; $50 US per hour + $500 up front for me to do it.

mom of 3
08-09-2004, 07:05 PM
Re: Someone else doing it for you; $50 US per hour + $500 up front for me to do it.

:?
ok, I think when my boss gets back on Fri, I'll have him put this in the budget for me............I'm totally confused. :oops:

I basically have to create an attribute first, then create a spreadsheet to read the info from the attribute????? do I at least understand that correctly?
so then, once I unscramble my brain enough to get both of them created (that'll be next century sometime..........), any change I make in the spreadsheet will carry over to the drawing........???????? :?

:roll: <------ I know that's what y'all are doing now........I just don't get along with computers at all......that's why I prefer hand drafting...... :oops:
(at least I'm trying to understand this whole computer thing...............)

csiarch
08-09-2004, 07:45 PM
Dreibelbis: One thing I might suggest is that you consider that YOU are the master and the computer is the slave. YOU tell the slave what to do and it does it -if it understands what you're telling it to. Maybe it's simply a communication issue.

Open up and read the attachment I posted. I wrote these instructions because the user manual isn't as clear as it could be on these things.

If you still are having trouble after reading the attachments, we can discuss further. It's not that hard to do once you've tried out it out a few times.

Bear in mind that the instructions in the attachments were written for R14 users but the same principles should apply.

tihs-ho
09-09-2004, 03:41 PM
Thanks for your great suggestions. I used the Attribute Extract command -(EAttExt) which extracts attribute information from blocks and create a separate text file. I then created a new layout with viewport locked into this txt in paper space, so every time I update my drawing EattExt command automatically update my Material List.

This command also allows you to creates a template file and extract only information you need.

TIP: You can use custom toolbar to create button for this task to make it easy for you, but make sure to add change txt style on your macro because EattExt uses only current txt style. see below. Another button to move the info to certain location where viewport is zoomed to.

^C^C_text;style;standard;0,0;;;EAttExt
:wink:

csiarch
10-09-2004, 02:42 AM
tihs-ho: I haven't extracted any data since a project using R14 therefore am not up to speed on features added in 2002.

Since I'm self-taught back to r10, my brain doesn't relate to customization features available in newer versions. Old habits about typing everything in are hard to break, I guess.

I do appreciate your expansion on the attribute extraction procedures...guess I'll have to try it out on '02 and see what kind of trouble I can get in to.
Cheers!