Documentation RhinoCommon API

Python III - Import a library:

import Rhino

p0 = Rhino.Geometry.Point3d(1,2,3)

Python III - Import a specific namespace and give it a name (If you do the following you are also importing the library “import Rhino”):

import Rhino.Geometry as rg

p0 = rg.Point3d(1,2,3)

Python III - Import individual types:

from Rhino.Geometry import Point3d, Vector3d

p0 = Point3d(1,2,3)
v0 = Vector3d(0,0,1)
p0 = p0 + v0

Python III - When the list becomes long or you want to use all the names from a module you can use symbol “*”:

# instead of doing this:
from Rhino.Geometry import Point3d, Vector3d, Plane, Polyline, Surface, Mesh, Transform

# we can import all the names that the module defines:
from Rhino.Geometry import *