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
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."
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 ?
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.