public override void Initialise(Document doc)
        {
            Application.DocumentManager.MdiActiveDocument = doc;
            using (DocumentLock issueDocumentLock = doc.LockDocument())
                using (Transaction trans = doc.TransactionManager.StartTransaction())
                {
                    LayoutSheetController controller = new LayoutSheetController(_logger, doc.Database, _settings);
                    LayoutSheet           newSheet   = controller.AddLayout("000 - PFA", PaperSize.A1Landscape);
                    newSheet.TitleBlock.DrawingNumber = "000";
                    newSheet.TitleBlock.Revision      = "P1";
                    newSheet.TitleBlock.ProjectNumber = ParentController.ProjectNumber;
                    newSheet.TitleBlock.Project       = ParentController.ProjectName;
                    newSheet.TitleBlock.Client        = ParentController.Client;
                    newSheet.TitleBlock.Title         = "Preliminary Foundation Assessment";
                    newSheet.TitleBlock.DrawnBy       = "DRA";
                    newSheet.TitleBlock.Date          = DateTime.Now.ToString("MMMM yy");

                    ViewportDrawingObject viewport = newSheet.DrawingArea.AddFullViewport();

                    BlockReference conceptFoundations = this.ParentController.GetXref <FoundationXrefDrawingType>().AddToDrawingAsXref(doc);
                    viewport.FocusOn(_settings, conceptFoundations.GeometricExtents);
                    controller.RemoveDefaultLayouts();

                    trans.Commit();
                }
        }
Exemplo n.º 2
0
    public AnimationCurve curve;               //動畫曲線

    //建構子
    public LayoutSettingEventArgs(LayoutSheet data, int visibleCount, UnityEngine.Vector2 spacing, AnimationCurve ac)
    {
        layoutData = data;

        visibleElementCount = visibleCount;
        elementSpacing      = spacing;
        curve = ac;
    }
Exemplo n.º 3
0
    //---------------------------------------------------------------------------------------------------------------------------------------------

    //追加並自動計算UI布局資料
    //[param] sc = 捲軸長度 , vc = 可視圖格長度 , es = 圖格間隔 , sh = 捲軸高度 , isApply = 是否套用
    public LayoutSheet CalculateLayoutData(int sc, int vc, Vector2 es, float sh, bool isApply)
    {
        if (panelRect == null)
        {
            panelRect = ScrollManager.Instance.scrollHolder.GetComponent <RectTransform>();
        }
        if (panelLg == null)
        {
            panelLg = ScrollManager.Instance.scrollHolder.GetComponent <HorizontalLayoutGroup>();
        }

        LayoutSheet _data = new LayoutSheet(sc, vc, es, sh);

        float   _pw = panelRect.rect.width;                            //面板區域寬度
        float   _ph = panelRect.rect.height;                           //面板區域高度
        float   _pl = panelLg.padding.left;                            //面板間隔(左)
        float   _pr = panelLg.padding.right;                           //面板間隔(右)
        float   _pb = panelLg.padding.bottom;                          //面板間隔(下)
        float   _pt = panelLg.padding.top;                             //面板間隔(上)
        float   _ps = panelLg.spacing;                                 //面板中間間隔寬度
        Vector2 _ld = ScrollManager.Instance.anchor_leftDown.position; //面板左下角位置
        Vector2 _ru = ScrollManager.Instance.anchor_rightUp.position;  //面板右上角位置

        //計算捲軸寬度
        float scrollWidth = (_pw - _pl - _pr - ((sc - 1) * _ps)) / sc;

        //計算圖格尺寸
        float   _esz_x      = scrollWidth - (es.x * 2);
        float   _esz_y      = (sh - (es.y * (vc + 1))) / vc;
        Vector2 elementSize = new Vector2(_esz_x, _esz_y);

        //計算圖格位置陣列
        float   leftDownPos_x = (((_ru.x - _ld.x) * (_pl + es.x + (_esz_x / 2))) / _pw) + _ld.x;         //左下圖格位置(X軸)
        float   leftDownPos_y = (((_ru.y - _ld.y) * (_pb + es.y + (_esz_y / 2))) / _ph) + _ld.y;         //左下圖格位置(Y軸)
        Vector2 leftDownPos   = new Vector2(leftDownPos_x, leftDownPos_y);

        float   rightUpPos_x = (((_ld.x - _ru.x) * (_pr + es.x + (_esz_x / 2))) / _pw) + _ru.x;         //右上圖格位置(X軸)
        float   rightUpPos_y = (((_ld.y - _ru.y) * (_pt + es.y + (_esz_y / 2))) / _ph) + _ru.y;         //右上圖格位置(Y軸)
        Vector2 rightUpPos   = new Vector2(rightUpPos_x, rightUpPos_y);

        //套用計算結果
        _data.scrollWidth         = scrollWidth;
        _data.elementSize         = elementSize;
        _data.elementPos_leftDown = leftDownPos;
        _data.elementPos_rightUp  = rightUpPos;

        if (isApply)
        {
            ApplyData = _data;
        }
        return(_data);
    }
Exemplo n.º 4
0
    //(協程)UI布局設定
    //[param] originData = 原資料 , newData = 欲套用資料 , duration = 動畫時間
    public IEnumerator Cor_SetUILayout(LayoutSheet originData, LayoutSheet newData, float duration = 0)
    {
        float _scrollLength     = elementChain.Count * (newData.elementSize.y + newData.ElementSpacing.y);
        float _handleAreaHeight = _scrollLength - (newData.ScrollHeight - newData.ElementSpacing.y);

        if (duration <= 0 || !this.gameObject.activeSelf)                                                     //無動畫
        {
            elementHolder.spacing      = newData.ElementSpacing;                                              //設定圖格間隔
            elementHolder.cellSize     = newData.elementSize;                                                 //設定圖格尺寸
            sliderHandleArea.offsetMax = new Vector2(sliderHandleArea.offsetMax.x, newData.ElementSpacing.y); //設定捲軸滾動區域位移量
        }
        else //有動畫
        {
            Vector2 _sizeTarget = invalidAnimation ? new Vector2(0, newData.elementSize.y) : newData.elementSize;

            Sequence sq_layoutVariation = DOTween.Sequence()
                                          .OnStart(() =>
            {
                elementHolder.spacing  = originData.ElementSpacing;  //圖格間隔初始化
                elementHolder.cellSize = originData.elementSize;     //圖格尺寸初始化
            })
                                          .Append(DOTween.To(() => elementHolder.spacing, (x) => elementHolder.spacing         = x, newData.ElementSpacing, duration))
                                          .Join(DOTween.To(() => elementHolder.cellSize, (x) => elementHolder.cellSize         = x, _sizeTarget, duration))
                                          .Join(DOTween.To(() => sliderHandleArea.offsetMax, (x) => sliderHandleArea.offsetMax = x, new Vector2(sliderHandleArea.offsetMax.x, newData.ElementSpacing.y), duration))
                                          .SetEase(Ease.Unset);

            yield return(sq_layoutVariation.WaitForCompletion());
        }

        sliderHandleArea.sizeDelta = new Vector2(sliderHandleArea.sizeDelta.x, _handleAreaHeight);

        //重設圖格碰撞體大小
        for (int i = 0; i < elementChain.Count; i++)
        {
            elementChain[i].SetColliderSize(newData.elementSize);
        }

        if (invalidAnimation)                                //無效化動畫執行中
        {
            yield return(tween_invalid.WaitForCompletion()); //等待無效化動畫執行完畢

            invalidAnimation = false;

            this.gameObject.SetActive(false); //隱藏物件
        }
    }
Exemplo n.º 5
0
        public void SpsDoc(int n_str, string text, string dat, int n_doc)
        {
            IKompasDocument doc   = appl.Documents.Open(path[n_doc], true, false);// Получаем интерфейс активного документа 2D в API7
            ksSpcDocument   DocS  = (ksSpcDocument)kompas.SpcActiveDocument();
            ksStamp         stamp = DocS.GetStamp();



            stamp.ksOpenStamp();

            //_______________________________________
            LayoutSheets _ls   = doc.LayoutSheets;
            LayoutSheet  LS    = _ls.ItemByNumber[1];
            var          q     = _ls.ItemByNumber[1].Stamp;
            IStamp       isamp = LS.Stamp;
            IText        qq    = isamp.Text[10];

            Console.WriteLine("Есть ли руковод -------------  " + qq.Str);
            //________________________________________


            stamp.ksColumnNumber(120);
            ksTextItemParam itemParam = (ksTextItemParam)kompas.GetParamStruct((short)StructType2DEnum.ko_TextItemParam);

            if (itemParam != null)
            {
                itemParam.Init();

                ksTextItemFont itemFont = (ksTextItemFont)itemParam.GetItemFont();
                if (itemFont != null)
                {
                    itemFont.SetBitVectorValue(ldefin2d.NEW_LINE, true);
                    itemFont.fontName = "Staccato222 BT";

                    itemParam.s = "44444";
                    stamp.ksTextLine(itemParam);
                }
            }

            stamp.ksCloseStamp();
        }
        public TitleResponse TestReadingTitleBlockResident(string layoutName)
        {
            using (Transaction trans =
                       Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction())
            {
                Layout target = Application.DocumentManager.MdiActiveDocument.Database.GetLayout(layoutName);

                LayoutSheet   layoutSheet = new LayoutSheet(null, target);
                TitleResponse response    = new TitleResponse()
                {
                    Title         = layoutSheet.TitleBlock.Title,
                    Client        = layoutSheet.TitleBlock.Client,
                    Project       = layoutSheet.TitleBlock.Project,
                    DrawingNumber = layoutSheet.TitleBlock.DrawingNumber,
                    ProjectNumber = layoutSheet.TitleBlock.ProjectNumber,
                    Revision      = layoutSheet.TitleBlock.Revision,
                };

                return(response);
            }
        }
Exemplo n.º 7
0
        public void Doc2D(int n_str, int n_str_dat, string text, string dat, int n_doc, bool ruk = false)
        {
            IKompasDocument doc   = appl.Documents.Open(path[n_doc], true, false);// Получаем интерфейс активного документа 2D в API7
            ksDocument2D    docD  = (ksDocument2D)kompas.ActiveDocument2D();
            ksStamp         stamp = (ksStamp)docD.GetStamp();

            Console.WriteLine("функция Doc2D ");


            stamp.ksOpenStamp();


            //_____________________________________________________________
            LayoutSheets _ls   = doc.LayoutSheets;
            LayoutSheet  LS    = _ls.ItemByNumber[1];
            IStamp       isamp = LS.Stamp;
            IText        qq    = isamp.Text[10];

            Console.WriteLine("Есть ли руководитель -------------  " + qq.Str);
            //_____________________________________________________________



            stamp.ksColumnNumber(n_str);
            ksTextItemParam itemParam = (ksTextItemParam)kompas.GetParamStruct((short)StructType2DEnum.ko_TextItemParam);

            if (itemParam != null)
            {
                itemParam.Init();

                ksTextItemFont itemFont = (ksTextItemFont)itemParam.GetItemFont();
                if (itemFont != null)
                {
                    itemFont.SetBitVectorValue(ldefin2d.NEW_LINE, true);
                    itemParam.s = text;
                    docD.ksTextLine(itemParam);
                }
            }

            stamp.ksColumnNumber(n_str_dat);

            if (itemParam != null)
            {
                itemParam.Init();

                ksTextItemFont itemFont = (ksTextItemFont)itemParam.GetItemFont();
                if (itemFont != null)
                {
                    itemFont.SetBitVectorValue(ldefin2d.NEW_LINE, true);
                    itemParam.s = dat;
                    docD.ksTextLine(itemParam);
                }
            }


            if (ruk == true)
            {
                stamp.ksColumnNumber(123);

                if (itemParam != null)
                {
                    itemParam.Init();

                    ksTextItemFont itemFont = (ksTextItemFont)itemParam.GetItemFont();
                    if (itemFont != null)
                    {
                        itemFont.SetBitVectorValue(ldefin2d.NEW_LINE, true);
                        itemParam.s = textBox2.Text;
                        docD.ksTextLine(itemParam);
                    }
                }


                stamp.ksColumnNumber(133);

                if (itemParam != null)
                {
                    itemParam.Init();

                    ksTextItemFont itemFont = (ksTextItemFont)itemParam.GetItemFont();
                    if (itemFont != null)
                    {
                        itemFont.SetBitVectorValue(ldefin2d.NEW_LINE, true);
                        itemParam.s = dat;
                        docD.ksTextLine(itemParam);
                    }
                }
            }

            stamp.ksCloseStamp();



            //doc.Close(0); //Закрыть документ
        }
Exemplo n.º 8
0
    //設置捲軸區域(協程)
    //[param] scrollCount = 捲軸數量, visibleCount = 可視圖格數量, elementChainGroup = 各捲軸圖格鍊, isAnimation = 是否啟用動畫
    private IEnumerator Cor_SetScrollAreaLayout(int scrollCount, int visibleCount, Vector2 spacing, List <List <ElementImageType> > elementChainGroup, bool isAnimation, LotteryLineSetting lineSetting = null)
    {
        //判斷UI介面是否重新調整
        RectTransform         panelRect = scrollHolder.GetComponent <RectTransform>();
        HorizontalLayoutGroup panelLg   = scrollHolder.GetComponent <HorizontalLayoutGroup>();
        float scrollHeight = panelRect.rect.height - panelLg.padding.top - panelLg.padding.bottom; //取得捲軸區域高度

        //設定更新前後布局資料
        LayoutSheet originData    = new LayoutSheet(0, 0, Vector2.zero, 0); //改變前布局資料
        LayoutSheet newData       = new LayoutSheet(0, 0, Vector2.zero, 0); //新的布局資料
        bool        isLayoutReset = false;                                  //布局參數是否重置
        bool        _isAnimation  = isAnimation;                            //布局更新啟用動畫

        if (layoutData.ApplyData == null)                                   //初始化的狀況
        {
            isLayoutReset = true;
            _isAnimation  = false;                                                                          //初始化時強制不使用動畫
        }
        else if (layoutData.ApplyData.MatchTest(scrollCount, visibleCount, spacing, scrollHeight) == false) //更新參數的狀況
        {
            isLayoutReset = true;
            originData    = layoutData.ApplyData;
        }

        if (isLayoutReset)
        {
            layoutData.CalculateLayoutData(scrollCount, visibleCount, spacing, scrollHeight, true);                //如果有改變則套用新的參數資料
        }
        newData = layoutData.ApplyData;

        //設定捲軸數量
        if (isLayoutReset)
        {
            this.scrollCount = scrollCount; //校正Editor參數

            //重新設定捲軸數量
            SetScrollCount(_isAnimation);
        }

        //設定捲軸圖格鍊
        if (elementChainGroup == null) //不指定圖格鍊時
        {
            for (int i = 0; i < scrollGroup.Count; i++)
            {
                if ((scrollGroup[i].elementChain == null || scrollGroup[i].elementChain.Count == 0) && defaultElementChain != null)   //若捲軸沒有設定圖格鍊, 則套用預設圖格鍊
                {
                    scrollGroup[i].SetElementChain(defaultElementChain, visibleCount);
                }

                if (isLayoutReset)                                      //重新調整布局
                {
                    scrollGroup[i].SetElementChain(null, visibleCount); //若可視圖格長度有變動, 則捲軸的尾部也會跟著變動
                }
            }
        }
        else //有指定圖格鍊時
        {
            if (elementChainGroup.Count != scrollCount)
            {
                throw new System.Exception("[ERROR]圖格鍊數量與捲軸數量不符");
            }
            for (int i = 0; i < scrollGroup.Count; i++) //設定各捲軸的圖格鍊
            {
                scrollGroup[i].SetElementChain(elementChainGroup[i], visibleCount);
            }
        }

        //設置位置偵測器
        SetPostionSensor(layoutData.ApplyData.elementPos_leftDown, layoutData.ApplyData.elementPos_rightUp, scrollCount, visibleCount);

        //中獎線重新設置
        LotteryLineManager.Instance.SettingInitialize(lineSetting);

        //設定可視圖格數&調整UI
        if (isLayoutReset)
        {
            this.visibleElementCount = visibleCount; //校正Editor參數
            this.elementSpacing      = spacing;      //校正Editor參數

            for (int i = 0; i < scrollGroup.Count; i++)
            {
                if (_isAnimation)                                                                                                          //有動畫
                {
                    if ((previousSpinResult != null && previousSpinResult.Count > 0) && (originData.VisibleCount != newData.VisibleCount)) //若拉霸結果有儲存紀錄, 且可視圖格數量有改變, 則將slider.value設為0(拉至最下方), 以防動畫演示出現Bug
                    {
                        List <ElementImageType> _nowElements = new List <ElementImageType>();                                              //該捲軸目前的顯示圖格
                        for (int j = 0; j < previousSpinResult.Count; j++)
                        {
                            if ((int)previousSpinResult[j].coordinate.x == i)
                            {
                                _nowElements.Add(previousSpinResult[j].elementType);                                               //將目前顯示圖格中X軸(列號)符合的項目加入列表
                            }
                        }

                        scrollGroup[i].ResetScrollPosition(_nowElements, visibleCount); //重置捲軸
                    }

                    if (i == scrollGroup.Count - 1) //等待最後一個捲軸的動畫撥放完成
                    {
                        yield return(StartCoroutine(scrollGroup[i].Cor_SetUILayout(originData, newData, layoutAnimationDuration)));
                    }
                    else
                    {
                        StartCoroutine(scrollGroup[i].Cor_SetUILayout(originData, newData, layoutAnimationDuration));
                    }
                }
                else
                {
                    StartCoroutine(scrollGroup[i].Cor_SetUILayout(null, layoutData.ApplyData));  //無動畫
                }
            }
        }

        yield return(null);
    }
Exemplo n.º 9
0
        public void START()
        {
            int stolb     = 1; //   A - B - C - D     //Cells(5, 3) = C5
            int stroka    = 1; //  1-2-3
            int nomer_Sps = 1;



            spec_stroka[] Spisok_dok = new spec_stroka[1500];



            //for (int i1 = 0; i1 <1000;i1++)
            //{
            //    Sps[i1] = new spec_stroka();
            //}



            Console.WriteLine("Количество документов = " + path.Count);
            for (int i = 0; i < path.Count; i++)
            {
                IKompasDocument doc = appl.Documents.Open(path[i], false, false);// Получаем интерфейс активного документа 2D в API7
                Console.WriteLine("Получение спецификации из документа № - " + Convert.ToInt32(i + 1));

                SpecificationDescription Specification_Descriptions = doc.SpecificationDescriptions.Active;



                if (Specification_Descriptions != null)
                {
                    ISpecificationCommentObjects SpcObjects     = Specification_Descriptions.CommentObjects;
                    ISpecificationBaseObjects    SpcObjectsBase = Specification_Descriptions.BaseObjects;


                    //Console.WriteLine(" ВСПОМОГАТЕЛЬНЫЕ объекты " + SpcObjects.Count);
                    //Console.WriteLine(" Базовые объекты " + SpcObjectsBase.Count);
                    int kol_com  = SpcObjects.Count;
                    int kol_base = SpcObjectsBase.Count;

                    if (kol_com == 0 & kol_base > 0)
                    {
                        tip_obj_base = true;
                        num          = kol_base;
                    }
                    if (kol_base == 0 & kol_com > 0)
                    {
                        tip_obj_base = false;
                        num          = kol_com;
                    }



                    ISpecificationObject  Specification_Object;
                    ISpecificationColumns Specification_Columns;
                    ISpecificationColumn  Specification_Column;

                    // Начало блока вспомагательных объктов
                    for (int SD = 0; SD < num; SD++)
                    {
                        Console.WriteLine("----- Строка " + (SD + 1) + "   ---- ");
                        Console.WriteLine("");
                        //var ww = SpcObjects[SD];
                        if (!tip_obj_base)
                        {
                            ISpecificationCommentObject obj = SpcObjects[SD];
                            var OBJ = obj;
                            ISpecificationColumns oC = obj.Columns;
                            int qq = obj.Section;
                            Console.WriteLine("!!!!СЕКЦИЯ " + (qq) + "   !!!!!");
                            Specification_Object = obj;
                            nomer_razdela        = qq;
                            //5 - документация   10 - комплексы    15 - сборочные единицы   20 - детали    25 - стандартные изделия   30 - прочие изделия    35 - материалы      40 - комплекты
                        }
                        else
                        {
                            ISpecificationBaseObject obj_base = SpcObjectsBase[SD];
                            var OBJ = obj_base;
                            ISpecificationColumns oC = obj_base.Columns;
                            int qq = obj_base.Section;
                            Console.WriteLine("!!!!СЕКЦИЯ " + (qq) + "   !!!!!");
                            Specification_Object = obj_base;
                            nomer_razdela_base   = qq;
                        }

                        if (((nomer_razdela == 5) | (nomer_razdela_base == 5)) & (i != 0))
                        {
                            Console.WriteLine("----------------Пропуск раздела документация-------------------");
                            continue;
                        }
                        else
                        {
                            Sps[nomer_Sps]          = new spec_stroka();
                            Sps[nomer_Sps].doc_name = ObrezFileName(path[i]);
                            Sps[nomer_Sps].sortir   = false;


                            if (nomer_razdela == 5 | nomer_razdela_base == 5)
                            {
                                Sps[nomer_Sps].tip_stroki = "CБ";
                                Console.WriteLine("----------------Запись раздела документация  ГЛАВНОГО ДОКУМЕНТА-------------------");
                            }

                            if (nomer_razdela == 15 | nomer_razdela_base == 15)
                            {
                                Sps[nomer_Sps].tip_stroki = "CБ";
                            }
                            if (nomer_razdela == 25 | nomer_razdela_base == 25)
                            {
                                Sps[nomer_Sps].tip_stroki = "СТ";
                            }
                            if (nomer_razdela == 30 | nomer_razdela_base == 30)
                            {
                                Sps[nomer_Sps].tip_stroki = "П";
                            }
                            if (nomer_razdela == 35 | nomer_razdela_base == 35)
                            {
                                Sps[nomer_Sps].tip_stroki = "М";
                            }



                            Specification_Columns = Specification_Object.Columns;

                            for (int bCol = 0; bCol < Specification_Columns.Count; bCol++)
                            {
                                Specification_Column = Specification_Columns[bCol];
                                var st = Specification_Column.Text.Str;
                                Console.WriteLine("Столбец " + (bCol + 1) + " - " + st);

                                //Заполнение      /////////////////////////////////////                            ///////////////////////////
                                //sheet.Cells[stroka, stolb] = st;
                                if (nomer_razdela == 20 | nomer_razdela_base == 20)
                                {
                                    if (bCol == 0)
                                    {
                                        if (st != "БЧ")
                                        {
                                            Sps[nomer_Sps].tip_stroki = "Д";
                                        }
                                        else
                                        {
                                            Sps[nomer_Sps].tip_stroki = "БЧ";
                                        }
                                    }
                                }

                                switch (bCol)
                                {
                                case 0:
                                    Sps[nomer_Sps].format = st;


                                    break;

                                case 2:
                                    Sps[nomer_Sps].poz = st;
                                    break;

                                case 3:
                                    //Sps[nomer_Sps].obozn = st;
                                    Sps[nomer_Sps].obozn = ObrezSB(st);
                                    break;

                                case 4:
                                    //Sps[nomer_Sps].naimen = st;
                                    if (nomer_razdela == 5 | nomer_razdela_base == 5)
                                    {
                                        Sps[nomer_Sps].naimen = textBox4.Text;
                                    }
                                    else
                                    {
                                        Sps[nomer_Sps].naimen = Regex.Replace(st, @"[ \n]", " ");
                                    }

                                    break;

                                case 5:
                                    Sps[nomer_Sps].kol = st;
                                    break;

                                case 6:
                                    Sps[nomer_Sps].prim = st;
                                    break;
                                }

                                //stolb += 1;
                            }

                            Console.WriteLine("----- Конец cтроки ---- ");
                            // stolb = 1;
                            //stroka += 1;
                            nomer_Sps         += 1;
                            nomer_razdela      = 0;
                            nomer_razdela_base = 0;
                        }
                    }



                    if (doc != null)
                    {
                        doc.Close(0); //Закрыть документ
                    }
                }
                else
                {
                    Console.WriteLine("Пропущен документ (документ не спецификации, и не на чертеже)");
                    if (doc != null)
                    {
                        ksDocument2D docD  = (ksDocument2D)kompas.ActiveDocument2D();
                        ksStamp      stamp = (ksStamp)docD.GetStamp();


                        LayoutSheets _ls   = doc.LayoutSheets;
                        LayoutSheet  LS    = _ls.ItemByNumber[1];
                        IStamp       isamp = LS.Stamp;
                        IText        qq    = isamp.Text[3];
                        IText        ww    = isamp.Text[2];

                        Console.WriteLine("ШТАМП Материал -------------  " + qq.Str);
                        Console.WriteLine("ШТАМП Обозначение -------------  " + ww.Str);

                        Sps[nomer_Sps]            = new spec_stroka();
                        Sps[nomer_Sps].doc_name   = ObrezFileName(path[i]);
                        Sps[nomer_Sps].obozn      = ww.Str;
                        Sps[nomer_Sps].tip_stroki = "Материал из детали";
                        Sps[nomer_Sps].material   = qq.Str;
                        Sps[nomer_Sps].sortir     = false;

                        nomer_Sps += 1;
                        doc.Close(0); //Закрыть документ
                    }
                }

                doc.Close(0);
                Console.WriteLine("");
                Console.WriteLine("-Проверка-");
            }



            ////////////////////////////////////////////////////////////////////////////////////////

            //sheet.Columns["D:D"].ColumnWidth = 16.0;
            // sheet.Columns["E:E"].ColumnWidth = 25.0;


            try
            {
                //ex.Application.ActiveWorkbook.SaveAs("D:\\1111111111111111111.xlsx", Type.Missing,
                // Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange,
                //Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            }
            catch
            {
                MessageBox.Show("Сперва закройте БазуНСИ");
            }



            ///////////////////////////////////////////

            /*
             *
             * workBook = null;
             * sheet = null;
             * //ex.Quit();
             * ex = null;
             * GC.Collect();
             *
             */



            for (int i2 = 0; i2 < 1500; i2++)
            {
                if (Sps[i2] != null)
                {
                    if (Sps[i2].sortir != null)
                    {
                        Sps[i2].GetInfoSst();
                    }
                }
            }
        }