Author Topic: LOAD A CUIX  (Read 2333 times)

0 Members and 1 Guest are viewing this topic.

FELIX

  • Bull Frog
  • Posts: 242
LOAD A CUIX
« on: July 30, 2014, 10:35:17 AM »
ERRO A LOADING CUIX MENU BAR!

Code: [Select]
    Public Class COMMANDS
        <CommandMethod("LoadCUIX")> _
        Public Sub LoadToolbars()
            Const cuiname As String = "MYCUINAME"
            Const cuifile As String = "C:\TESTE\MYCUITESTE.cuix"
            Dim mg As AcadMenuGroup '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<ERRO COMPILATION
            Try
                MsgBox("Attempt to access our menugroup")
                mg = Application.MenuGroups.Item(cuiname)

            Catch ex As System.Exception
                MsgBox("Failure simply means we need to load the CUI first")
                Application.MenuGroups.Load(cuifile)
                mg = Application.MenuGroups.Item(cuifile) '<<<<<<<<<<<<<<<<<<<ERROR EXECUTE
            End Try
            MsgBox("Cycle through the toobars, setting them to visible")
            Dim i As Integer
            For i = 0 To mg.Toolbars.Count - 1
                MsgBox(i)
                mg.Toolbars.Item(i).Visible = True
            Next
        End Sub
    End Class
End Namespace
OK.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: LOAD A CUIX
« Reply #1 on: July 30, 2014, 10:45:19 AM »
What errors are you seeing?

FELIX

  • Bull Frog
  • Posts: 242
Re: LOAD A CUIX
« Reply #2 on: July 30, 2014, 11:34:10 AM »
1-> Dim mg As AcadMenuGroup '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

2-> mg = Application.MenuGroups.Item(cuifile) '<<<<<<<<<<<<<<<<<<<ERROR EXECUTE
OK.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: LOAD A CUIX
« Reply #3 on: July 30, 2014, 11:58:51 AM »
Felix, what is the error given? I saw where you are getting the error, but you do not say WHAT the error is.

FELIX

  • Bull Frog
  • Posts: 242
Re: LOAD A CUIX
« Reply #4 on: July 30, 2014, 12:15:14 PM »
is complicated to explain, you have no way to test? would be easier.
OK.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: LOAD A CUIX
« Reply #5 on: July 30, 2014, 12:52:23 PM »
Your mixing COM AcadApplication with Application class methods.

Quote from: Alexander.Rivilis
Last version of AutoCAD which allow to save  menugroup with COM interface was 2005.
Autodesk.AutoCAD.Customization help you customize menugroup for AutoCAD 2007+
ObjectARX SDK: samples\dotNet\CuiSamp (ObjectARX SDK 2008 and 2009)
http://forums.autodesk.com/t5/NET/AcadMenuGroup-Menu-group-edit-not-saving/td-p/3094282

FELIX

  • Bull Frog
  • Posts: 242
Re: LOAD A CUIX
« Reply #6 on: July 30, 2014, 03:26:00 PM »
THANK YOU.
OK.

Locke

  • Guest
Re: LOAD A CUIX
« Reply #7 on: July 30, 2014, 03:44:18 PM »
Nice call Jeff.