# Cannot draw vertices MeshArtist - compas\_ghpython

**URL:** <https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299>\
**Category:** compas\
**Created:** [February 20, 2020, 12:31pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299 "2020-02-20T12:31:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 20, 2020, 12:31pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/1 "2020-02-20T12:31:05Z")

</div>

Hi!  
I have COMPAS=0.11.4  
Having an error with draw\_vertices():

> Runtime error (MissingMemberException): ‘dict’ object has no attribute ‘data’
> 
> Traceback:  
> 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\drawing.py”  
> 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\vertexartist.py”  
> 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!  
Selen

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 20, 2020, 1:36pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/2 "2020-02-20T13:36:26Z")

</div>

can you post some sample code?

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 20, 2020, 2:23pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/3 "2020-02-20T14:23:28Z")

</div>

```
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:
                corners.append(key)
       
mesh = artist.draw_mesh()
data_points = artist.draw_vertices(corners)
data_edges = artist.draw_edges()
data_faces = artist.draw_faces()
```

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 20, 2020, 2:51pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/4 "2020-02-20T14:51:45Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/479891908888bcff2e2808ec4f3c9dcb66a18fd2.png)

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 20, 2020, 3:33pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/5 "2020-02-20T15:33:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 20, 2020, 5:56pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/6 "2020-02-20T17:56:37Z")

</div>

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

```python
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")
artist.clear_layer()
artist.draw_vertices(keys=corners)
artist.draw_edges()
artist.draw_faces()
artist.redraw()

```

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 21, 2020, 12:08pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/7 "2020-02-21T12:08:08Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 22, 2020, 9:23am UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/8 "2020-02-22T09:23:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 25, 2020, 9:48am UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/9 "2020-02-25T09:48:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 25, 2020, 10:14am UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/10 "2020-02-25T10:14:18Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![sercan](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sercan](https://forum.compas-framework.org/u/sercan)\
**Post date:** [February 25, 2020, 2:48pm UTC](https://forum.compas-framework.org/t/cannot-draw-vertices-meshartist-compas-ghpython/299/11 "2020-02-25T14:48:56Z")

</div>

Ok will do that for now!
