Dear all,I have a processing algorithm that names its output based on the input layer's name, e.g. if buffering a layer called 'powerlines_110kW' with 40m the output layer would be called 'powerlines_110kW+40m'. For the input I use QgsProcessingParameterFeatureSource (instead of VectorLayer), so that the "Selected features only" option is available.
My problem is, when "Selected features" is unchecked, I can get the input layer's name with the 'parameterAsVectorLayer(parameters, 'INPUT', context).name()' method. However, when "Selected features" is checked, 'parameterAsVectorLayer()' returns None. This makes sense, as I believe the input becomes wrapped in a QgsProcessingFeatureSourceDefinition. Is there any way to get the layer's name before the selected features are extracted/filtered from the selected vector layer (the one given by the user in the ComboBox)?
Many thanks André
_______________________________________________ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user