明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1644|回复: 2

[求助] 如何获取当前显示的工具栏列表?

[复制链接]
发表于 2004-10-25 11:40:00 | 显示全部楼层 |阅读模式
如何获取当前显示的工具栏列表?请大虾们指点指点,
发表于 2004-10-25 14:35:00 | 显示全部楼层
; -- Function VxGetToolbars
; Returns a list with all Menugroups, ToolbarID's and their IsVisible property.
; Copyright:
; ?000 MENZI ENGINEERING GmbH, Switzerland
; Arguments [Typ]:
; --- =
; Return [Typ]:
; > Nested dotted pair list:
; '(("MenuGroup" . '(("ToolbarID" . IsVisible)...))...) [LIST]
; Notes:
; - If you want to list the menu names in place of the ID's,
; change the property vla-get-TagString to vla-get-Name, see *)
; - Use a DocManagerReactor with a 'vlr-documentToBeDestroyed'-event
; to release the Gb:AcO object at the end of a AutoCAD session
; - otherwise AutoCAD maybe crashes...
;
(defun VxGetToolbars (/ TlbLst TmpLst)
(or Gb:AcO (setq Gb:AcO (vlax-get-acad-object)))
(vlax-for Grp (vla-get-MenuGroups Gb:AcO)
(setq TmpLst '())
(vlax-for Tlb (vla-get-Toolbars Grp)
(setq TmpLst (cons
(cons
(vla-get-TagString Tlb) ;*)
(if (= (vla-get-visible Tlb) :vlax-true)
1
0
)
)
TmpLst
)
)
(vlax-release-object Tlb)
)
(setq TlbLst (cons
(cons
(vla-get-Name Grp)
(reverse TmpLst)
)
TlbLst
)
)
(vlax-release-object Grp)
)
(reverse TlbLst)
)
 楼主| 发表于 2004-10-25 16:15:00 | 显示全部楼层
谢谢斑竹,真是茅塞顿开。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-9-30 10:18 , Processed in 0.161366 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表