Message 1 of 6
How to insert a drawing via Ribbon Bar Button?

Not applicable
01-20-2011
11:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Since digging into the doing my ribbon bar in .Net vs the CUI interface (ugg) and finally got a ribbon bar up and working now my next issue arised.
Trying to insert a block via the ribbon bar. Now in the CUI it runs a macro though in my code I can't get it to do 2 commands at once (Insert and Block.dwg). Before I could use the code ^C^CInsert Block.dwg S1 R0 and then I could select where the block would be put into the drawing.
How would I got about this?
Example code of the panel tab where im trying to add this.
Private Sub addBCM1Chain(ByVal ribTab As RibbonTab) 'Create the panel source Dim ribSourcePanel As RibbonPanelSource = New RibbonPanelSource() ribSourcePanel.Title = "1 Chain" 'Create the panel Dim ribPanel As New RibbonPanel() ribPanel.Source = ribSourcePanel ribTab.Panels.Add(ribPanel) 'Create a button Dim ribBtn As Autodesk.Windows.RibbonButton = New RibbonButton() ribBtn.Text = "Net load" ribBtn.CommandParameter = "Insert|Block.dwg" ribBtn.Orientation = Windows.Controls.Orientation.Vertical ribBtn.Size = RibbonItemSize.Large ribBtn.LargeImage = LoadImage("Block.png") ribBtn.ShowImage = True ribBtn.ShowText = True ribBtn.CommandHandler = New AdskCommandHandler() 'Add the button ribSourcePanel.Items.Add(ribBtn) End Sub