I have create one dockablePane using the interface:Page, IDockablePaneProvider.In this pane,I want to add one button .when click the button,my plugin can drive the Api to do some modify to the model,such as translation,rotation or delete element.So I create an IexternalEventHandle,and implement its Execute method with my modify logic.And create an ExternalEvent when the dockablePane is create.In the OnClick method of the button,I notify the external event.It works well!
The question is,when I click the button,it doest not make the change in view immediately.It changes the view until I click the model view window!I find there is a method called UIDocument.RequestViewChage in the API document,but I can't understand "Instead the request will be posted to occur when control returns to Revit from the API context".Another way of saying,how to return the control to revit in this case?
"
I may miss the point of what you what, but you can get RibbonButton(or some other buttons) with: Autodesk.Windows.ComponentManager.PreviewExecute(you need to add to reference AdWindows)
public Result OnStartup(UIControlledApplication application) { if(GetRibbonData()) { SetRibonnAndButtons(application); } Autodesk.Windows.ComponentManager.PreviewExecute += ComponentManager_PreviewExecute; return Result.Succeeded; } private void ComponentManager_PreviewExecute(object sender, EventArgs e) { if(sender.GetType() == typeof(Autodesk.Windows.RibbonButton)) { RibbonOption.AppAction.pushedButtonText = (sender as Autodesk.Windows.RibbonButton).Text; }
it give you control of pushed button before execute a ExternalCommand.
Can't find what you're looking for? Ask the community or share your knowledge.