Hi, I noticed that when I'm calling getAttribute() in my python script to retrieve object attributes for graph objects, it only returns them for segments and nodes, but not for the shapes. For shapes it returns None.
Since the shape is generated out of the segments and nodes, it has the same object attributes, as visible in the inspector.
Is that intended behaviour? Is there no way to get object attributes for graph shapes?
Hi,
the inspector behaves differently than Python.
If you select a street shape, also its "parent" graph segment (or node) is selected and the Inspector shows the combined set of attributes from nodes, segments and shapes (scene objects).
Python's getAttribute (or getAttributeList) is closer to the underlying data structure and returns only the actually owned attributes of a scene object.
I hope this helps & best,
Simon
In addition to what Simon said:
# select a graph shape
print ce.getAttributeList(ce.selection()[0])
# OID of the segment/node is the same as the shape
# minus the last two chars, those are used to number the shapes
segmentOID = ce.getOID(ce.selection()[0])[0:-2]
print segmentOID
print ce.getAttributeList(ce.findByOID(segmentOID))
Cheers
Jonas