Set built in attributes within rule file

03-26-2012 10:04 PM
New Contributor II
Hi, I am having a mind blank today - Is it possible to access and change a built in attribute via the set() function? Considering street networks; I am wanting to set the builtin streetWidth attribute based on the number of lanes and lane width given in the rule file, for an ideal outcome see:

set(streetWidth, (nLanes * laneWidth)

0 Kudos
1 Reply
Frequent Contributor II
hey !

the attr streetWidth is not inherited to the shapes as opposed to e.g. the connectionEnd Object Attributes. (the graph segments inherit some attributes down to their shapes).

if you select a street shape and have a look at it's Object Attributes, you see that they're inherited since they're written in italic (inherited = updates of the graph segment widths will be reflected in the shapes's OA). If you create a new Object Attr on this shape via RMB in the OA tab, you see that the new OA is written normal (not italic).

I know, it's tricky. 🙂

* * *

since there's no attr called streetWidth on Street Shapes, you can of course create one manually, but the trick is to map '' to this new attr since it represents the actual width of the shape. The initial scope orientation of Street Shapes is always that is 'along' the street and is it's width.

Example :

attr myStreetShapeWidth = 0 # initialize the new attr

Street -->

PrinterRule -->
    print (myStreetShapeWidth)

ok ?
0 Kudos