mohammadreza Posted September 14 Posted September 14 hello friends, what is wrong with my code? (defun c:zaz () (if (tblsearch "DRAW") (command "-toolbar" "draw" "hide") (command "-toolbar" "draw" "show") ) (princ) ) Quote
mohammadreza Posted September 14 Author Posted September 14 5 minutes ago, rlx said: tblsearch what, block, layer? i want to know about toolbar (draw) Quote
rlx Posted September 14 Posted September 14 (edited) (vlax-for mnu (vla-get-menugroups (vlax-get-acad-object)) (vlax-for tlb (vla-get-toolbars mnu) (if (= (vla-get-visible tlb) :vlax-true) (setq tlb_lst (cons (vla-get-name tlb) tlb_lst)) ) ) ) with this you can built list of visible toolbars. If draw is member of list tlb_lst its visible , if not a member its hidden... Edited September 14 by rlx Quote
mohammadreza Posted September 14 Author Posted September 14 31 minutes ago, rlx said: (vlax-for mnu (vla-get-menugroups (vlax-get-acad-object)) (vlax-for tlb (vla-get-toolbars mnu) (if (= (vla-get-visible tlb) :vlax-true) (setq tlb_lst (cons (vla-get-name tlb) tlb_lst)) ) ) ) with this you can built list of visible toolbars. If draw is member of list tlb_lst its visible , if not a member its hidden... actually my goal is to control toolbar "draw" if draw is active, inactive that if the draw is inactive, active it !!! i dont know how to use ur code ? Quote
rlx Posted September 14 Posted September 14 ;;; toggle draw toolbar (defun c:tdtb ( / lst ) (vlax-for mnu (vla-get-menugroups (vlax-get-acad-object)) (vlax-for tlb (vla-get-toolbars mnu) (if (= (vla-get-visible tlb) :vlax-true) (setq lst (cons (vla-get-name tlb) lst))))) (if (member "Draw" lst) (command "-toolbar" "Draw" "Hide") (command "-toolbar" "Draw" "Show") ) ) 3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.