Helle ia m tryng to return the object name of an object
i have tried diferent stuff without succes
i do have the id with this comment
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects(“Pick some object”)
for id in objectIds: print “Object identifier:”, id
What is inside objectIds in rhrino ?
thank you
Willem:
rs.ObjectName ()
no succes
i have tried
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects(“Pick some object”)
for id in objectIds: print “Object identifier:”, id
Name = rs.GetUserText(objectIds)
print “Object Name”, Name
sorry succes
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects(“Pick some object”)
for id in objectIds: print “Object identifier:”, id
Name = rs.ObjectName(objectIds)
print “Object Name”, Name
1 Like
this does work only when i select on object, but when i select two, i just get the first id of the first object
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects(“Pick some object”)
for id in objectIds:
print “Object identifier:”, id
Name = rs.ObjectName(objectIds)
print “Object Name”, Name
AlW
November 16, 2014, 3:20pm
6
I’m not familiar with Python syntax, but isn’t there some kind of statement that will loop through all the members of objectlds?
Something like:
for each id in objectlds
print…
etc…
loop
Willem
(Willem Derks)
November 16, 2014, 10:00pm
7
Hi Phmadeira
Try this:
(pseudo code)
for singleID in objectIDs:
name = rs.ObjectName(singleID)
print "name for object is ", name
So what you do is itterate over the individual ID’s in the list.
For each item (single objectID) you get the object name.
An object ID is the reference to the object in the Rhino document.
HTH
-Willlem