When placing objects within a certain area this would be very very handy. being able to set the endpoint of the array and distribute all objects in this area. Would currently use the ‘Linear Array’, move the outer bar to the outer edge and then firing the distribute script.
That is a great idea! The command would ideally ask for the extents, then how many copies, then place both end copies and equally space the other copies in-between.
That way, you don’t have to subtract one or 1/2 copy to compensate.
I agree this would be useful and I’ve brought it up before with @dale. My understanding is that the array commands don’t look at the dimensions of the object being arrayed but rather place the object at points created in a very similar way to the Divide command. I’m not sure if the current array commands could be changed to offer this option but I made a simple Grasshopper definition that may help. Note the measurement of the X direction of the referenced objects bounding box. If the model is aligned in another direction that would need to be taken into account.
EvenDistribution_BJames.gh (11.5 KB)
Check out this tool:
@dale I love the ‘LabsArray’!! Will play around and give you feedback Thanks so much!!!
tyi @dale for strange reasons it won’t snap the span to endpoints of my spacer curve…
What don’t snap? What are you trying to do? Can you post some sample geometry and step-by-step instructions on how to repeat what you are seeing?
here’s a python solution:
ArrayBetween.py (605 Bytes)
import rhinoscriptsyntax as rs def array_between(): obj = rs.GetObject('Select object to array', 0, True) if not obj: return rs.SelectObject(obj) amount = rs.GetInteger('How many objects in array') if not amount: return point1 = rs.GetPoint('Pick start point') if not point1: return point2 = rs.GetPoint('Pick end point') if not point2: return vector = rs.VectorCreate(point2, point1) copyvec = rs.VectorDivide(vector, amount - 1) for i in range(1, amount): copy = rs.CopyObject(obj, copyvec * i) rs.UnselectObject(obj) array_between()
from this thread:
This might work; perform the Array along curve function as you have already done, but specify one instance more than what you require, then delete the last instance. I think if you want 10 and specify 11, the first 10 will be where you want them, then just delete #11.
@dhall Great simple idea! thanks mate H
Labsarray is nice tool to have in the library.