Jump to content

vba - MISSING: AcPreview ActiveX Control Module


Recommended Posts

Posted

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.

 

Please help Cheers

 

Here is the code

 

Option Explicit
Dim 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 String
Dim elem As Object
Dim filenom As String
Dim WholeFile As String
Dim newHeight As Double
inDir = "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 vbCrLf
Loop
Set objDbx = Nothing
End Sub

Posted

Dont worry guys i have got my hands on the acpreview.ocx

 

Thanks heaps

Posted

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

 

That would be unreal.

 

Also maybe to change the attribute values

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