Hi,
How can I find all objects that are lands generated?
I am making some tools where the lands objects (like row etc) is messing up.
–
In another script I use rs.ObjectDescription(obj) to see if it is tagged as “Terrain”,
but I don’t want to check for all possible names as this might change in the future.
import rhinoscriptsyntax as rs
import scriptcontext as sc
import rhinoscriptsyntax as rs
import Rhino
objects = rs.GetObjects("Select objects", preselect=True)
if objects:
for object in objects:
obj = sc.doc.Objects.Find(object)
print obj.Id
p = obj.GetRenderMeshParameters()
obrefs = Rhino.DocObjects.RhinoObject.GetRenderMeshes([obj], True, True)
print rs.ObjectDescription(obj)
### If object is terrain use only the first object in the list which is the top surface
if rs.ObjectDescription(obj)=="terrain":
mesh = obrefs[0].Mesh()
if mesh:
tempMesh = sc.doc.Objects.AddMesh( mesh)
1 post - 1 participant