The Python script below gives me the point names of 3d points in my workspace. However not all have names and by default are named " None" so I want to change these names to “No Name” either by default or in the script. All suggestions welcome as new to Python and just getting into it slowly.
Roger
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects(“Pick measured points”, rs.filter.point)
for id in objectIds:
objectname = rs.ObjectName(id)
objectcoord = rs.PointCoordinates(id)
print objectname,",",objectcoord
import rhinoscriptsyntax as rs
objectIds = rs.GetObjects("Pick measured points", rs.filter.point)
for id in objectIds:
objectname = rs.ObjectName(id)
if not objectname: rs.ObjectName(id,"No name")
Just after I posted I read about None, I had thought it was text not a variable so I used the line below with None not in inverted commas and it worked, thank you for your reply it is good to see as many options as possible. My line will only name it in print but your will name the actual point in Rhino so probably the best solution.