- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a command that is triggered by button in a ribbon. This command creates multiple ViewPlans automatically, the issue that I'm facing is that when I run the command the form shows fine I create the new Views but the changes are not shown until I close the form and the external command ends.
How can I do the same task but being able to see the changes instantly in the background without having to close the form? I have seen that in other addins but I don't know what I'm doing different.
Here is some of my code.
[Transaction(TransactionMode.Automatic)]
public class Command : IExternalCommand
{
Result IExternalCommand.Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
ViewCreator myViews = new ViewCreator(commandData);
try
{
ProjectSetupForm myForm = new ProjectSetupForm(myViews);
myForm.ShowDialog();
return Result.Succeeded;
}
catch (Exception ex)
{
message = ex.Message;
return Result.Failed;
}
}
}
ViewCreator is my class where I have all my properties and methods.
I create all de ViewPlans inside the form with all the data that the user inputs.
I really apreciate your help.
Thanks,
Marc
Solved! Go to Solution.