Hello all,
Im new to coding and have created a ribbon bar now in .net though, been having a lovely time trying to work this one out but hitting road blocks. Below is my original thread I did on the Autodesk forums.
http://forums.autodesk.com/t5/NET/How-to-insert-a-drawing-via-Ribbon-Bar-Button/m-p/2887928 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 = ""
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
The "ribBtn.CommandParameter = " is where im having issues with.
If I try this command after the = "-Insert Block"
It gets it going in the right direction. I can select a spot to drop the block on the drawing but then I have all the scale stuff to pass through.
If I try this command after the = "-Insert Block" & vbCrLf & "1" & vbCrLf & "1" & vbCrLf
Now it posts it but I don't get to select an insertion point. It picks some space where the last time your cursor clicked the model space.
Now if i try this command after the = "Insert " & "Block"
It brings up the block inserting window. Though not sure if this is how exactly the macro works or not that I have currently used inside autocad (which you can easily insert more blocks of the same type by right clicking). Though when the command is done it brings up the window, sits there at it (no text being put into the block line) and takes a few escapes and such to back out then runs the "Block" part of the command.
Trying to find a way to insert my macro code or something similar where I can click a button it gets the block, I can select where to put it in the drawing & have the option to rotate or select a new base point before it gets inserted into the drawing. Something similar if there you where using a tool pallet.
Thanks in advance.