Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute to Excel

13 REPLIES 13
Reply
Message 1 of 14
Anonymous
225 Views, 13 Replies

Attribute to Excel

With autolisp, is there a way to extract a certain attribute and place it in an Excel spreadsheet. Also, is there a way to determine which field in Excel the value can be placed??

Thanks for any help.
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: Anonymous

Yes, by using the tag strings in the attributes. I'm not really
good with macros, but ours looks like this:

Assembly:
'RowNum = 2
For Each elem In mspace
With elem
If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
If .HasAttributes Then
Array1 = .GetAttributes
RowNum = RowNum + 1
For Count = LBound(Array1) To UBound(Array1)
'excelSheet.Cells(RowNum, Count + 1).Value = Array1(Count).textstring
' The following lines will save the value of each arrays textstring and _
write it to the selected row and column. To put this macro back to the way _
it was originally, just comment the following lines and un-comment _
the above single line.(k.a. 1-15-98)
mknum = Array1(0).TextString
tagstring = Array1(Count).tagstring
If tagstring = "PART/DWG" Or tagstring = "DWG#" Then 'Found the Title Block
RowNum = RowNum - 1
GoTo 15
End If
If tagstring = "TAG" Then ' found a Machine Mark Block
RowNum = RowNum - 1
GoTo 15

Our Excel sht headers match the tags in the attributes of the bill of materials. I can send you the entire excel file with the macro if you'd like. Just let me have your e-mail. Maybe you
can look at it and tell more. HTH 🙂
Message 3 of 14
Anonymous
in reply to: Anonymous

Can the same be accomplished with lisp ??
Message 4 of 14
Anonymous
in reply to: Anonymous

sorry, didn't see that part of the question. Let me investigate
that part a little bit. I'm not sure because we've always just used the macro.
Message 5 of 14
Anonymous
in reply to: Anonymous

thanks
Message 6 of 14
Anonymous
in reply to: Anonymous

We have Lisp I will share that outputs a (.csv) file. Double-Click for Excel. In the Lisp, we stack the 'extracted' values, concat the string, wrap each with a chr(34) ("), and output to the parts.csv file. Give me an E-Mail at: ec-cad@centurytel.net I will upload Lisp.
Bob Shaw
Message 7 of 14
Anonymous
in reply to: Anonymous

http://tinyurl.com/2ba9w searched for excel and came up with 112 topics http://tinyurl.com/2gprq searched for excel and came up with almost 1000 topics Surely one of them will help you. -- -Jason Member of the Autodesk Discussion Forum Moderator Program "jclaidler" wrote in message news:9080402.1071750828238.JavaMail.jive@jiveforum2.autodesk.com... > With autolisp, is there a way to extract a certain attribute and place it in an Excel spreadsheet. Also, is there a way to determine which field in Excel the value can be placed?? > > Thanks for any help.
Message 8 of 14
Anonymous
in reply to: Anonymous

HTH Marco
Message 9 of 14
Anonymous
in reply to: Anonymous

How do you get this to work ??
Message 10 of 14
kozmos
in reply to: Anonymous

In fact, doing this need ActiveX, so former AutoLISP can not do it. but Visual LISP can do.
you may go to www.ikzomos.com to download OAsis-XLS and try the API. A very simple way in data exchange between Visual LISP & Excel
Message 11 of 14
Anonymous
in reply to: Anonymous

I think this is a good start (gratis). -- ________________________________________________ Marc'Antonio Alessi (TV) Italy (strcat "NOT a " (substr (ver) 8 4) " guru.") O.S. = XP Pro 2002 - Sp.1 - Ita AutoCAD = 2004 Ita - Sp.1 ________________________________________________ "jclaidler" ha scritto nel messaggio news:14085837.1071805157074.JavaMail.jive@jiveforum1.autodesk.com... > How do you get this to work ??
Message 12 of 14
Anonymous
in reply to: Anonymous

That site can't be found... is it www.ikzomos.com ???
Message 13 of 14
Anonymous
in reply to: Anonymous

I did a little digging around and found the correct spelling: www.ikozmos.com.
Message 14 of 14
kozmos
in reply to: Anonymous

Yes, i got a wrong type, the correct one should be
http://www.ikozmos.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost