Ejemplo n.º 1
0
def min_element(gc):
    # Get sorted Elements
    input = gc.execute_operations([
        g.GetAllElements(
            view=g.View(
                edges=[
                    g.ElementDefinition(
                        group='RoadUse',
                        group_by=[]
                    )
                ]
            )
        ),
        g.Min(
            comparators=[
                g.ElementPropertyComparator(
                    groups=['RoadUse'],
                    property='count'
                )
            ]
        )
    ])
    print('Min element')
    print(input)
    print()
Ejemplo n.º 2
0
def sort_elements(gc):
    # Get sorted Elements
    input = gc.execute_operations([
        g.GetAllElements(
            view=g.View(
                edges=[
                    g.ElementDefinition(
                        group='RoadUse',
                        group_by=[]
                    )
                ]
            )
        ),
        g.Sort(
            comparators=[
                g.ElementPropertyComparator(
                    groups=['RoadUse'],
                    property='count'
                )
            ],
            result_limit=5
        )
    ])
    print('Sorted input')
    print(input)
    print()