Skip to content

How to specify the child attributes #620

Answered by Hugovdberg
bujos asked this question in Q&A
Discussion options

You must be logged in to vote

The attribute object has an attribute called children which you can use to access child attributes:

for frame in eventframes:
    print(f"------------------\nFrame name: {frame.Name}\n------------------")
    for attribute in frame.Attributes:
        elem = db.descendant(r'\\PRDPAF01R\Alouette\Secteurs\Electrolyse\MSE\MSE-01')
        attr = elem.attributes['Jaugeage'] 
        values = attr.recorded_values(frame.StartTime, frame.EndTime, "interpolate").drop_duplicates()
        distance = attr.children['Distance'] # <- like this
        distance_values = distance.recorded_values(frame.StartTime, frame.EndTime, "interpolate").drop_duplicates()
        print(values)
    print()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bujos
Comment options

Answer selected by bujos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants