Inserting geometry at a point

I’m trying to insert a particular geometry at a number of points that are scattered around an area. I’ve gotten my point locations by using the intersect command so I don’t believe I can make them blocks from the start and then edit them. Is there a way to insert geometry, preferably a block, at the point location? For a little more detail please refer to the image I’ve attached. I’m trying to place the red dome cap at each point. Not all points are visible in the image but hopefully this helps in understanding what I’m trying to do.

Hi Chris - presumably you want the obiect oriented to the line even if the lines are not parallel - can’t tell from the image…

This is almost certainly scriptable, copying objects to points is one of the get-you-started tasks in learning scripting in Rhino. Orienting, if that matters, complicates things somewhat however…

-Pascal

Thank you Pascal. Yes. The lines are parallel. The red object wouldn’t need to change orientation at all. Is there a script that currently exists or do you know of a scripting tutorial that would cover this?

Hi Chris - more info here:

Here is a simple example in python - it copies the selected objects to all point objects that are available

import rhinoscriptsyntax as rs


def CopyObjectsToPoints():
    pts = rs.ObjectsByType(1, state=1)
    if not pts:
        print("No target point objects found.")
        return
        
    ids = rs.GetObjects("Select objects to copy.", preselect=True)
    if not ids:
        return
    pts = [rs.coerce3dpoint(pt) for pt in pts]
    basePt = rs.GetPoint("Set the point to copy from.")
    if not basePt:
        return
    
    rs.EnableRedraw(False)
    for pt in pts:
        vecDir = pt-basePt
        rs.CopyObjects(ids,vecDir)
    rs.EnableRedraw(True)
        
if __name__ == '__main__':
    CopyObjectsToPoints()

CopyObjectsToPoints2.py (646 Bytes)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Thank you very much Pascal. This works perfectly!