public static void beginCommand(Document doc, string strDomain, bool bForAllSystems = false, bool bFitlerUnCalculationSystems = false)
        {
            PressureLossReportHelper helper = PressureLossReportHelper.instance;
            UIDocument uiDocument           = new UIDocument(doc);

            if (bFitlerUnCalculationSystems)
            {
                ElementSet calculationOnElems = new ElementSet();
                int        nTotalCount        = getCalculationElemSet(doc, strDomain, calculationOnElems, uiDocument.Selection.Elements);

                if (calculationOnElems.Size == 0)
                {//No item can be calculated
                    popupWarning(ReportResource.allItemsCaculationOff, TaskDialogCommonButtons.Close, TaskDialogResult.Close);
                    return;
                }
                else if (calculationOnElems.Size < nTotalCount)
                {//Part of them can be calculated
                    if (popupWarning(ReportResource.partOfItemsCaculationOff, TaskDialogCommonButtons.No | TaskDialogCommonButtons.Yes, TaskDialogResult.Yes) == TaskDialogResult.No)
                    {
                        return;
                    }
                }

                helper.initialize(doc, calculationOnElems, strDomain);
                invokeCommand(doc, helper, bForAllSystems);
            }
            else
            {
                helper.initialize(doc, uiDocument.Selection.Elements, strDomain);
                invokeCommand(doc, helper, bForAllSystems);
            }
        }
        public static void beginCommand(Document doc, ElementSet elems)
        {
            PressureLossReportHelper helper = PressureLossReportHelper.instance;

            helper.initialize(doc, elems, helper.Domain);
            invokeCommand(doc, helper, false);
        }