Ahankhah Posted April 24, 2011 Posted April 24, 2011 What is the symbol for Toolbar menus in menucmd:unsure:? As I remember, there was no toolbar menu when the function established, and even now there is no extensions about toolbar menus, palettes and ribbons:?. Is there any other way to manipulate toolbars visibility through AutoLISP? Any help is appreciated. Quote
Lee Mac Posted April 24, 2011 Posted April 24, 2011 Look into the Toolbars Collection of a specific Menu Group. For example to retrieve the Collection of all Toolbars in the ACAD MenuGroup: (vla-get-toolbars (vla-item (vla-get-menugroups (vlax-get-acad-object)) "ACAD")) Then, to look at specific Toolbars within that Collection: (vla-item (vla-get-toolbars (vla-item (vla-get-menugroups (vlax-get-acad-object)) "ACAD") ) "Modify" ) Which returns a Collection of ToolbarItems within that Toolbar, we can investigate each item and separator also: (vla-item (vla-item (vla-get-toolbars (vla-item (vla-get-menugroups (vlax-get-acad-object)) "ACAD") ) "Modify" ) "Erase" ) [ Note that in all of these examples we could have iterated through the collection using vlax-for ] Each ToolbarItem Object (and indeed, each of the Collection Objects) have associated properties and methods which you can investigate either using the VLIDE Help Documentation or the vlax-dump-object function. Lee Quote
Ahankhah Posted April 24, 2011 Author Posted April 24, 2011 Thanks a lot Lee, that is a very good tutorial, but still one question remains: How is it possible to show a toolbar in screen (set visible attribute to it)? Quote
Ahankhah Posted April 24, 2011 Author Posted April 24, 2011 Lee, I just find the answer in this thread: Opening a toolbar with Lisp or VBA in 2009? Many thanks to ASMI. Quote
Lee Mac Posted April 25, 2011 Posted April 25, 2011 How is it possible to show a toolbar in screen (set visible attribute to it)? Did you investigate the properties and methods of each of the objects described above? Quote
Ahankhah Posted April 25, 2011 Author Posted April 25, 2011 (edited) Did you investigate the properties and methods of each of the objects described above?Of course yes:).The biggest problem for me is the lack of a help for them (something like Visual LISP help). Edited April 25, 2011 by Ahankhah Quote
Lee Mac Posted April 25, 2011 Posted April 25, 2011 Of course yes:).The biggest problem for me is the lack of a help for them (something like Visual LISP help). I'm not sure if ADesk removed the VBA help from the VLIDE Help Docs in ACAD2012, but certainly in 2010, almost every property/method has documentation. Hence, after a little investigation of the Toolbar Object, we notice: ; IAcadToolbar: An AutoCAD toolbar ; Property values: ; Application (RO) = #<VLA-OBJECT IAcadApplication 00be91b4> ; Count (RO) = 17 ; DockStatus (RO) = 3 ; FloatingRows = 1 ; Height (RO) = 490 ; HelpString = "Modify Toolbar\n " ; LargeButtons (RO) = 0 ; left = 0 ; Name = "Modify" ; Parent (RO) = #<VLA-OBJECT IAcadToolbars 19a54f5c> ; TagString (RO) = "ID_TbModify" ; top = 0 [color=red]; Visible = -1[/color] ; Width (RO) = 32 ; Methods supported: ; AddSeparator (1) ; AddToolbarButton (5) ; Delete () ; Dock (1) ; Float (3) ; Item (1) And so the associated function would be (vla-put-visible <object> <:vlax-true / :vlax-false>) Quote
Ahankhah Posted April 25, 2011 Author Posted April 25, 2011 Dear Lee, I appreciate your help, as always. 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.