I'm having some trouble with ce.getVertices(), now with even more pictures

08-01-2016 08:59 AM
Regular Contributor

I'm trying to read the vertices of some shapes I created in ArcMap (imported from GDB) and in CE. On some shapes, the reading fails consistently, returning "None". On some, it works sometimes. This changes usually after a CE restart. What could be the reason?

These are the shapes; blue = imported, yellow = drawn in CE:

Shapes that consistently don't work:


- pacman

- rightmost C shape


- northern yellow building footprint (traced from blue + moved)

- two rightmost C shapes (both freehand)

Works always so far:


- northern building footprint

- leftmost round and rectangular shapes


- pacman (traced from blue + moved)

The others can be read sometimes, sometimes not.

Furthermore, sometimes, usually when the shape is hand-drawn or imported, I'm getting a pretty weird (but at least consistent) reading order for the vertices. The first vertex (actually the second, since 0 is the first) is listed first in the array, then comes the 0th, then the leftover vertices are listed bottom up / counterclock-wise (last vertex = 3rd position). What's up with that?


Attached you'll find a sample project (v. 2016) containing the shapes and script/rules I wrote.



I made some progress, the permanently and sometimes "None" shapes can be read this way:

  1. select shape with model
  2. delete models, turning the display off doesn't work (sometimes this is enough --> run script, otherwise keep going)
  3. deselect, select again
  4. run script

Now this is curious: when you generate the models afterwards and select the shape with the model on it again, the script works with models on as well.

As for the vertex part, when you write exactly the same vertices back you read, the vertices are numbered as expected ( 1 = 0), but the face is flipped. When you read and write the vertices back another time, they return to the original configuration.




However, this problem never occurs with programmatically created shapes, as they already have the expected vertex numbering:



0 Kudos
0 Replies