public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication application = commandData.Application; UIDocument activeUIDocument = application.ActiveUIDocument; Application application2 = application.Application; Document document = activeUIDocument.Document; Selection selection = activeUIDocument.Selection; LegendManager data = new LegendManager(document); using (LegendManagerForm legendManagerForm = new LegendManagerForm(data)) { legendManagerForm.ShowDialog(); } using (Transaction transaction = new Transaction(document)) { transaction.Start("aaa"); transaction.Commit(); } return(0); }
public LegendManagerForm(LegendManager data) { this._data = data; this.InitializeComponent(); this.cbType.SelectedIndex = 0; }