I am pretty much following the procedure of this answer but I can't get my head around as to where to set the 'Units' from 'Map Units' (default) to Millimeters that is.

So far, I tried several variants to define a unit type and set the symbol layer to it:

millimeters = QgsUnitTypes.DistanceUnit.Millimeters

1 Answer 1


You have to use QgsUnitTypes.RenderMillimeters.

layer = iface.activeLayer()

mm = QgsUnitTypes.RenderMillimeters

symbolLayer(1) must be an instance of QgsGeometryGeneratorSymbolLayer.

You can find different unit types in source code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.