Tool Bar Names

Discussion in 'AutoCAD' started by BillZ, Apr 26, 2004.

  1. BillZ

    BillZ Guest

    R2005 Vlisp:

    I am looking for a way to get a list of tool bar names. The same names as they are listed on the right click menu when you right click on a tool bar.

    TIA

    Bill
     
    BillZ, Apr 26, 2004
    #1
  2. Hi Bill,

    How about this:

    ; retrieve a menugroup object from the menugroup collection
    ; Arguments:
    ; [groupName] - string, menugroup name
    ; return: vla-object, if successful
    (defun getMenugroup (groupName)
    (vla-item (vla-get-menugroups *acad*) groupName) )


    ; function to retrieve all toolbar names
    ; from a given menugroup
    ; Argumnets:
    ; [menugroupName] - string, menugroup to search
    ; Return: list of strings
    (defun getToolbarNames (menugroupName / names)
    (vlax-for item (vla-get-toolbars (getMenugroup menuGroupName))
    (setq names (cons (vla-get-name item) names))
    )
    (reverse names)
    )

    --

    Autodesk Discussion Group Facilitator


    listed on the right click menu when you right click on a tool bar.
     
    Jason Piercey, Apr 26, 2004
    #2
  3. BillZ

    BillZ Guest

    Thanks Jason,
    That's exactly what I was looking for.
    I got as far as the (vla-get-toolbars menugroupName) before I posted but I couldn't see a name property when I vlax-dump- the tool bars object. I couldn't find anything in the help files about which of these vla-xxx functions are available for each object. Where are all these documented?
    I hope you don't say in the Vlide because I am really struggling to figure that thing out.

    Bill
     
    BillZ, Apr 26, 2004
    #3
  4. Must have been dumping the toolbar collection
    rather than the toolbar object?

    ; IAcadToolbar: An AutoCAD toolbar
    ; Property values:
    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00b9b5e4>
    ; Count (RO) = 1
    ; DockStatus (RO) = 4
    ; FloatingRows = 1
    ; Height (RO) = AutoCAD: The toolbar is invisible. Please make it visible
    ; HelpString = ""
    ; LargeButtons (RO) = 0
    ; left = 50


    ; Name = "NamedViews"


    ; Parent (RO) = #<VLA-OBJECT IAcadToolbars 19245f24>
    ; TagString (RO) = "ID_TbNamedView"
    ; top = 73
    ; Visible = 0
    ; Width (RO) = AutoCAD: The toolbar is invisible. Please make it visible
    ; Methods supported:
    ; AddSeparator (1)
    ; AddToolbarButton (5)
    ; Delete ()
    ; Dock (1)
    ; Float (3)
    ; Item (1)
    T


    --

    Autodesk Discussion Group Facilitator


    a name property when I vlax-dump- the tool bars object. I couldn't find anything in the
    help files about which of these vla-xxx functions are available for each object. Where
    are all these documented?
     
    Jason Piercey, Apr 26, 2004
    #4
  5. BillZ

    Jeff Mishler Guest

    One place is the AcitiveX & VBA Reference in the Acad help.
    The "Objects" Section lists the objects & collections you can access via
    vla-object, such as (vla-get-layers)
    The "Methods" section shows the methods applicable to the objects
    (vlax-invoke), (vla-xxx)
    The "Properties" section shows the properties that can be get/put to the
    objects (vlax-get, vlax-put),(vla-put-xxx, vla-get-xxx)

    From my experience, a vlax-dump will ALWAYS show the available properties
    (and methods if that option is set) of an object.

    In this case, you get the Name from each Item in the menugroups collection.

    HTH,
    Jeff

    couldn't see a name property when I vlax-dump- the tool bars object. I
    couldn't find anything in the help files about which of these vla-xxx
    functions are available for each object. Where are all these documented?
     
    Jeff Mishler, Apr 26, 2004
    #5
  6. BillZ

    BillZ Guest

    Thanks, but I don't find the letters vla- at all in the AcitiveX & VBA Reference. I know these languages are similar but it can be very confusing for the beginner to try to learn Vlisp by using the VBA guide.

    I can't even search for vla- in the Autolisp reference or developers guide and get any meaningful information that spells out what (vla-item or similar function does.

    I "get it" now. But if it wasn't for this NG...

    (setvar "rantmode" 0)

    Bill
     
    BillZ, Apr 27, 2004
    #6
  7. BillZ

    BillZ Guest

    Reply From: Jason Piercey
    Yep,

    Figured it out now. :)
    Thanks

    Bill
     
    BillZ, Apr 27, 2004
    #7
  8. Bill,

    If you want to search using a prefix, open VLIDE and push
    the Apropos button (the red "A" in a set of parenthesis).
    Now type in vla- and hit enter. Choose one of the functions
    listed and then push the help button on the Apropos window.
    You should be directed to the corresponding VBA function.

    --

    Autodesk Discussion Group Facilitator


    know these languages are similar but it can be very confusing for the beginner to try to
    learn Vlisp by using the VBA guide.
    meaningful information that spells out what (vla-item or similar function does.
     
    Jason Piercey, Apr 27, 2004
    #8
  9. BillZ

    Murph Guest

    Shouldn't that be
    (vla-put-rantmode "false")

    Murph
     
    Murph, Apr 27, 2004
    #9
  10. ah, that'd be :vlax-false ;)
     
    Jason Piercey, Apr 27, 2004
    #10
  11. BillZ

    BillZ Guest

    Arrg!

    I thought of that after I posted. :^)

    Bill
     
    BillZ, Apr 27, 2004
    #11
  12. BillZ

    BillZ Guest

    Thanks Jason,
    I'll just have to keep banging my head on that thing.

    Bill
     
    BillZ, Apr 27, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.