乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 77|回复: 2

[编程交流] vba - MISSING: AcPreview Activ

[复制链接]

28

主题

130

帖子

126

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
154
发表于 2022-7-6 17:12:31 | 显示全部楼层 |阅读模式
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
 
  1. 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
回复

使用道具 举报

28

主题

130

帖子

126

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
154
发表于 2022-7-6 18:08:22 | 显示全部楼层
Dont worry guys i have got my hands on the acpreview.ocx
 
Thanks heaps
回复

使用道具 举报

28

主题

130

帖子

126

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
154
发表于 2022-7-6 18:34:55 | 显示全部楼层
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
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 16:43 , Processed in 0.344998 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表