We have demonstrated how to generate Revit ribbon creation code automatically in either C# or VB.NET with the assistance of the Ribbon Creator of Revit Addin Wizard (RevitAddinWizard) many times before. The Revit Ribbon Creator provides a cool user interface to help collect necessary data for all available ribbon groups and items, assign images big or small to them, and set up associations between Revit ribbon buttons and external commands.
The Ribbon Creator has been enhanced dramatically to facilitate the Revit .NET API ribbon creation work much better. The most noted new features are the Revit Ribbon Definition schema invention and the ribbon creator row/item edition.
Here is a sample of the Revit Ribbon Definition (.RRD) file:
<?xml version="1.0"?>
<ArrayOfItemLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ItemLayout>
<Type>Panel</Type>
<ItemsAndGroups>
<RibbonData xsi:type="ItemGroup">
<Type>PulldownButton</Type>
<Data>
<ContainerClassName>PulldownButton</ContainerClassName>
<ContainerNickName />
<ItemClassName />
<ItemNickName>Begin</ItemNickName>
<Container>PulldownButton</Container>
<Item>Begin</Item>
<Text>Pulldown</Text>
<Tooltip />
<ImageFile>1</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</Data>
<Items>
<RibbonData>
<ContainerClassName>PulldownButton</ContainerClassName>
<ContainerNickName />
<ItemClassName>PushButton</ItemClassName>
<ItemNickName />
<Container>PulldownButton</Container>
<Item>PushButton</Item>
<Text>Pulldown Member</Text>
<Tooltip />
<ImageFile>C:\Temp\smallb_NotExist.bmp</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</RibbonData>
</Items>
</RibbonData>
</ItemsAndGroups>
</ItemLayout>
<ItemLayout>
<Type>Panel</Type>
<ItemsAndGroups>
<RibbonData>
<ContainerClassName />
<ContainerNickName>Panel</ContainerNickName>
<ItemClassName />
<ItemNickName>Separator</ItemNickName>
<Container>Panel</Container>
<Item>Separator</Item>
<Text />
<Tooltip />
<ImageFile>2</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</RibbonData>
<RibbonData>
<ContainerClassName />
<ContainerNickName>Panel</ContainerNickName>
<ItemClassName>PushButton</ItemClassName>
<ItemNickName />
<Container>Panel</Container>
<Item>PushButton</Item>
<Text>PushButton 3</Text>
<Tooltip />
<ImageFile>C:\Temp\BigC.bmp</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</RibbonData>
</ItemsAndGroups>
</ItemLayout>
<ItemLayout>
<Type>Panel</Type>
<ItemsAndGroups>
<RibbonData xsi:type="ItemGroup">
<Type>SplitButton</Type>
<Data>
<ContainerClassName>SplitButton</ContainerClassName>
<ContainerNickName />
<ItemClassName />
<ItemNickName>Begin</ItemNickName>
<Container>SplitButton</Container>
<Item>Begin</Item>
<Text />
<Tooltip />
<ImageFile>0</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</Data>
<Items>
<RibbonData>
<ContainerClassName>SplitButton</ContainerClassName>
<ContainerNickName />
<ItemClassName>PushButton</ItemClassName>
<ItemNickName />
<Container>SplitButton</Container>
<Item>PushButton</Item>
<Text>Split Member</Text>
<Tooltip />
<ImageFile>C:\Temp\smallc.bmp</ImageFile>
<Command>RevitAddinCS1.ExtCmd</Command>
</RibbonData>
</Items>
</RibbonData>
</ItemsAndGroups>
</ItemLayout>
</ArrayOfItemLayout>
We are going to introduce the new features of the Ribbon Creator of RevitAddinWizard one by one in the future. Please stay tuned.
Recent Comments