how to save changes made to Acad setting

Discussion in 'AutoCAD' started by Soe, Jul 10, 2003.

  1. Soe

    Soe Guest

    i get instance of Acad application (by getobject or createobject), then
    modify ( add in toolbar button) then quit (also use update).
    when i open Acad again, the added icon doesn't not appear.
    anybody can help?
     
    Soe, Jul 10, 2003
    #1
  2. You have to capture the menu object and save it with a recompile.
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jul 14, 2003
    #2
  3. Soe

    Soe Guest

    i don't get it
    can u help to explain a little bit more.
    currently i hv updated direct to menugroups.toolbars.
    thanx.
     
    Soe, Jul 15, 2003
    #3
  4. Here Soe, maybe this will make more sense:
    Sub AddButton()
    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add a button to the new toolbar
    Dim newButton As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(32)
    Set newButton = newToolBar.AddToolbarButton _
    ("", "NewButton", "Open a file.", openMacro)
    'Save new button to menu file
    currMenuGroup.Save acMenuFileCompiled
    End Sub
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jul 15, 2003
    #4
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.