private static void invokeCommand(Document doc, PressureLossReportHelper helper, bool bForAllSystems) { //upgrade the formats ReportFormatUpgrades.Instance.executeUpgrades(); //post warning if some systems' calculation is not ALL ElementSet selSystems = new ElementSet(); if (!bForAllSystems && helper.getSelectedSystems(selSystems)) { WholeReportSettingsDlg settingsDlg = new WholeReportSettingsDlg(); settingsDlg.ShowDialog(); } else //post system filter { ReportSystemSelectorDlg rssDlg = new ReportSystemSelectorDlg(); if (rssDlg.ShowDialog() == DialogResult.OK) { UserPressureLossReportApplication.beginCommand(PressureLossReportHelper.instance.Doc, rssDlg.CheckedElements); } } }