<div dir="ltr"><div><div>Hi,<br><br></div>I'm able to create a new rule based labeling setup from scratch like this minimal example :<br><code><br><span class="gmail-pln"></span></code><span style="font-family:monospace,monospace">root = QgsRuleBasedLabeling.Rule(QgsPalLayerSettings())<br>settings = QgsPalLayerSettings()<br>rule = QgsRuleBasedLabeling.Rule(settings)<br>root.appendChild(rule)<br>rules = QgsRuleBasedLabeling(root)<br>myLayer.setLabeling(rules)</span><br><br>Unfortunately I can't find how to iterate over existing rules, the <a href="http://python.qgis.org/api/core/Vector/QgsVectorLayer.html?#qgis.core.QgsVectorLayer.labeling" rel="nofollow noreferrer">labeling()</a> method available for vector layers return an object of <a href="http://python.qgis.org/api/core/Abstract/QgsAbstractVectorLayerLabeling.html" rel="nofollow noreferrer">QgsAbstractVectorLayerLabeling</a> class but it seems there is no way to get the root rule (<a href="http://python.qgis.org/api/core/Rule/QgsRuleBasedLabeling.html" rel="nofollow noreferrer">QgsRuleBasedLabeling</a>)
 from this class. The only possibility I found is to get directly pal 
settings using providers ids but I can't access to rules tree. Anyone 
have a clue ?<br><br></div>Thanks in advance for any help<br></div>