Hi Yang,

The `rs.AddLinearDimension`

function could really take an input plane, not just dimension locations. I’ll add this to the “to-do” list. In the mean time, try using this special version of `rs.AddLinearDimension`

.

```
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext
import System
def MyLinearDimension(view_plane, start_point, end_point, point_on_dimension_line):
# Coerce input
plane = rs.coerceplane(view_plane)
start = rs.coerce3dpoint(start_point, True)
end = rs.coerce3dpoint(end_point, True)
onpoint = rs.coerce3dpoint(point_on_dimension_line, True)
# Set origin of plane
plane.Origin = start
# Calculate 2d dimension points
success, s, t = plane.ClosestParameter(start)
start = Rhino.Geometry.Point2d(s,t)
success, s, t = plane.ClosestParameter(end)
end = Rhino.Geometry.Point2d(s,t)
success, s, t = plane.ClosestParameter(onpoint)
onpoint = Rhino.Geometry.Point2d(s,t)
# Add the dimension
ldim = Rhino.Geometry.LinearDimension(plane, start, end, onpoint)
if not ldim: return scriptcontext.errorhandler()
rc = scriptcontext.doc.Objects.AddLinearDimension(ldim)
if rc==System.Guid.Empty: raise Exception("unable to add dimension to document")
scriptcontext.doc.Views.Redraw()
return rc
```

You can use the above method as follows:

```
# World Top plane
view_plane = rs.PlaneFromFrame([0,0,0], [1,0,0], [0,1,0])
start_point = (5,5,0)
end_point = (15,5,0)
point_on_dimension_line = (15,7,0)
MyLinearDimension(view_plane, start_point, end_point, point_on_dimension_line)
# World Front plane
view_plane = rs.PlaneFromFrame([0,0,0], [1,0,0], [0,0,1])
start_point = (5,0,5)
end_point = (15,0,5)
point_on_dimension_line = (15,0,7)
MyLinearDimension(view_plane, start_point, end_point, point_on_dimension_line)
# World Right plane
view_plane = rs.PlaneFromFrame([0,0,0], [0,1,0], [0,0,1])
start_point = (0,5,5)
end_point = (0,15,5)
point_on_dimension_line = (0,15,7)
MyLinearDimension(view_plane, start_point, end_point, point_on_dimension_line)
```

Does this help?