private void AddBlock_Click(object sender, RoutedEventArgs e) { BlockModel NewBlock = new BlockModel(); NewBlock.LstBlockProp.Add(new BlockPropModel("Default")); ArCaBlockView blockForm = new ArCaBlockView(NewBlock, true); Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow(blockForm); }
private void EdtBlock_Click(object sender, RoutedEventArgs e) { //Check if there any selected block in lvBlocks if (lvBlocks.SelectedIndex == -1) { MessageBox.Show("Select one block first.", "Edit Block", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //Edit BlockModel BlockModel objBlock = lvBlocks.SelectedValue as BlockModel; ArCaBlockView blockForm = new ArCaBlockView(objBlock, false); Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow(blockForm); }