Feature Class Z to ASCII (3D Analyst)

Exports 3-D points, multipoints, polylines, or polygons to ASCII text files in XYZ or GENERATE format.


Usage tips

Syntax

FeatureClassZToASCII_3d (in_feature_class, output_location, out_file, format, delimeter, decimal_format, digits_after_decimal, decimal_separator)
Parameter Explanation Datatype
Input Feature Class (Required)

The feature class to export.

Feature Layer
Output Location (Required)

The folder where the file(s) will be written.

String
Output Text File (Required)

The output file name. The file name is used as template when exporting a feature class containing multiple lines or polygons to XYZ format.

File | Folder
Output File Format (Optional)

One of two different simple ASCII text formats for 3-D feature data.

String
Delimiter (Optional)

The text character used to separate numbers.

String
Decimal Notation (Optional)

The decimal format of the output floating point values. AUTOMATIC determines how many digits are needed to preserve available precision while removing unnecessary trailing zeros. FIXED will write a specific number of digits after the decimal. The default is 3. This can be changed via the digits_after_decimal parameter.

String
Digits after Decimal (Optional)

Used when the decimal_format is set to FIXED, this determines how many digits after the decimal are written for the floating point values written to the output file(s).

Long
Decimal Separator (Optional)

The ASCII file separator. The default is DECIMAL_POINT.

String
Data types for geoprocessing tool parameters

Script Example

# Purpose: Create text files from feature classes.

# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

#Check out the 3D Analyst extension
gp.CheckOutExtension ("3D")

try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    gp.workspace = "D:/Docs1/GP/GPOutput"

    # Select the 3D Analyst Toolbox
    gp.toolbox = "3D"

    # Process: creating an ASCII input file from a feature class
    gp.featureclassztoascii_3d("masspntz2.shp", "D:/Docs1/GP/GPOutput", "masspntz4.txt", "XYZ", "COMMA", "FIXED", "6", "DECIMAL")

except:
    # If an error occurred while running the tool print the error messages.
    print gp.GetMessages()