CN103793365A - Method for converting SVG image into Visio image - Google Patents
Method for converting SVG image into Visio image Download PDFInfo
- Publication number
- CN103793365A CN103793365A CN201310453407.5A CN201310453407A CN103793365A CN 103793365 A CN103793365 A CN 103793365A CN 201310453407 A CN201310453407 A CN 201310453407A CN 103793365 A CN103793365 A CN 103793365A
- Authority
- CN
- China
- Prior art keywords
- graphics
- visio
- svg
- graphic
- converting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Processing Or Creating Images (AREA)
Abstract
本发明提供一种将SVG图形转换为Visio图形的方法,该将SVG图形转换为Visio图形的方法包括:步骤1,识别SVG图形文件中的Tbl文件,创建图形结构模型、连接信息模型以及属性信息模型;步骤2,获取SVG图形元素的坐标和Visio模具VSS文件;步骤3,根据所述SVG图形元素的坐标和所述Visio模具VSS文件,进行坐标对比,建立Visio图形元素的准确坐标;以及步骤4,根据步骤1-3获得的数据信息,绘制Visio图形。该将SVG图形转换为Visio图形的方法可以极大的解决通过手工绘制图形的问题,转换过程系统自动完成,方便了设计人员工作,提高了工作效率和节约资源。
The invention provides a method for converting SVG graphics into Visio graphics. The method for converting SVG graphics into Visio graphics includes: step 1, identifying the Tbl file in the SVG graphics file, creating a graphic structure model, connection information model and attribute information Model; Step 2, obtain the coordinates of the SVG graphic element and the Visio mold VSS file; Step 3, compare the coordinates according to the coordinates of the SVG graphic element and the Visio mold VSS file, and establish the exact coordinates of the Visio graphic element; and step 4. Draw Visio graphics according to the data information obtained in steps 1-3. The method for converting SVG graphics into Visio graphics can greatly solve the problem of manually drawing graphics, and the conversion process is automatically completed by the system, which facilitates the work of designers, improves work efficiency and saves resources.
Description
技术领域 technical field
本发明涉及文件转换机制,特别是涉及到一种将SVG图形转换为Visio图形的方法。 The invention relates to a file conversion mechanism, in particular to a method for converting SVG graphics into Visio graphics.
背景技术 Background technique
随着各种企业、公司的发展,越来越多的工作需要SVG图形、Visio图形。本技术着眼于设计人员在只有SVG图形的情况下,急切需要与SVG图形对应的Visio图形的情况。通过本发明能够高效的将SVG图形转换为Visio图形,解决了只有SVG图形而没有Visio图形的尴尬境地。各企业、公司目前出现这种状况,大都采用对照SVG图形去手工绘制对应的Visio图形的纯手工方法,耗时耗力而且在手动绘制的期间容易疏忽大意,效率低下。为此我们发明了一种新的将SVG图形转换为Visio图形的方法,解决了以上技术问题。 With the development of various enterprises and companies, more and more jobs require SVG graphics and Visio graphics. This technology focuses on the situation that designers urgently need Visio graphics corresponding to SVG graphics when they only have SVG graphics. The invention can efficiently convert SVG graphics into Visio graphics, and solves the embarrassing situation that there are only SVG graphics but no Visio graphics. In this situation, most enterprises and companies adopt the purely manual method of manually drawing the corresponding Visio graphics according to the SVG graphics, which is time-consuming and labor-intensive, and it is easy to be negligent and inefficient during manual drawing. For this reason, we have invented a new method for converting SVG graphics into Visio graphics, which solves the above technical problems.
发明内容 Contents of the invention
本发明的目的是提供一种简便操作、综合性能强、正确率高的自动将SVG图形转换为Visio图形的方法。 The purpose of the present invention is to provide a method for automatically converting SVG graphics into Visio graphics with simple operation, strong comprehensive performance and high accuracy. the
本发明的目的可通过如下技术措施来实现:将SVG图形转换为Visio图形的方法,该将SVG图形转换为Visio图形的方法包括:步骤1,识别SVG图形文件中的Tbl文件信息内容,创建图形结构模型、连接信息模型以及属性信息模型;步骤2,获取SVG图形元素的坐标和Visio模具VSS文件;步骤3,根据所述SVG图形元素的坐标和所述Visio模具VSS文件,进行坐标对比,建立Visio图形元素的准确坐标;以及步骤4,根据步骤1-3获得的数据信息,绘制Visio图形。 The object of the present invention can be realized by following technical measure: the method that SVG graphics is converted into Visio graphics, this method that SVG graphics is converted into Visio graphics comprises: Step 1, identify the Tbl file information content in the SVG graphics file, create graphics Structural model, connection information model and attribute information model; Step 2, obtain the coordinate of SVG graphic element and Visio mold VSS file; Step 3, according to the coordinate of described SVG graphic element and described Visio mold VSS file, carry out coordinate comparison, establish The exact coordinates of the Visio graphics elements; and step 4, draw the Visio graphics according to the data information obtained in steps 1-3.
本发明的目的还可通过如下技术措施来实现: The purpose of the present invention can also be achieved through the following technical measures:
该将SVG图形转换为Visio图形的方法还包括,在步骤1之前,根据工程需求建立模具图形样式,建立Visio图形模具VSS文件。 The method for converting SVG graphics into Visio graphics also includes, before step 1, establishing a mold graphics style according to engineering requirements, and establishing a Visio graphics mold VSS file.
该tbl文件信息内容包括图形文件以及基本模具文件。 The information content of the tbl file includes graphic files and basic mold files.
在步骤3中,确定新生成的Visio图形元素的坐标和所述SVG图形元素的坐标差异值,坐标的差异值减去当前坐标点,取其绝对值,为Visio图形元素坐标点,以建立Visio图形元素的准确坐标。 In step 3, determine the coordinate difference value of the coordinates of the newly generated Visio graphic element and the described SVG graphic element, subtract the current coordinate point from the difference value of the coordinates, take its absolute value as the Visio graphic element coordinate point, to establish Visio The exact coordinates of the graphics element.
在步骤4中,根据Visio模具文件自动绘制图形并且添加连接关系,在绘制图形的同时根据原图信息添加设备所需属性。 In step 4, the graphics are automatically drawn according to the Visio mold file and the connection relationship is added, and the required attributes of the equipment are added according to the original drawing information while drawing the graphics.
该将SVG图形转换为Visio图形的方法还包括,在步骤4之后,在步骤4之后,进行图形校验和图形修正;根据转换后的连接信息以及数据信息形成XML格式数据文件和图形文件;以及将图形保存至设定目录或设定数据库。 The method for converting SVG graphics into Visio graphics also includes, after step 4, performing graphics verification and graphics correction; forming XML format data files and graphics files according to the converted connection information and data information; and Save the graph to a settings directory or a settings database.
在进行图形校验和图形修正的步骤中,根据转换后的Visio图形显示,判断图形的连接状态,是否存在孤岛、信息不完整的情况。 In the steps of graphic verification and graphic correction, according to the converted Visio graphic display, the connection status of the graphic is judged, and whether there is an isolated island or incomplete information.
在进行图形校验和图形修正的步骤中,根据图形校检的判断结果,连接错误的进行智能更正或者记录错误日志后人为修正,直至正确。 In the step of performing graphic verification and graphic correction, according to the judgment result of the graphic verification, intelligent correction is performed on wrong connection or manual correction is made after recording error logs until it is correct.
在进行图形校验和图形修正的步骤中,根据图形校检的判断结果,如果存在孤岛状态,按照一定的范围,分析有可能连接的设备,根据设备设定范围值自动连接,消除孤岛。 In the steps of graphic verification and graphic correction, according to the judgment result of graphic verification, if there is an island state, analyze the equipment that may be connected according to a certain range, and automatically connect according to the set range value of the equipment to eliminate the island.
在进行图形校验和图形修正的步骤中,根据图形校检的判断结果,如出现信息不完整情况,可提示缺失信息,并以黄色标记警告,再自动补充相关信息。 In the steps of graphic verification and graphic correction, according to the judgment result of graphic verification, if the information is incomplete, the missing information can be prompted, and the warning will be marked in yellow, and then the relevant information will be automatically supplemented.
在进行图形校验和图形修正的步骤中,当系统检验图形修正后依然不正确,系统在错误元件图形上标注红色,显示需要人工参与修改的设备,完成后,继续进行图形校验。 In the steps of graphics verification and graphics correction, when the system checks and corrects the graphics and is still incorrect, the system will mark the wrong component graphics in red to display the equipment that needs manual modification. After completion, continue to perform graphics verification.
本发明中的将SVG图形转换为Visio图形的方法,只需要工作设计人员指定转换目录即可,转换过程由系统自动完成,即使原图出现绘制问题系统也可自动修复,极大地方便了设计人员的工作,提高了图形设计进度和效率,节约了资源,也避免了一些重复性错误。 The method for converting SVG graphics into Visio graphics in the present invention only needs the working designer to specify the conversion directory, and the conversion process is automatically completed by the system. Even if there is a drawing problem in the original drawing, the system can automatically repair it, which greatly facilitates the designer. The work has improved the progress and efficiency of graphic design, saved resources, and avoided some repetitive errors.
附图说明 Description of drawings
图1为本发明的将SVG图形转换为Visio图形的方法的一具体实施例的流程图; Fig. 1 is the flow chart of a specific embodiment of the method for converting SVG graphics into Visio graphics of the present invention;
图2为本发明的一具体实施例中的SVG原图; Fig. 2 is the original picture of SVG in a specific embodiment of the present invention;
图3为将图2中的SVG原图转换成的VISIO图形。 Fig. 3 is the VISIO graphic converted from the original SVG image in Fig. 2 .
具体实施方式 Detailed ways
为使本发明的上述和其他目的、特征和优点能更明显易懂,下文特举出较佳实施例,并配合所附图式,作详细说明如下。 In order to make the above and other objects, features and advantages of the present invention more comprehensible, preferred embodiments are listed below and described in detail in conjunction with the accompanying drawings.
如图1所示,图1为本发明的将SVG图形转换为Visio图形的方法的一具体实施例的流程图。 As shown in FIG. 1 , FIG. 1 is a flowchart of a specific embodiment of the method for converting SVG graphics into Visio graphics according to the present invention.
在步骤101,建立Visio图形模具VSS文件。在此步骤中,制作Visio模具,根据工程需求建立模具图形样式,形成Visio图形专用的Vss文件。流程进入到步骤102。
In
在步骤102,从SVG图形数据源中根据SVG图形的指定路径,获取SVG图形文件中的Tbl文件,tbl文件信息内容包括图形文件以及基本模具文件,系统自动读取指定磁盘目录下合适文件。流程进入到步骤103。
In
在步骤103,识别SVG图形文件中的Tbl文件信息内容创建图形结构模型以及属性信息模型,系统读取SVG图形文件内连接信息以及各种属性信息。流程进入到步骤104。
In
在步骤104,获取所述SVG图形元素的坐标和所述Visio模具VSS文件,SVG图形内一些单位以及坐标体系与Visio存在差异性。流程进入到步骤105。
In
在步骤105,进行坐标对比。根据所述SVG图形元素的坐标和所述Visio模具VSS文件,确定新生成的Visio图形元素的坐标和所述SVG图形元素的坐标差异值,坐标的差异值减去当前坐标点,取其绝对值,为Visio图形元素坐标点,建立Visio图形元素的准确坐标。流程进入到步骤106。
In
在步骤106,绘制图形。系统根据上面操作后得到的数据信息,根据Visio模具文件自动绘制图形并且添加连接关系,在绘制图形的同时根据原图信息添加设备所需属性。流程进入到步骤107。
In
在步骤107,进行图形校验。根据转换后的Visio图形显示,判断图形的连接状态:是否存在孤岛、信息不完整等情况。流程进入到步骤108。
In
在步骤108,进行图形修正,根据判断结果,连接错误的进行智能更正或者记录错误日志后人为修正,直至正确。具体说来,根据判断结果,如果存在孤岛状态,按照一定的范围,分析有可能连接的设备,根据设备设定范围值自动连接,消除孤岛;如出现信息不完整情况,可提示缺失信息,并以黄色标记警告,再自动补充相关信息;如果图形正常,即进入步骤109;当系统检验图形修正后依然不正确,系统在错误元件图形上标注红色,显示需要人工参与修改的设备,完成后,继续本步骤检核。
In
在步骤109,图形转换正常,形成数据文件,根据转换后的连接信息以及数据信息形成XML格式数据文件和图形文件。流程进入到步骤110。
In
在步骤110,进行图形保存。将图形保存至设定目录或设定数据库。流程结束。 In step 110, graphic saving is performed. Save the graph to a settings directory or a settings database. The process ends.
下图2为本发明的一具体实施例中的SVG原图,为电力系统一次接线图,19个负荷由10kvI分段母线供电。下图3为将下图2中的SVG原图转换成的VISIO图形。从图2和图3可以看出,使用本发明中的方法,可以成功的将SVG图形转换为Visio图形。 Figure 2 below is the original SVG diagram in a specific embodiment of the present invention, which is the primary wiring diagram of the power system, and 19 loads are powered by 10kvI segmental busbars. Figure 3 below is the VISIO graphic converted from the original SVG image in Figure 2 below. It can be seen from Fig. 2 and Fig. 3 that the SVG graphics can be successfully converted into Visio graphics using the method of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310453407.5A CN103793365A (en) | 2013-09-29 | 2013-09-29 | Method for converting SVG image into Visio image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310453407.5A CN103793365A (en) | 2013-09-29 | 2013-09-29 | Method for converting SVG image into Visio image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103793365A true CN103793365A (en) | 2014-05-14 |
Family
ID=50669052
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310453407.5A Pending CN103793365A (en) | 2013-09-29 | 2013-09-29 | Method for converting SVG image into Visio image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103793365A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105427353A (en) * | 2015-11-12 | 2016-03-23 | 小米科技有限责任公司 | Compression and drawing method and device of scalable vector graphic |
CN105718636A (en) * | 2016-01-14 | 2016-06-29 | 中国南方电网有限责任公司 | Automatic conversion method for station primary wiring diagram model |
CN107221016A (en) * | 2016-03-22 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The processing method and its device of the Path figures of SVG forms |
US10664980B2 (en) | 2017-06-08 | 2020-05-26 | Microsoft Technology Licensing, Llc | Vector graphics handling processes for user applications |
CN117910417A (en) * | 2024-01-19 | 2024-04-19 | 深圳市航顺芯片技术研发有限公司 | Method, device and terminal equipment for converting SVG image to Visio image |
-
2013
- 2013-09-29 CN CN201310453407.5A patent/CN103793365A/en active Pending
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105427353A (en) * | 2015-11-12 | 2016-03-23 | 小米科技有限责任公司 | Compression and drawing method and device of scalable vector graphic |
CN105427353B (en) * | 2015-11-12 | 2019-05-21 | 小米科技有限责任公司 | Compression, method for drafting and the device of scalable vector graphics |
CN105718636A (en) * | 2016-01-14 | 2016-06-29 | 中国南方电网有限责任公司 | Automatic conversion method for station primary wiring diagram model |
CN105718636B (en) * | 2016-01-14 | 2019-06-28 | 中国南方电网有限责任公司 | A kind of plant stand main wiring diagram model automatic switching method |
CN107221016A (en) * | 2016-03-22 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The processing method and its device of the Path figures of SVG forms |
CN107221016B (en) * | 2016-03-22 | 2021-05-18 | 阿里巴巴集团控股有限公司 | Processing method and device for Path graph in SVG format |
US10664980B2 (en) | 2017-06-08 | 2020-05-26 | Microsoft Technology Licensing, Llc | Vector graphics handling processes for user applications |
CN117910417A (en) * | 2024-01-19 | 2024-04-19 | 深圳市航顺芯片技术研发有限公司 | Method, device and terminal equipment for converting SVG image to Visio image |
CN117910417B (en) * | 2024-01-19 | 2024-11-19 | 深圳市航顺芯片技术研发有限公司 | Method and device for mutually converting svg graph and visio graph and terminal equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103793365A (en) | Method for converting SVG image into Visio image | |
CN103353871A (en) | Interoperation picture file checking method based on CIM/G standard | |
CN104572153A (en) | Update data conversion method for vehicle updating | |
CN108228726B (en) | Incremental change content acquisition method and storage medium of distribution network celebrity black map | |
CN110188150A (en) | Modeling method and computer-readable storage medium for distribution network diagram | |
CN110929309B (en) | Automatic verification method for protection section list document in urban rail signal system | |
CN114117798B (en) | A method and system for automatically generating interface models based on MATLAB | |
CN105929277A (en) | Method and system for standardizing automatic testing schemes of replay protection device | |
CN102968349A (en) | Method and system for file completeness verification of remote sensing image data | |
CN106909386A (en) | A kind of cloud platform code continuous integrating method and system | |
CN103246512B (en) | A kind of is the method for Visio figure by VG Graphic Exchanging | |
CN105678055A (en) | Universal probabilistic safety assessment model conversion system | |
CN106682275B (en) | Load processing method and device for industrial factory building structure modeling | |
CN102566303A (en) | The Method of Automatically Embedding Light Drawing Parameters in Barco Photoplotter | |
CN101859410A (en) | A method for automatically generating cable laying lists for ships and ocean engineering | |
CN108255697B (en) | SMT-based vehicle-mounted controller software semi-formalization requirement verification system and method | |
CN105825032A (en) | Method for automatically acquiring center coordinates of structure frame | |
CN105740579A (en) | Building method for connecting UVM verification platform | |
CN103257861B (en) | A kind of method of automatic generation bios code and device | |
CN101211382A (en) | Method for automatically correcting circuit diagram frame | |
CN105912380A (en) | Method for converting EDIF netlist file to Protel netlist file | |
CN104111839A (en) | Absolute positioning method based on canvas | |
CN104346485A (en) | Verification system and method of timing constraint consistency of Synopsys model and simulation model | |
CN103019747B (en) | Precise identification of smart device configuration change methods | |
CN103324473A (en) | System and method for converting visio graph into VG graph |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140514 |