algorithmic modeling for Rhino
I do have a point cloud and want to get the Object Name as well as the Point3d coordinates.
I'm new to using Python in Grasshopper. I do have two lists as input. An ID's list and a Point3d list. Could someone tell me how to get the object name?
Also, if I have the Point3d, how to get the Guid of this point?
Thanks.
Tags:
Ok, now I found a way to get the names from the ID's list. Like this:
import Grasshopper as gh
import os
import Rhino
import scriptcontext
import rhinoscriptsyntax as rsfor i in range(len(ids)):
rhinoObj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(ids[i])
if 'Point' in str(rhinoObj):
print(rhinoObj.Geometry.)
print('name %s, coordinates'%(rhinoObj.Name))
How to extract now the coordinates? Could someone give me an example how to get the name and the coordinates directly from the points list?
Also, if I have the Point3d, how to get the Guid of this point?
This is not possible. The coordinate does not contain sufficient information to reverse engineer what object it originally came from, unless of course you're willing to iterate over all objects in the Rhino document to see which one if a point at the same location. And then hope you won't find more than one.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by