Share

AcDbLayerStateManager::exportLayerState

C++

Acad::ErrorStatus exportLayerState(
    const ACHAR * sNameToExport, 
    const ACHAR * sFilename
);

Description

exportLayerState() reads the passed-in layer state name and exports the corresponding layer state to the export file. The layer state name must be passed with a single 0 after the name.

Return Value Description
Acad::eOk The export was successful
Acad::eNullObjectId The layer state dictionary ID is Null
Acad::eNoFileName The passed in filename is Null or zero bytes
Acad::eWrongObjectType The passed in layer state name refers to something other than an Xrecord
Acad::eCantOpenFile The passed-in filename cannot be opened for writing
Acad::eNotInitializedYet The database is Null
Acad::eKeyNotFound The passed-in layer state name was not found in the layer state dictionary

Other possible Acad::ErrorStatus values unequal to Acad::eOk can come from internal calls to:

  • AcDbDatabase::getPlotStyleNameDictionary() while opening the plotstyle dictionary
  • AcDbDictionary::nameAt() while reading the string name of the plotstyle ID
  • acdbGetObjectId() while getting the object ID of the linetype, plotstyle, or layer
  • acdbOpenObject() while opening the Xrecord of the layer state
  • AcDbSymbolUtilities::getSymbolName() while getting the string form of the linetype or layer

Note that the export file will be removed if there is a failure during export.

Parameters

Parameters Description
sNameToExport Input layer state name to export
sFilename Input filename to export layer state to

Links

AcDbLayerStateManager

Was this information helpful?