Tag Info

New answers tagged

1

Further to Dan's answer on enumerating layers... with the UID.Value of IRasterLayer (see example UIDs here) supplied to the get_layers function you don't need to check later that it is a raster layer you're playing with, however sometimes you need to use the UID for IDataLayer which will return feature layers and raster layers, so to check this use: if ...


3

The easiest way to loop through layers in ArcMap is to use IEnumLayer. You get a reference to that from IMap.Layers. http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000482000000 Then check the type and cast each raster layer returned by the enumerator to IRasterLayer. ...


1

The problem is that 'QgsVectorLayer' objects have not attribute 'renderer'. This kind of method is for raster layers. If you want to change the transparency of QgsVectorLayer objects you have to use the method: 'setLayerTransparency(int)'; located in QgsVectorLayer class. Next code works for these kind of objects: mc=iface.mapCanvas() layers=[] n = ...



Top 50 recent answers are included