Hey guys on my pc the AcPreview ActiveX Control Module(This is the vba library) is missing and i was just wondering if anyone know how i can replace this because now i cant run a vba sub that was given to me.
Option ExplicitDim objDbx As AxDbDocument' Example of batch for listing all block names on all drawings in a directory.Private Sub ListBlockNames()Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17")Dim inDir As StringDim elem As ObjectDim filenom As StringDim WholeFile As StringDim newHeight As DoubleinDir = "c:\program files\autocad 2008\sample"filenom = Dir$(inDir & "\*.dwg")Do While filenom "" ThisDrawing.Utility.Prompt vbCrLf & "File: " & filenom ThisDrawing.Utility.Prompt vbCrLf & "-----------------" WholeFile = inDir & "" & filenom objDbx.Open WholeFile For Each elem In objDbx.Blocks If elem.IsXRef = False And Left(elem.Name, 1) "*" Then ThisDrawing.Utility.Prompt vbCrLf & elem.Name End If Next Set elem = Nothing filenom = Dir$ ThisDrawing.Utility.Prompt vbCrLfLoopSet objDbx = NothingEnd Sub
The above code i posted will list all blocks within a set of drawings without opening them - does anyone know how to improve it so it will also list the attribute values of any attributes within blocks aswell??