Skip To Content

esri_maplayer_extract (AutoLISP)

Converts a visible Esri map or image layer into a standard AutoCAD raster graphic and stores it as a graphics file in the specified file directory. The map layer or image layer must be visible in the drawing. A list of (T) is returned if successful. The map layer remains in the drawing after extraction. To remove a map layer, use the (esri_maplayer_remove) function.

Syntax

(esri_maplayer_extract maplayerid imagefilepath)

Arguments

  • maplayerid | integer | required | The map layer identification number associated with the layer that can be obtained using (esri_maplayers) function.
  • imagefilepath | string | required | The file path to the new image file that is created from the specified map or image layer. There is no option to overwrite the specified file. File must not exist.

Example usage

Attempts to extract the map or image layer with the index number of 2 as a PNG image named myExtractedLayer.png.

(esri_maplayer_extract 1 "C:\\myExtractedFolder\\myExtractedLayer.png")

Result example usage

Copies the specified map layer to an AutoCAD image entity within the drawing and saves a snap shot of the layer as a .png file and then returns a list of true:

(T)

Return values

This function returns a value.

  • If successful, it returns a list of true: (T)
  • If failed, it returns a list with the first value of nil; then an associated list is returned containing the key value Error and an associated error message as a string: (nil ( "Error" . "<message>")).

Failed return values

A failed return value can occur for any of the following reasons:

  • (nil ("Error" . "Missing required argument."))

    One or more of the required arguments was not supplied.

  • (nil ("Error" . "No item selected"))

    The indexed layer was not found.

  • (nil ("Error" . "Index was outside the bounds of the array."))

    Too many arguments were included.

  • (nil ("Error" . "Failed."))

    Image file already exists.