Is there a list of Python methods that are not yet implemented? I was a bit surprised to see the GetDistance method not implemented. That seems like a pretty basic one. MultiListBox too (that one has been mentioned before).
Are the majority of the non-implemented methods in that state because there are other ways to accomplish that task? Or is just a matter of not having enough time to get to them (which is totally understandable -I never seem to have enough time either!) Or is it a case of there being no demand for them?
If there is no list, I will go through the help file myself and make one, but I thought I would ask before I did that.
No, problem. I will keep at it. Let’s start with this:
MultiListBox
GetDistance
CompareGeometry
Those are the three that have held me up from converting my Rhinoscripts to Python scripts. The IsCircle, IsArc etc. were holding me up, but the functions you provided for me got me past that roadblock. Thanks for that!
Actually, I didn’t read your post correctly - you wanted NAMES and not NAME… rs.ObjectName() is already implemented, so my function above is not necessary - and indeed does not do all of what ObjectName() does, which is to also allow you to set the name of an object…
So, ObjNames should probably look like this instead:
import scriptcontext as sc
import rhinoscriptsyntax as rs
def FindObjectNames(objIDs):
objrefs=[sc.doc.Objects.Find(objID) for objID in objIDs]
return [objref.Attributes.Name for objref in objrefs]
ids=rs.GetObjects()
print FindObjectNames(ids)
If the object does not have a name, then the corresponding index in the returned list will be an empty string.
Thanks for this one too. I ended up going in a slightly different direction with my script, so the ObjectName (singular) method did the job. I still would like to see the pluralized version hooked up in the future. I will save your function just in case that never happens.
Can we get the ObjectData methods hooked up for Python too? GetObjectData, SetObjectData, DeleteObjectData and IsObjectData.
I could also use the rendermesh methods too, but that’s lower priority for me. I’d rather get MultiListBox and GetDistance first.
Also, I notice that the ListBox windows don’t “remember” where they were opened like they do in Rhinoscript. I’ve had a few people ask me why the little box keeps jumping back up to the left corner. I’ve mentioned it before, but it’s worth bringing up again.