crwncad702 Posted June 29, 2010 Posted June 29, 2010 Has anyone played around with creating custom ribbons via .Net? I have been able to create a whole new panel and add all of my own custom buttons/pics, but I am trying to find some references on how to manipulate the layout a bit more. I am specifically looking for ways of adding custom rows and stuff like that. Hopefully when I am done I will have a completely custom panel with rows, dropdowns and other cool stuff Quote
Guest fro2001 Posted June 30, 2010 Posted June 30, 2010 Go to au online and check out this class Creating a Ribbon Bar for AutoCAD with VBNET Class CP208-2 Quote
crwncad702 Posted June 30, 2010 Author Posted June 30, 2010 The only problem with that tutorial is that it is specifically for 2009. I follow a similar course from the same guy, but he never goes in depth for actual row items. Additionally, with Kean's Through the Interface blog, he is using something like the following, and again only 2009: dim ribRow as RibbonRow = New RibbonRow() but with 2011 (and 2010 I assume from posts on the autodesk forums) there is no RibbonRow. Right now I have been trying something like: dim ribSrcPnl as RibbonSourcePanel = New RibbonSourcePanel dim ribCustomPnl as RibbonPanel = New RibbonPanel() dim ribCustomRow as RibbonRowPanel = New RibbonRowPanel() ... ribCustomPnl.Items.Add(ribCustomRow) With that I have tried adding my custom buttons to the custom row panel, but they do not come out in rows, and they just get added to the ribbon like normal buttons. Any other ideas? Quote
crwncad702 Posted July 1, 2010 Author Posted July 1, 2010 Well, after a long bit of trial and error, I have finally been able to work out some of my ribbon issues... I am pretty sure that there are others like myself who are trying to get ribbon rows to work in 2011, and if you are one of them I hope the following info will help.... dim ribSrcPnl as RibbonSourcePanel = New RibbonSourcePanel dim ribCustomPnl as RibbonPanel = New RibbonPanel() dim ribCustomRow as RibbonRowPanel = New RibbonRowPanel() dim ribCustomBrk as RibbonRowBreak = New RibbonRowBreak() ... ribCustomPnl.Items.Add(ribCustomRow) ... ADD YOUR BUTTONS HERE ... ribCustomRow.Items.Add(ribCustomBrk) ... ADD SOME MORE BUTTONS ... ribCustomRow.Items.Add(ribCustomBrk) ... ADD SOME MORE BUTTONS ... Now if you look at the image I have attached, I have three rows in my panel, and a total of 8 buttons. I have placed my row breaks after the first 3 buttons, and then again after 3 more to create my first two rows, and the third row comes in with no need for an additional break. The one item that you may notice right away though is the lack of uniformity for my button widths, but even after physically setting the sizes they still come out as you see... Hopefully this will be quicker to figure out than these silly rows. Quote
crwncad702 Posted July 1, 2010 Author Posted July 1, 2010 Well, after thinking that I would have to resize the buttons to properly align them, I ran through all possible scenarios, and came to find that I just had to add a seperate RibbonRowPanel with a RibbonRowBreak after each button on the specific panel. So it is easy after all, just a bit convoluted in my opinion. Hope this helps anyone who may be looking into something like this. Quote
yoannmaingon Posted August 12, 2010 Posted August 12, 2010 Hi, Have you tried to change the environnment? i think by defautlt autocad starts on 2D drawing or with the last one open. But while my ribbon is working if i change the environnement, it disappears and i can't launch again. have you tried that? Quote
em07189 Posted November 23, 2010 Posted November 23, 2010 Hi! I'm trying to create some custom ribbons and buttons, also with vb.net for my autocad 2010/2011 application. can you post or send me the full code needed to create custom tabs and buttons? Also i would like to know how do i create the interaction between the button click and my application? my email is xptomacr@gmail.com. thanks. Well, after a long bit of trial and error, I have finally been able to work out some of my ribbon issues... I am pretty sure that there are others like myself who are trying to get ribbon rows to work in 2011, and if you are one of them I hope the following info will help.... dim ribSrcPnl as RibbonSourcePanel = New RibbonSourcePanel dim ribCustomPnl as RibbonPanel = New RibbonPanel() dim ribCustomRow as RibbonRowPanel = New RibbonRowPanel() dim ribCustomBrk as RibbonRowBreak = New RibbonRowBreak() ... ribCustomPnl.Items.Add(ribCustomRow) ... ADD YOUR BUTTONS HERE ... ribCustomRow.Items.Add(ribCustomBrk) ... ADD SOME MORE BUTTONS ... ribCustomRow.Items.Add(ribCustomBrk) ... ADD SOME MORE BUTTONS ... Now if you look at the image I have attached, I have three rows in my panel, and a total of 8 buttons. I have placed my row breaks after the first 3 buttons, and then again after 3 more to create my first two rows, and the third row comes in with no need for an additional break. The one item that you may notice right away though is the lack of uniformity for my button widths, but even after physically setting the sizes they still come out as you see... Hopefully this will be quicker to figure out than these silly rows. 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.