# Distribute grouped objects along edges

hi. I'm stuck at trying to distribute grouped objects along a given objects edges. At first I thought it was similar as with the case of vertices but it turned out to be quite complicated.
Hope I was clear. Anyones help highly appreciated.

## Comment viewing options

### Thanks.

"barigazy" Thank you.

### #2 example

And this is the thing that you asked

```delete objects
numOfCopy = 8
obj = converttopoly (Box length:200 width:200 height:200 isselected:on wirecolor:black)
polyop.setEdgeSelection obj 8
max modify mode ; subobjectLevel = 2 ; max zoomext sel all

selEdge = (polyop.getEdgeSelection obj as array)[1]
edgVerts = polyOp.getEdgeVerts obj selEdge
a = for i = 1 to 2 collect (polyOp.getvert obj edgVerts[i])
theDir = normalize (a[2]-a[1])
theLength = (distance a[2] a[1])/(numOfCopy-1)
for i = 1 to (numOfCopy-1) do
(
ballCopy = copy ball
ballCopy.pos += (i*theLength*theDir)
ballCopy.wirecolor = random black white
)```

bga

### #1 example

In this example I use splineShape

```delete objects
numOfCopy = 8
a = #([15,30,20], [200,300,500])
b = splineshape wirecolor:yellow
for i = 1 to 2 do addKnot b 1 #corner #curve a[i]
theDir = normalize (a[2]-a[1])
theLength = (distance a[2] a[1])/(numOfCopy-1)