- 积分
- 11502
- 明经币
- 个
- 注册时间
- 2002-10-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 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) ) |
|