import os
import sys

gisbase = "C:\\Program Files (x86)\\QGIS Lyon\\apps\\grass\\grass-6.4.4"

os.environ['GISBASE'] = gisbase

grasspydir = os.path.join(gisbase, "etc", "python")
sys.path.append(grasspydir)

gisdbase = "D:\\Grassdata"
location = "my_location"
mapset   = "my_mapset"

import grass.script as grass
import grass.script.setup as gsetup

gsetup.init(gisbase,gisdbase,location,mapset)

input_dgn = "D:\\my_input.dgn"

grass.run_command("v.in.ogr",
                  dsn = input_dgn,
                  output = 'my_output',
                  type = 'boundary,centroid',
                  snap = 0.01,
                  min_area = 1,
                  where = """"Level" = 1""")

