MissingMemberException with python

Got a very simple script, want to import an image to the rhino canvas with python.

import rhinoscriptsyntax as rs

xy_plane = rs.WorldXYPlane()
rs.AddPictureFrame(xy_plane, filename)

but am getting the following error.
Runtime error (MissingMemberException): ‘CustomTable’ object has no attribute ‘AddPictureFrame’

Possibly relevant information: Just switched to rhino 6, and rhino 5 is still installed on the system.

Not all rhinoscriptsyntax functions work in Grasshopper. In this case you can use RhinoCommon to add the image to the Rhino doc.

import Rhino
doc = Rhino.RhinoDoc.ActiveDoc
rc = doc.Objects.AddPictureFrame(plane, filename, False, 0.0, 0.0, False, False)
1 Like

Hey Alain

Thanks for getting back to me.

If that’s the case, it would be great to have that information in the documentation on which functions do and do not work.

1 Like

That’s a good idea.

Logged: https://mcneel.myjetbrains.com/youtrack/issue/RH-48846

Thanks for the suggestion.

Has this document been made now?

Hi -
No, item RH-48846 is still open.