Cannot draw vertices MeshArtist - compas_ghpython

I have COMPAS=0.11.4
Having an error with draw_vertices():

Runtime error (MissingMemberException): ‘dict’ object has no attribute ‘data’

line 77, in draw_points, “C:\Users\sercan\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_ghpython\utilities\”
line 51, in draw_vertices, “C:\Users\sercan\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_ghpython\artists\mixins\”
line 57, in script

But not for draw_edges() or draw_faces() - they seem to work fine.

Any hints how this could be solved?
Thank you!

can you post some sample code?

from compas.datastructures import Mesh
from compas_ghpython.artists import MeshArtist
from rob_tech_on_site_construction.grasshopper import mesh      

data = mesh.mesh_from_guid(pipeline)

artist = MeshArtist(data)   
corners = []
for key in data.vertices():
      if data.vertex_degree(key) == 2:
mesh = artist.draw_mesh()
data_points = artist.draw_vertices(corners)
data_edges = artist.draw_edges()
data_faces = artist.draw_faces()

it looks like the problem is also there with COMPAS=0.13.3

I also tried going back in version history. It does not throw any error in COMPAS=0.10

this code snippet doesn’t make too much sense to me but i don’t know compas_ghpython that well :slight_smile: . i would write something like the following for Rhino. perhaps it helps…

import compas_rhino
from compas.datastructures import Mesh
from compas_rhino.helpers import mesh_from_guid
from compas_rhino.artists import MeshArtist

guid = compas_rhino.select_mesh()
mesh = mesh_from_guid(Mesh, guid)
corners = list(mesh.vertices_where({'vertex_degree': 2}))

artist = MeshArtist(mesh, layer="SomeLayer")

Yes, it seems like compas_rhino draw_vertices() works without problems in all releases. However it does not help much - i cannot seem to track down what changed after the release 0.10 so that the compas_ghpython draw_vertices() started throwing errors…

the reason why i posted the snippet is because it sounds to me that the mesh object passed to the artist is in fact a dict. in the ghpython snippet it is not entiret clear to me how the mesh is created so perhaps something is wring there?

I am not sure, as in that case it would also fail for draw_edges() and draw_faces() ?

ha true, that is a fair point. will try to have a look later this week. but i guess the easiest thing would just be to update the code bases, since it seems the problem then just goes away…

Ok will do that for now!