Unfinished Python methods

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.

Thanks,

Dan

1 Like

All three of these reasons are probably valid, But the second one (not enough time) is probably the most legitimate.

When you find stuff, let us know and we’ll get them on the list.

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!

Dan

I’ve added this to the pile…

Hi @dale

ObjectNames is another one that I could use.

Thanks,

Dan

Hi Dan,

This one can be worked around rather easily until it gets implemented:

import scriptcontext as sc
import rhinoscriptsyntax as rs

def FindObjectName(objID):
    objref=sc.doc.Objects.Find(objID)
    return objref.Attributes.Name    
    
id=rs.GetObject()
print FindObjectName(id)

(returns None if object does not have a name)

–Mitch

Great, thanks!

Dan

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.

–Mitch

Hi Mitch,

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.

Dan

I found another that I could use:

ObjectTopGroup.

Of course if there is a work around, I’m all ears!! :smile:

Dan

@stevebaer could you please add rs.TextOut() for analogy with vb RhinoScript eg. something like:

import Rhino

def rs_TextOut(strText="", strTitle="Title"):
    Rhino.UI.Dialogs.ShowTextDialog(strText, strTitle)
    return None

if __name__=="__main__":
    rs_TextOut("Hello Rhino")

thanks,
c.

Dear @stevebaer could you please add rs.ObjectDump ?

thanks,
c.

Sure, I’ve added these to the wishlist
http://mcneel.myjetbrains.com/youtrack/issue/RH-26823

Hi @stevebaer

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.

Thanks, and happy New Year!

Dan

1 Like