Esempio n. 1
0
        public bool OpenFileKompas(string fileName, out string result)
        {
            var fileopen = false;
            if (_kompasObj != null)
            {
                _doc2D = (ksDocument2D)_kompasObj.Document2D();
                if (_doc2D != null) fileopen = _doc2D.ksOpenDocument(fileName, false);
                if (!fileopen)
                {
                    result = "Error: Не могу открыть файл";
                    AddLog(result);
                    return false;
                }

                _kompasObj.Visible = true;
                var err = _kompasObj.ksReturnResult();
                if (err != 0) _kompasObj.ksResultNULL();

            }
            else
            {
                result = "Warning: Подключение с Компасом не установлено";
                AddLog(result);
                return false;
            }
            result = string.Empty;
            return true;
        }
Esempio n. 2
0
        public bool OpenFileKompas(string fileName, out string result, bool visual = true)
        {
            var fileopen = false;

            if (_kompasObj != null)
            {
                _doc2D = (ksDocument2D)_kompasObj.Document2D();
                if (_doc2D != null)
                {
                    fileopen = _doc2D.ksOpenDocument(fileName, false);
                }
                if (!fileopen)
                {
                    result = "Error: Не могу открыть файл";
                    AddLog(result);
                    return(false);
                }
                _kompasObj.Visible = visual;
                var err = _kompasObj.ksReturnResult();
                if (err != 0)
                {
                    _kompasObj.ksResultNULL();
                }
            }
            else
            {
                result = "Warning: Подключение с Компасом не установлено";
                AddLog(result);
                return(false);
            }
            result = string.Empty;
            return(true);
        }
Esempio n. 3
0
        void button1_Click(object sender, EventArgs e)
        {
            ksDocument2D doc = (ksDocument2D)kompas.Document2D();

            doc.ksOpenDocument(path[0], false);
            {
                ksStamp stamp = (ksStamp)doc.GetStamp();
                if (stamp != null && stamp.ksOpenStamp() == 1)
                {
                }
            }
        }