public override void Exec() { try { UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer; UIHierarchyItem hierItem = (UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0); ProjectItem projItem = (ProjectItem)hierItem.Object; Dimension dim = (Dimension)projItem.Object; VisualizeAttributeLatticeForm frm = new VisualizeAttributeLatticeForm(); frm.dimension = dim; frm.Show(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }