For those interested, I created a work around with Python, which is shown below. It seems to be a more robust approach than my previous fiddling with the ce.lib\shp.ceattr file. from scripting import *
# get a CityEngine instance
ce = CE()
# helper function
def update_attr(shape, get_name="", set_name="",check_name=""):
"""helper function: used to get attribute values from the shape and
set them in the layer"""
# get the value from the shape attribute that will be written
value = ce.getAttribute(shape, get_name)
# get the check value from the shape that will be written
check = ce.getAttribute(shape, check_name)
if check == 0:
ce.setAttribute(x , set_name, 0)
else:
ce.setAttribute(x, set_name, value)
ce.setAttributeSource(x, "/ce/street/%s" % set_name, "OBJECT")
# selection
graph_network = ce.getObjectsFrom(ce.selection())
# iteration
for x in graph_network:
# check parameter
check_name = "check_attr"
# run update function for each attribute
update_attr(x, "in_carriageway", "street_width", check_name)
update_attr(x, "outside_carriageway", "sidewalkWidthLeft", check_name)
update_attr(x, "outside_carriageway", "sidewalkWidthRight", check_name)
update_attr(x, "lane_width", "laneWidth", check_name)
if __name__ == '__main__':
pass I'm still wondering why my modified ce.lib\shp.ceattr file wasn't working, though...
... View more