.NET

Reply
Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 1 of 4 (362 Views)

Ribbon load at startup

362 Views, 3 Replies
12-08-2012 10:39 AM

Hi there,

I have been using the ribbon api to create my custom ribbon.  I am

now attempting to load said rribbon at startup by placing the load

command into the initialize componant.  It isn't working.

Does any on have any ideas?

 

 

 Dim ribCntrl As Autodesk.Windows.RibbonControl = Autodesk.Windows.ComponentManager.Ribbon
        If ComponentManager.Ribbon Is Nothing Then
            Return
        End If

        For i As Integer = 0 To ribCntrl.Tabs.Count - 1
            If ribCntrl.Tabs(i).Id.Equals("My_Rib_ID") Then
                Return
            End If
        Next

        'add the tab
        Dim ribTab As New RibbonTab()
        ribTab.Title = "My New ribbon
        ribTab.Id = "My_Rib_ID"
        ribCntrl.Tabs.Add(ribTab)

        'create and add the panels
        addPanel1(ribTab)
        addPanel2(ribTab)
        addPanel3(ribTab)
        addPanel4(ribTab)
        addPanel5(ribTab)
        addPanel6(ribTab)
        addPanel7(ribTab)

        'set as active tab
        ribTab.IsActive = True

 

I seem to remember being told it's because the ribbon .dll hasn't yet started

at this point sso it has nothing to use to load it?

 

Any help would be appreciated.

 

Ta,

 

Maritn.

My name is Martin.. :smileyvery-happy:
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 2 of 4 (352 Views)

Re: Ribbon load at startup

12-08-2012 12:09 PM in reply to: quigs

If the ribbon isn't loaded when your plug-in loads, you shouldn't try to load it.

 

When your plug-in loads, if it doesn't find the ribbon loaded, then you should add a handler to the RibbonService's RibbonPaletteSetCreated event. When the user activates the ribbon, your handler will be called and you can add your stuff then.

Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 3 of 4 (342 Views)

Re: Ribbon load at startup

12-08-2012 03:53 PM in reply to: DiningPhilosopher

Hi,

the ribben itself loads fine with the above code.  But loading at startup ecapes me.

I can't seem to work it out?

My name is Martin.. :smileyvery-happy:
ADN Support Specialist
Balaji_Ram
Posts: 666
Registered: ‎03-21-2011
Message 4 of 4 (303 Views)

Re: Ribbon load at startup

12-11-2012 02:58 AM in reply to: quigs

Hi Martin,

 

Have you tried using the “Autodesk.Windows.ComponentManager.ItemInitialized” event as in this forum post ?

 

http://forums.autodesk.com/t5/NET/Autoloader-problem/td-p/3083488



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community