public static string InsertConnectingPoint(this Page page, string lib, string symbolname, PointD location)
        {
            string msg = EplDefinition.EPL_INSERT_CONNECTING_POINT.ToString();

            try
            {
                using (LockingStep oLS = new LockingStep())
                {
                    page.Project.LockAllObjects();
                    SymbolLibrary symboLib       = new SymbolLibrary(page.Project, lib);
                    Symbol        symbol         = new Symbol(symboLib, symbolname);
                    SymbolVariant oSymbolVariant = new SymbolVariant();
                    oSymbolVariant.Initialize(symbol, 0);
                    Function function = new Function();
                    function.Create(page, oSymbolVariant);
                    function.Location = location;
                    function.Properties.FUNC_CONNECTIONDESIGNATION[1] = "1";
                }
            }
            catch (Exception ex)
            {
                EplExtension.EplException("Insert symbol error.", ex);
                msg = EplError.EPL_ERROR.ToString();
            }

            return(msg);
        }
예제 #2
0
 public static dynamic GetTSObject(SymbolLibrary dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
예제 #3
0
        public void loadSigns(string svOptionFromLisp = "", string folderPathFromLisp = "")
        {
            var symbolLibrary = new SymbolLibrary(_tabName, _buttonName, "", svOptionFromLisp, folderPathFromLisp);

            if (!symbolLibrary.abortScreenOpen)
            {
                symbolLibrary.ShowDialog();
            }
        }
예제 #4
0
        // [CommandMethod("BECAGUI", CommandFlags.Session)]
        // [CommandMethod("SymInsert", CommandFlags.Session)]//24-10-2018
        public void AusSigns()
        {
            var symbolLibrary = new SymbolLibrary(_tabName, _buttonName, "");

            if (!symbolLibrary.abortScreenOpen)
            {
                symbolLibrary.ShowDialog();
            }
        }
예제 #5
0
        public void AusSigns()
        {
            if (!SymbolLibrary.bIsValid)
            {
                return;
            }
            var symbolLibrary = new SymbolLibrary(_tabName, _buttonName, "");

            symbolLibrary.ShowDialog();
        }
예제 #6
0
        public static Function GetFunction(Page page, string symbolLibraryName, string symbolName, int symbolvariant)
        {
            page.SmartLock();

            SymbolLibrary symbolLibrary = new SymbolLibrary(page.Project, symbolLibraryName);
            Symbol        symbol        = new Symbol(symbolLibrary, symbolName);
            Function      function      = new Function();

            function.Create(page.Project, symbol.Variants[symbolvariant]);
            return(function);
        }
예제 #7
0
      /// <summary>
      /// Insert a symbol on a given page
      /// </summary>
      /// <param name="page">Page where the symbol be insert</param>
      /// <param name="symbolLibraryName">Symbol library name</param>
      /// <param name="symbolName">Symbol name</param>
      /// <param name="symbolvariant">Symbol variant</param>
		public void Insert(Page page, string symbolLibraryName, string symbolName, int symbolvariant)
		{
			page.LockObject();

			SymbolLibrary symbolLibrary = new SymbolLibrary(page.Project, symbolLibraryName);
			Symbol symbol = new Symbol(symbolLibrary, symbolName);

			Function function = new Function(page.Project, symbol.Variants[symbolvariant]);
			function.Location = new PointD(200, 150);
			page.InsertSubPlacement(function);
			function.Dispose();
		}
예제 #8
0
        /// <summary>
        /// 打开需要的工作空间文件及地图
        /// </summary>
        private void Initialize()
        {
            try
            {
                //初始化点线面
                m_point = new GeoPoint(25, 25);

                Point2Ds point2DsLine = new Point2Ds();
                point2DsLine.Add(new Point2D(5, 35));
                point2DsLine.Add(new Point2D(65, 35));
                m_line = new GeoLine(point2DsLine);

                Point2Ds point2DsRegion = new Point2Ds();
                point2DsRegion.Add(new Point2D(5, 5));
                point2DsRegion.Add(new Point2D(5, 69));
                point2DsRegion.Add(new Point2D(69, 69));
                point2DsRegion.Add(new Point2D(69, 5));
                m_region = new GeoRegion(point2DsRegion);
                //初始化点线面符号的风格
                m_markerGeoStyle            = new GeoStyle();
                m_markerGeoStyle.LineColor  = Color.Blue;
                m_markerGeoStyle.MarkerSize = new Size2D(12, 12);
                m_point.Style = m_markerGeoStyle;

                m_lineGeoStyle           = new GeoStyle();
                m_lineGeoStyle.LineColor = Color.Blue;
                m_lineGeoStyle.LineWidth = 0.5;
                m_line.Style             = m_lineGeoStyle;

                m_fillGeoStyle = new GeoStyle();
                m_fillGeoStyle.FillForeColor  = Color.Blue;
                m_fillGeoStyle.FillBackOpaque = false;
                m_region.Style = m_fillGeoStyle;

                // 得到点线面的RootGroup
                Resources     resources           = m_workspace.Resources;
                SymbolLibrary symbolMarkerLibrary = resources.MarkerLibrary;
                m_symbolMarkerRootGroup = symbolMarkerLibrary.RootGroup;

                SetTreeGroup(m_symbolMarkerRootGroup);

                SymbolLibrary symbolLineLibrary = resources.LineLibrary;
                m_symbolLineRootGroup = symbolLineLibrary.RootGroup;

                SymbolLibrary symbolFillLibrary = resources.FillLibrary;
                m_symbolFillRootGroup = symbolFillLibrary.RootGroup;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #9
0
        public static string InsertDevice(ref Page refPage, EplDeviceProperties deviceProperties)
        {
            string msg = EplDefinition.EPL_INSERT_DEVICE.ToString();

            try
            {
                using (LockingStep oLS = new LockingStep())
                {
                    refPage.Project.LockAllObjects();
                    BoxedDevice   oBoxedDevice = new BoxedDevice();
                    string        slib         = string.IsNullOrEmpty(deviceProperties.SymbolLibraryName) ? "GB_symbol" : deviceProperties.SymbolLibraryName;
                    SymbolLibrary sLibrary     = new SymbolLibrary(refPage.Project, slib);
                    Symbol        s            = new Symbol(sLibrary, deviceProperties.SymbolName);
                    SymbolVariant sv           = new SymbolVariant();
                    sv.Initialize(s, 0);
                    oBoxedDevice.Create(refPage);
                    oBoxedDevice.SymbolVariant = sv;
                    //oBoxedDevice.Properties.FUNC_DES = deviceProperties.SymbolDescription;
                    if (!string.IsNullOrEmpty(deviceProperties.PartName))
                    {
                        oBoxedDevice.AddArticleReference(deviceProperties.PartName);
                    }
                    oBoxedDevice.VisibleName                 = deviceProperties.DisplayText;
                    oBoxedDevice.Properties.FUNC_TEXT        = deviceProperties.FunctionText;
                    oBoxedDevice.Location                    = deviceProperties.Location;
                    oBoxedDevice.Properties.FUNC_GRAVINGTEXT = deviceProperties.EngravingText;
                    oBoxedDevice.Properties.FUNC_TECHNICAL_CHARACTERISTIC = deviceProperties.Characteristics;
                    if (deviceProperties.ConnectionDesignations != null)
                    {
                        for (int i = 0; i < deviceProperties.ConnectionDesignations.Length; i++)
                        {
                            oBoxedDevice.Properties.FUNC_CONNECTIONDESIGNATION[i + 1] = deviceProperties.ConnectionDesignations[i];
                            if (deviceProperties.ConnectionPointDescription != null)
                            {
                                if (deviceProperties.ConnectionPointDescription.Length > i)
                                {
                                    oBoxedDevice.Properties.FUNC_CONNECTIONDESCRIPTION[i + 1] = deviceProperties.ConnectionPointDescription[i];
                                }
                            }
                        }
                    }
                    oBoxedDevice.Properties.FUNC_MOUNTINGLOCATION = deviceProperties.MountingSite;
                }
            }
            catch (Exception ex)
            {
                EplException("Insert device error.", ex);
                msg = EplError.EPL_ERROR.ToString();
            }
            return(msg);
        }
예제 #10
0
        /// <summary>
        /// Insert a symbol on a given page
        /// </summary>
        /// <param name="page">Page where the symbol be insert</param>
        /// <param name="symbolLibraryName">Symbol library name</param>
        /// <param name="symbolName">Symbol name</param>
        /// <param name="symbolvariant">Symbol variant</param>
        public void Insert(Page page, string symbolLibraryName, string symbolName, int symbolvariant)
        {
            page.SmartLock();

            SymbolLibrary symbolLibrary = new SymbolLibrary(page.Project, symbolLibraryName);
            Symbol        symbol        = new Symbol(symbolLibrary, symbolName);

            Function function = new Function();

            function.Create(page.Project, symbol.Variants[symbolvariant]);
            function.Location = new PointD(200, 150);
            page.InsertSubPlacement(function);
            function.Dispose();
        }
예제 #11
0
        public static string InsertSymbol(ref Page refPage, EplSymbolProperties symbolProperties)
        {
            string msg = EplDefinition.EPL_INSERT_SYMBOL_MCR.ToString();

            try
            {
                using (LockingStep oLS = new LockingStep())
                {
                    refPage.Project.LockAllObjects();
                    SymbolLibrary symboLib       = new SymbolLibrary(refPage.Project, symbolProperties.SymbolLibraryName);
                    Symbol        symbol         = new Symbol(symboLib, symbolProperties.SymbolName);
                    SymbolVariant oSymbolVariant = new SymbolVariant();
                    oSymbolVariant.Initialize(symbol, symbolProperties.SymbolVariant);
                    Function function = new Function();
                    function.Create(refPage, oSymbolVariant);
                    //function.Properties.FUNC_SYMB_DESC = symbolProperties.SymbolDescription;
                    if (!string.IsNullOrEmpty(symbolProperties.PartName))
                    {
                        function.AddArticleReference(symbolProperties.PartName);
                    }
                    function.VisibleName                 = symbolProperties.DisplayText;
                    function.Properties.FUNC_TEXT        = symbolProperties.FunctionText;
                    function.Location                    = symbolProperties.Location;
                    function.Properties.FUNC_GRAVINGTEXT = symbolProperties.EngravingText;
                    function.Properties.FUNC_TECHNICAL_CHARACTERISTIC = symbolProperties.Characteristics;
                    if (symbolProperties.ConnectionDesignations != null)
                    {
                        for (int i = 0; i < symbolProperties.ConnectionDesignations.Length; i++)
                        {
                            function.Properties.FUNC_CONNECTIONDESIGNATION[i + 1] = symbolProperties.ConnectionDesignations[i];
                            if (symbolProperties.ConnectionPointDescription != null)
                            {
                                if (symbolProperties.ConnectionPointDescription.Length > i)
                                {
                                    function.Properties.FUNC_CONNECTIONDESCRIPTION[i + 1] = symbolProperties.ConnectionPointDescription[i];
                                }
                            }
                        }
                    }
                    function.Properties.FUNC_MOUNTINGLOCATION = symbolProperties.MountingSite;
                }
            }
            catch (Exception ex)
            {
                EplException("Insert symbol error.", ex);
                msg = EplError.EPL_ERROR.ToString();
            }

            return(msg);
        }
예제 #12
0
        public void SetSymbols(string value)
        {
            SymbolLibrary library = new SymbolLibrary();

            symbolArray = value.Split(new char[] { ',' });
            var symbolList = new List <string>();

            for (int i = 0; i < symbolArray.Length; i++)
            {
                var tempSymbol          = symbolArray[i].Trim();
                SymbolProperties symbol = library.GetSymbolProperties(tempSymbol);
                symbol.ChartGroup = i + 1;
                log.Info(symbol + " set to chart group " + symbol.ChartGroup);
                symbolInfo.Add(symbol);
                symbolList.Add(tempSymbol);
            }
            symbolArray = symbolList.ToArray();
        }
예제 #13
0
        public void SetSymbols(string value)
        {
            SymbolLibrary library = new SymbolLibrary();

            value = value.StripWhiteSpace();
            value = value.StripInvalidPathChars();
            var symbolFileArray = value.Split(new char[] { ',' });
            var symbolList      = new List <string>();

            for (int i = 0; i < symbolFileArray.Length; i++)
            {
                var tempSymbolFile = symbolFileArray[i].Trim();
                if (!string.IsNullOrEmpty(tempSymbolFile))
                {
                    var symbol = library.GetSymbolProperties(tempSymbolFile);
                    symbol.SymbolFile = tempSymbolFile;
                    symbol.ChartGroup = i + 1;
                    log.Info(symbol + " set to chart group " + symbol.ChartGroup);
                    symbolInfo.Add(symbol);
                    symbolList.Add(tempSymbolFile);
                }
            }
        }
예제 #14
0
        public void AusSigns()
        {
            var symbolLibrary = new SymbolLibrary(_tabName, _buttonName, "");

            symbolLibrary.ShowDialog();
        }