BlenderGIS import call from python script My goal is to import a .shp file into blender within my python script. I found the add-on BlenderGIS that offers this functionality. I can add the add-on to blender make it work "manually", but I want to call the import function from a python script.

I am new to Blender and I cannot find what the right way is to import a add-on/BlenderGIS into a python script.

Among other things, I tried the following:

import bpy
import sys
import os

dir = os.path.dirname(bpy.data.filepath)
if not dir in sys.path:
    sys.path.append(dir )

import io_shapefile

file = "path/to/file.shp"

bpy.ops.importgis(file)


This gives the error:

Traceback (most recent call last):
  File "&lt;blender_console&gt;", line 1, in &lt;module&gt;
TypeError: 'BPyOpsSubMod' object is not callable


Can someone point me in the right direction on how to import a .shp from a python script?

Thanks in advance
Have a look at the operator name when you mouse over it, in this case bpy.ops.importgis.shapefile()

Now in the python console type in command and using autocomplete ctrl-space

&gt;&gt; bpy.ops.importgis.shapefile(
shapefile()
bpy.ops.importgis.shapefile(filepath="", filter_glob="*.shp", useFieldElev=False, fieldElevName="", useFieldExtrude=False, fieldExtrudeName="", extrusionAxis='Z', angCoords=False, separateObjects=False, useFieldName=False, fieldObjName="")


You get the operator call and the parameters.  Testing with a local filepath

&gt;&gt;&gt; bpy.ops.importgis.shapefile(filepath="/mnt/.../GDAL/contour.shp")
Read shapefile...
Feature type : PolyLine
DBF fields : ['id', 'elev']
0%
10%
20%
...
90%
100%
Imported mesh had some problem, check the result!
{'FINISHED'}

&gt;&gt;&gt;