<div dir="ltr"><div><span style="font-size:12.8000001907349px">Hi,</span></div><div><br></div><div><div><span style="font-size:12.8000001907349px">can somebody help me with load  a dxf file  as a vector layer?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Is QgsDataSourceURI an option? I tried with this code, but I haven't been lucky.</span></div></div><div><br></div><div>fitxer="/tmp/prova.dxf"<br></div><div><div>uri = QgsDataSourceURI()</div><div>uri.setDatabase(fitxer)</div><div>uri.setDataSource('', 'entities', None, "OGR_GEOMETRY='POINT'", 'EntityHandle')</div><div><br></div><div>layer = QgsVectorLayer(uri.uri(), 'prova', 'ogr')</div><div><br></div><div>print 'source:', layer.source()</div><div>print 'isValid:', layer.isValid()</div></div></div>