Maptitude GISDK Help |
Imports features from a DXF file into a geographic file.
dxf_vw = ImportDXF(string filename, string new_db_name, string layer_type, array options)
Argument |
Contents |
filename |
The path and file name of the DXF file to import |
new_db_name |
The path and file name of the new geographic file |
layer_type |
The type of features to import: "Point", "Line", or "Area" |
Option |
Type |
Contents |
Entity Types |
Array |
An array of strings listing the types of entities to import; omit this option to import all entities of the correct type |
Expand |
Boolean |
If "True" blocks in the DXF file are expanded into separate entities in the geographic file; if "False" blocks are not expanded |
Fields |
Varies |
The string "All" to import all attributes, null to import none of the attributes, or an array of attribute field names indicating the fields to import; this option is required |
Label |
String |
A descriptive label for the geographic file |
Layer Name |
String |
The name of the layer in the geographic file |
Layers |
Array |
An array of DXF layer names indicating the layers to import, or the string "All" to import all layers; a required option |
Median Split |
Boolean |
If "True" special handling insures that entities which cross the 180 degree longitude line are imported properly; if "False" (the default), no special handling is invoked |
NAD Conversion |
3 strings |
Input datum, output datum, and conversion file (if needed); the input and output datums should be different |
Node Layer Name |
String |
The desired name for the endpoint layer (only when importing a line layer) |
Optimize |
Boolean |
Whether to optimize the geographic file automatically after the import (defaults to "True") |
Overlap |
String |
Describes what to do with areas that overlap; takes one of the following values: "Ignore" - Leave overlaps as-is and simply create a non-topological database, possibly containing overlapping areas "Merge" (the default) - Where two areas overlap, merge the intersection into one of them; which one is arbitrarily decided "New" - Create a new area where the two areas overlap |
Projection |
String, array |
The projection name and the array of options |
Table Filename |
String |
The path and name of the file in which attributes are stored; the file extension must be .BIN, .CSV, .DBF, or .TXT; this option is required |
Topology |
Boolean |
For area layers, a value of "True" indicates that the resulting geographic file should have true area topology, which requires substantial complex processing. A value of "False" means that boundary edges can be duplicated, so that larger files can be imported. This option does not apply to point and line layers. If the Expand option is "True", this option is ignored |
Transform |
Array |
Array indicating the transformation to apply to coordinates in the file. This can have three forms: 1. An array of two or more four-element arrays containing local and world coordinates for control points, for example, {{real localX1, real localY1, real longitude1, real latitude1}, ...} 2. An array of four elements - {real X_multiplier, real Y_multiplier, real X_offset, real Y_offset} 3. Center and Extent transform {c1_x, c1_y, width_1, c2_x, c2_y, width_2}where center is shifted from (c1_x,c1_y) to (c2_x,c2_y), and vector of length width_1 out of c_1 becomes a vector of length width_2 out of c_2. |
A string containing the name of the joined view linking the DXF layer to the block attribute table.
Attributes are stored at the block level in a DXF file. If the Fields option is used, the block attribute table is created and linked to the geographic file using a Block ID field in the geographic file.
The projection option "units=us-ft" must be specified for normal 1927 State Plane data.
The Layers, Fields, and Table Filename options are required.
For more details on the NAD Conversion option, see Datum Conversions.
For more details on the Projection option, see Using Projections and Coordinate Systems.
If no transformation is applied, longitude and latitude coordinates can be integers with six implied decimal places (millionths of a degree). For more details, see Transformations.
ImportDXF("c:\\dxffiles\\sample.dxf", "streets.dbd", "Line", {
{"Label", "Street Centerline File"},
{"Layer Name", "Centerline"},
{"Layers", "All"},
{"Fields", "All"},
{"Table Filename", "streetsdata.bin"},
{"Optimize", "True"},
{"Projection", "utm", {"zone=12", "units=m"}},
{"NAD Conversion", "NAD27", "NAD83",}
})
Error Type |
Meaning |
Error |
The file is not a valid DXF file |
NotFound |
There is no file with the specified name; or there are no entities in the designated layers of the desired type |
Function |
Summary |
Frees memory used by GetDXFInfo() |
|
Exports features in a geographic file to a DXF file |
|
Collects summary information on the contents of a DXF file |
©2025 Caliper Corporation | www.caliper.com |