Isn't there a DATAEXTRACTION command in 2009? This command extracts data and sends it to a table or an external file such as an Excel spreadsheet.
Registered forum members do not see this ad.
Hi everyone,
I would like to read a table that would be linked with block attributes. Like a table (either AutoCAD or Excel) of fluids with pressure, temperature, flowrate... that I would link to attributes. I tried to insert a field in the attribute, but what I've found in fields are properties like Color/Layer/Column/Rows ... Anyone could help?
Guiboard
Isn't there a DATAEXTRACTION command in 2009? This command extracts data and sends it to a table or an external file such as an Excel spreadsheet.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
I know about Data extraction, which extracts block attributes into Excel/AutoCAD table. But is the opposite possible? Extracting data from a table into blocks via fields?
Edit: I found it by myself! It had to insert a field; Field category - Object // Field names: Formula. There are 4 buttons: Average/Sum/Count/Cell . Using cell I could pick an AutoCAD table cell.
But I still have 1 question,
Is there a way to link via an Excel table?
Last edited by Guiboard; 24th Aug 2010 at 03:03 pm.
hi there
i am also intrested in the same.
i have made a VBA code to import data from excel which can be extended for the required purpose
if you tell me some thing more may be i can help you.Code:Sub markdupfromxl() Dim xlApp As Object Dim xlFileName As String Dim getval(), getval1() As String Dim obj, entRef As AcadBlockReference Dim instPt() As Double Dim a, b As Integer xlFileName = "C:\Documents and Settings\divekark\Desktop\test duplicates.xls" Set xlApp = CreateObject("Excel.Application") xlApp.Visible = False Set xlbook = xlApp.workbooks.Open(xlFileName) Set xlSheet = xlbook.Sheets(1) a = xlSheet.UsedRange.Rows.Count ReDim getval(a), getval1(a) For b = 0 To a - 2 Set myrng = xlSheet.Range("A1") getval(b) = myrng.Offset(b + 1, 0).Value getval1(b) = myrng.Offset(b + 1, 1).Value Set obj = ThisDrawing.HandleToObject(getval(b)) instPt = obj.InsertionPoint Set entRef = ThisDrawing.ModelSpace.InsertBlock(instPt, "flage2", 1#, 1#, 1#, 0) If entRef.HasAttributes Then Dim AttList As Variant ' Build a list of attributes for the current block. AttList = entRef.GetAttributes ' Cycle throught the list of attributes. For j = LBound(AttList) To UBound(AttList) If AttList(j).TagString = "FLAGTEST" Then AttList(j).TextString = getval1(b) End If Next End If Next xlbook.Close xlApp.Quit Set xlbook = Nothing Set xlSheet = Nothing ThisDrawing.Activate End Sub
Registered forum members do not see this ad.
I had a similar post on this forum, which I got an answer.
http://www.cadtutor.net/forum/showth...data-Via-field
Thanks for the VBA routine, but I've been using an add-on for solving my problem.
Bookmarks