马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 qyming2000 于 2019-3-16 17:17 编辑
- (defun addToolbars (toolbarname lst /
- addtoolbar currmenugroup bitmap
- helpstring macro name
- newtoolbar newtoolbarbutton
- x toolbars
- )
- (defun addtoolbar (curtoolbar lst / name
- bitmap helpstring index x
- macro newtoolbarbutton
- )
- (setq index 0)
- (mapcar '(lambda (x / name macro bitmap helpString)
- (setq name (car x)
- macro (cadr x)
- bitmap (caddr x)
- helpstring name
- )
- (cond ((= name "--") (vla-addseparator curtoolbar index))
- (t
- (setq newToolbarButton
- (vla-addToolbarButton
- curtoolbar
- index
- name
- name
- (strcat (chr 3) (chr 3) macro (chr 32))
- )
- )
- (vla-setBitmaps newToolbarButton Bitmap Bitmap)
- (vla-put-helpString newToolbarButton helpString)
- )
- )
- (setq index (1+ index))
- )
- lst
- )
- )
- (setq currMenuGroup
- (vla-item (vla-get-menugroups (vlax-get-acad-object))
- 0
- )
- )
- (setq toolbars (vla-get-toolbars currMenuGroup))
- (if (setq newToolbar (vla-item toolbars toolbarname))
- (vla-delete newToolbar)
- )
- (setq newToolbar (vla-add toolbars toolbarname))
- (addtoolbar newToolbar lst)
- (vl-cmdf "_-toolbar" toolbarname "_bottom" "")
- )
- (addToolbars
- "文字工具"
- '(("文字合并" "wzhb" "wzhb.bmp")
- ("文字对齐" "wzdq" "wzdq.bmp")
- ("--")
- ("文字编号" "wzbh" "wzbh.bmp")
- )
- )
|