Blocks set automatically to points (Stadium seats) Solved

Hello I need your help.
Is there a possibility to set a block reference to selected points automatically.

I’ve divided my lines into points with Grasshopper.
Now I have about 15000 points and would not like to copy the blocks manually to every single point. The points may change again.

Can you do it automatically, with Rhino or Grasshopper … or is there an alternative

Hope someone can help,

Andy

no idea if this works but it looks maybe like what you need.
its from @dale

it seems you dont need grasshopper for this part.

As far as I know, you cannot use blocks in Grasshopper.

Pretty much similar to the script linked above, I generally use for this purpose this Python snippet:

import rhinoscriptsyntax as rs

pts = rs.GetObjects("Select points ...", filter=1)
blockName = rs.GetString("Name of block to copy ...")

if pts:
    for pt in pts:
        if rs.IsBlock(blockName):
            rs.InsertBlock(blockName, pt, [1,1,1], 0)
        else:
            print "No valid block name entered."
else:
    print "No points selected."

(“Tools > Python script > Edit” to run a script)

3 Likes

Thx man it works, don’t know Python or Rhino Script but Dr. Google helped me and the script works.

Fantastic, you saved me a lot of time, thx. 1000 points for karma

i don’t know Rhinoscript, but i tryed the Python Script with google.
But thx for your help.

This is such a useful script, I’m trying to use it in grasshoppers Python Script Editor, but i’m not too sure as to how to call the Variables (points and block) into the x & y of the component. Any help ?

Hello,

You can rename the entries x and y or add to the script:

pts = x
blockName = y

If you’re using Grasshopper, I’d suggest you use the new Elefront insertBlock feature which does exactly that now. See reference here.

Can you improve it to pop up a window for selecting the desired block, instead of having to copy paste its name?

The Script doesn’t work for me as it should. The Block gets copied to the right Points but it is also scaled up quite a bit. Any ideas why?


The small black dot on the right is the original Block, the scaled-up copies on the left.
I’m using Rhino 7 btw.

Late answer but it might help somebody in the future. Make sure that the defined block is at the scale you wish it is possible that you scaled the block instance. Place a fresh one to check.