How to evenly distribute different objects on a line (mac)?

Hi there! :smile:
Someone out there know how to evenly distribute different objects on a line? Can’t use array because i don’t want to copy one object - just want to arrange different but already existing objects with the same distance in between.
I have looked around on-line and it seems that I need some kind of script/plug-inn? tried to download a rvb-file which you should be able to drag-n-drop directly into the program - but didn’t work… Is this only working for the windows version?

  • I hope my question is clear? I’m a newbee :slight_smile:

Thanks in advance!
Else

Yes, an .rvb won’t work with Mac Rhino because it’s written in vbscript, which only runs on Windows. You need a python script, which will run on both platforms. I only have an .rvb for something similar to this as well. I can try and translate it later on (no time now).

Question - you say you want to distribute the objects equally spaced along a line? Is that a line that could be in any direction, or is it one of the principal axes?

–Mitch

Hi Mitch!
Thanks for the fast reply, and for helping me out!

  • regarding your question, I just need it to work in the x-axis for now.

  • Else

OK, this is a hack of another script I had, see if it will do what you want. You can space out objects along X, Y or Z; the objects’ positions in the other principal directions are unchanged.

Here’s how to install a python script in Mac Rhino and set it up to run from an alias:

Download the script file and move it to the following folder:

~/Library/Application Support/McNeel/Rhinoceros/Scripts

This is a hidden folder, to navigate to it, press and hold the Alt key and pull down the “Go” menu, you will see “Library” - navigate to the Scripts folder along the above path from there. For ease of use the next time, make a shortcut to the scripts folder on your desktop.

In Preferences>Aliases, create a new alias - call it anything you want- and in the right-hand path box next to the alias, copy and paste the following:
! _-RunPythonScript "ScriptFileName"

Where ScriptFileName is the name of the file you just copied to the scripts folder. Do enclose the name in quotes if the filename has spaces in it, even if not, it will not harm to have them.

That’s it, whenever you type the alias, the script will run. You should see it autocomplete even after typing just the first couple of letters.

–Mitch

SpaceOutObjsXYZ.py (3.1 KB)

… thanks!

Have now downloaded the file, but having troubles finding the folder “~/Library/Application Support/McNeel/Rhinoceros/Scripts” - where do I find that? I´ve found a folder called “library” containing a folder called “QuickLook”, but that’s all…
Is that the right place?

  • I’m sorry if it is a stupid question, but have never done this before :slight_smile:

-Else

When you hold down the Alt key and pull down the “Go” menu, do you see “Library”? If so, does it have a subfolder called “Application Support”?

–Mitch

…You mean doing that in the actual viewports of the program? If so… no I can’t see “library” in the drop-down menu.

  • Else

No, the “Go” menu is accessed from the Mac finder.

aha! now I understand - I’m using a danish version, so had to translate…
I see it now.
The script is working! but it is not really the function that I was looking for. It seems like, that with this script you can only type in the distance between the objects, and I need a function where I only know the path/distance where these different objects should be evenly distributed/same distance in between - if that makes sense?

  • but thanks for helping me out! learning everyday…

  • Else

I think he is wanting to distribute different items on a path. Each item would be equal distance apart along the length of a specified path. Like doing a “Array along a path” but with different selected objects.

Guessing the script would ask to select you objects you want to distribute. Select the path you want to distrubute the items on and the distance between each item. Correct?

Almost exactly correct! The only detail is that I don’t know the distance between the objects so the script should only ask to select the objects and the path to distribute the items on… The distance in between the objects is not important, just that the objects are evenly placed/distributed along the path, if that’s even doable…

-hope it makes sense!

ps: I’m a she :slight_smile:

1 Like

… Hey!
just wondering if you have a script like that? or if you know where I could find it?

thanks in advance

-Else

If it’s just for a few objects and you’re not doing it too often, you could consider doing it manually:

  1. make line where you have the line you want to distribute objects on
  2. use the Divide command on that line you made to split it into equal-length segments. Depending on if you include the ends of the line you’ll either have one less or two more points to distribute your items on.
  3. drag your objects with SmartTrack on with End and Center tracking on (I think that would do it…) to those endpoints created by the Divide command.

Hi Else - My take so far is that the spacing should be equal along the path curve where ‘spacing’ is measured as the gap between the intersection of the objects’ bounding boxes and the path curve… is that correct?

-Pascal

Hi Pascal,
Sounds right… If you mean the box which the objects are inscribed?

-@makeoceros: yah, maybe I should just do it “manually” as you describe it…
If there isn’t already a script for that kind of function…

-Else

Thank you!

For me this little script is absolutely useful!

Cheers
Peter

Maybe @pascal can convert his scripts from .rvb to python one day and everybody would greatly benefit…? The distribute of Pascal Golay executes this exact procedure.

Hi, I see this is a pretty old post, but following up,

The script is really good, thanks.

However I have noticed that for some reason it does not work for hatched items, or grouped object.

Is there was any chance you might be able update the script to include those items?

Thank you… : ]

Hi,

I am currently traveling on vacation, so won’t be able to look at it for awhile… I think hatches might be easy enough to include, but grouped objects will be quite a bit more complicated, as objects can be in multiple/nested groups, some group members can be hidden/locked, etc…

I’ll have a look when I get back, if you don’t hear back from me, post a reminder in about two weeks.

I have always wondered why the Rhino align and distribute options are not similar to Adobe Illustrator’s. They nailed it. Rhino is clunky in this regard.