FME created using the CAD layer standard template

In our FME's blog inside information, describes how the method of standard data structure is generated in the GIS environment utilizing FME and Excel spreadsheet, then the following to tell you about the use of FME and Excel spreadsheets combine Python script how to generate standard drawings in AutoCAD environment method layer.

You get the CAD data production standards may be so, too many layers, too linear, too many colors below, a build you a headache.

 

You need to identify your computer environment FME Desktop software is properly installed, AutoCAD software, and the software can generate Excel spreadsheet.

      

Installing Python module pyautocad operating environment, download and install pyautocad module package. Run "import pyautocad" in python compiler, make sure the module is successfully installed and available.

The production standard normalized to Excel which alternate

Excel table using the standard normalized FME Desktop read by the CAD AttributeCreator layer name, linear, color rename field contents.

FME python script set in the operating environment, find the "Python Compatibility" at FME Desktop workspace parameters on the left navigation bar, pyautocad module installation path involved in the text of the python path in ArcGIS, therefore, choose "Esri ArcGIS Desktop (Python pyautocad file 2.7) "(If a user you are installing a different path, a path can be mounted in the package copied to the python path in the FME installation directory).

After setting the Python runtime environment of FME, add a PythonCaller converter on the canvas, using the PythonCaller add Python scripting language, create a CAD template file.

After setting the python scripting language, you can click on the Run button to run, but in time your script is no problem, no problem python runtime environment, but you may still have to run error, like this below.

Do not worry, after access to relevant information discovery, create a CAD file using the python script, you need to load line in advance. Simply put, what you need is not linear pre-loaded.

Usually the default when you open the CAD software will load a "0" layer, and "0" line layer used for the "CONTINUOUS", like so

So, when the program is running live your CAD data in standard production line using "CONTINUOUS" will not go wrong, if you are a non-linear "CONTINUOUS", will be similar to the above error. Next we need to pre-load all the data line production standards involved in open CAD software.

In an open CAD software, click on the layer in the line, you will find only a "CONTINUOUS",

You can click on the "Load" button to pre-load the rest of the line, after a pre-loaded and click OK.

 

In the re-run the program FME, you will find that you have added layers well in accordance with the requirements set in Excel. Results are as follows

Examples of the data referred to herein is relatively simple, interested friends can add some conditions, such as line width proportion. Or color without using color CAD index set, the RGB value is set, also provides to extract the elements in the CAD data custom color value and the RGB converter ACI index value in the FME. Python scripting language code covered in this article can be found on the network. While the FME in addition to the combination of Python to create a CAD template file, you can build the appropriate format to create a template file property CAD use FME.

E.g. "autocad_resolved_linetype", "autocad_color", "autocad_linetype_scale", "autocad_width" format attributes, specific method is implemented by you.

Published 350 original articles · won praise 169 · views 360 000 +

Guess you like

Origin blog.csdn.net/fmechina/article/details/104358398