So, you want to draw a series of short polylines of the same length along a path with an equal gap between them. So, the required inputs will be:
1. The path's length;
2. the segment's length;
3 the length of the gap;
With all these known, you can easily calculate each segment's start/end points, using
[PathPolyline].GetPointAtDist()
Pseudo-code:
void DrawingSegenebtsAlongPath(ObjectId pathId, double segLength, double setGap)
{
using (var tran = [Open a transaction]
{
var path=(Polyline)tran.GetObjectpathId, OpenMode.ForRead);
var currentLen=segLength;
var startPt=path.StartPoint;
while(currentLen < path.Length)
{
var endPt=path.GetPointAtDist(currentLen);
// now you have both start/end point of a segment
// draw the segment, add to database and transaction
... ...
// increment the start point of next segment
// then continue the loop
currentLen+=segGap
startPt=path.GetPointAtDist(currentLen);
currentLen+=segLegth
}
// after the loop ends, you will decide if you need to draw
// a last segment with its length less than segLength, so that the total
// currentLen equals the path.Length; or you draw a a full-length segment
// so that the segment array will slightly longer than the path.Length
... ...
tran.Commit();
}
}
As you can see, if there is a path curve exists, you can take advantage of GetPointAtDist() to make the calculation much easier. But depending on your business workflow, if the path is straight, you do not even need a path (polyline/line). Providing 2 points would be enough to apply your math knowledge to do the calculation of each segment's start/end point and draw them.
If you create your own command to let user to draw it, I'd imagine that you could make it a good user-friendly command in "Jig" style: user pick a point, while the mouse moves, a series of ghost segments shows with default segment length/gap, user could either enter different segment length/gap, or pick another point to actually draw the segments.