Assume your target for dividing is entity of Curve type (line, polyline, arc, circle). So, you know the curve's length. You divide the length by the number of segement, you get distance (along the curve) of each segment. Then you call
Curve.GetPointAtDist(double distance)
to get a Point3d along the curve.
Once you get all the points (Point3d), then it is up to you to actually emulate the Divide command (draw DBPoint at each point, or draw something like block at the points), or do something with the group of Point3ds.