dave buckberry Posted November 10, 2008 Posted November 10, 2008 can any one help me i am looking for some vba code that will export all the attributes and the tag information to a database or text file from the active drawing but i dont want to use autocads version??? Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 what do you have so far? what language are you looking for? I have that in VBA that exports to a txt file or excel ss Quote
dave buckberry Posted November 11, 2008 Author Posted November 11, 2008 just starting out looking at this problem but help in both formats would be great vba would be better than lisp as i have more trouble reading that than vba Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 Example code to write to a file Public Sub ExPortLayers() Dim strLayer As String Dim strPlotStyle As String Dim strOnOff As String Dim strFrozenThaw As String Dim objLayer As AcadLayer Open "C:\LayerExport.txt" For Append Access Write As 1 Write #1, " " Close #1 For Each objLayer In ThisDrawing.Layers strLayer = objLayer.Name strPlotStyle = objLayer.PlotStyleName strOnOff = objLayer.LayerOn strFrozenThaw = objLayer.Freeze Open "C:\LayerExport.txt" For Append Access Write As 1 Write #1, strLayer & "," & Mid(strPlotStyle, 7) & "," & strOnOff & "," & strFrozenThaw Close #1 Next End Sub Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 here is a txt file of my attribute code. For some reason I cant post the entire code in the code tags plog.txt Quote
dave buckberry Posted November 11, 2008 Author Posted November 11, 2008 thanks for that i will look at the code you have sent me and see if i can get my head round it many thanks Quote
dave buckberry Posted November 11, 2008 Author Posted November 11, 2008 hi i have had a look at the code but i cant understand it could you show me the form that it is refrencing to get a better picture of what it is getting as data from that form as i am new to this i would help me understand it better thanks Quote
dave buckberry Posted November 11, 2008 Author Posted November 11, 2008 will this list all block in current drawing and the plot them to a excell sheet or only the one that have specific names? Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 It only looks for my titleblock info block, which is named titlinfo or vtitlinfo, or a few others in that list. The form is just passing a string to use as a filename to open in excel. Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 these are my titleblocks Im looking for intType(0) = 0: varData(0) = "INSERT" intType(1) = 2: varData(1) = "TITLINFO,VTITLINFO,8.5x11_BDR,vinfo,SNL-TITLINFO" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.