乐筑天下

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

vb中创建CAD TOOLBAR出错,请高手指点

[复制链接]

7

主题

9

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2006-9-15 03:04:00 | 显示全部楼层 |阅读模式
CAD原代码
Private Sub AddToolbar()
    ' This example creates a new toolbar called TestToolbar and inserts a
    ' toolbar button into it. The toolbar is then displayed.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.
   
    Dim currMenuGroup As AcadMenuGroup
    Set currMenuGroup = acadDoc.Application.MenuGroups.Item(0)  '调试后此行出错
   
    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")
   
    ' Add a button to the new toolbar
    Dim newButton As AcadToolbarItem
    Dim openMacro As String
   
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)
   
    Set newButton = newToolBar.AddToolbarButton("", "NewButton", "Open a file.", openMacro)
   
    ' Display the toolbar
    newToolBar.Visible = True
End Sub
在VB中运行后 提示 :
实时错误 ‘91’
对象变量或with块变量未设置
Set currMenuGroup = acadDoc.Application.MenuGroups.Item(0)  '调试后此行出错

问题已解决  谢谢
问题已解决  谢谢
问题已解决  谢谢
问题已解决  谢谢
问题已解决  谢谢
回复

使用道具 举报

1

主题

113

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
117
发表于 2006-9-15 12:59:00 | 显示全部楼层
把acadDoc改为 thisdrawing 试试
回复

使用道具 举报

7

主题

9

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2006-9-15 14:22:00 | 显示全部楼层
晕~~~ 是在VB6.0里面啊 不是VBA
mccad 在吗?能指点一下吗?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-6 13:05 , Processed in 1.218345 second(s), 58 queries .

© 2020-2025 乐筑天下

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