Jump to content

Recommended Posts

Posted

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???

Posted

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

Posted

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

Posted

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

Posted

here is a txt file of my attribute code. For some reason I cant post the entire code in the code tags

plog.txt

Posted

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

Posted

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

Posted

will this list all block in current drawing and the plot them to a excell sheet or only the one that have specific names?

Posted

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.

Posted

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"

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...