Class: QgsProcessingParameterDxfLayers

class qgis.core.QgsProcessingParameterDxfLayers(name: str, description: str = '')

Bases: QgsProcessingParameterDefinition

Constructor for QgsProcessingParameterDxfLayers.

QgsProcessingParameterDxfLayers(QgsProcessingParameterDxfLayers)

A parameter for Processing algorithms that need a list of input vector layers to export as DXF file - this parameter provides Processing framework’s adapter for QList<QgsDxfExport.DxfLayer>.

A valid value for this parameter is a list (QVariantList), where each item is a map (QVariantMap) in this form: { ‘layer’: string or QgsMapLayer, ‘attributeIndex’: int }

Also it can accept lists (either string lists or QgsVectorLayer list) as well as individual layer object or string representing layer source.

Static functions parametersAsLayers(), variantMapAsLayer(), layerAsVariantMap() provide conversion between QgsDxfExport.DxfLayer representation and QVariant representation.

New in version 3.18.

Parameters
  • name (str) –

  • description

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str
Parameters

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) –

Return type

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
Parameters
Return type

bool

clone(self)QgsProcessingParameterDefinition
Return type

QgsProcessingParameterDefinition

layerAsVariantMap(layer: QgsDxfExport.DxfLayer) → Dict[str, Any]

Converts a single input layer to QVariant representation (a QVariantMap)

Parameters

layer (QgsDxfExport.DxfLayer) –

Return type

Dict[str, Any]

parameterAsLayers(layersVariant: Any, context: QgsProcessingContext) → List[QgsDxfExport.DxfLayer]

Converts a QVariant value (a QVariantList) to a list of input layers

Parameters
Return type

List[QgsDxfExport.DxfLayer]

type(self) → str
Return type

str

typeName() → str

Returns the type name for the parameter class.

Return type

str

valueAsPythonString(self, value: Any, context: QgsProcessingContext) → str
Parameters
Return type

str

variantMapAsLayer(layerVariantMap: Dict[str, Any], context: QgsProcessingContext)QgsDxfExport.DxfLayer

Converts a QVariant value (a QVariantMap) to a single input layer

Parameters
Return type

QgsDxfExport.DxfLayer