Cubit 15.2 User Documentation
Python users are able to import Cubit into Python and make calls into Cubit via CubitInterface and the other Python classes described in this section. Below is a simple Python script. The key parts are ensuring the Cubit libraries are on the path and ensuring the cubit.init() call is made first.
import sys
# add Cubit libraries to your path
sys.path.append('/opt/cubit/bin')
import cubit
#start cubit - this step is key
cubit.init([''])
height = 1.2
blockHexRadius = 0.1732628
#hexagon
baseBlock = cubit.prism(height, 6, blockHexRadius, blockHexRadius)
#etc . . .