Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find all sites of a default class #482

Open
edwardjjj opened this issue Jul 3, 2024 · 0 comments
Open

Find all sites of a default class #482

edwardjjj opened this issue Jul 3, 2024 · 0 comments

Comments

@edwardjjj
Copy link

Hi,
I'm trying to filter sites based on class names. According to documentation, The following code will return the class name
mjcf_model.find_all('site')[0].dclass
But instead, it returned an MJCF Element,
mjcf_model.find_all('site')[0].dclass.dclass will return the actual class name.
This makes filtering sites based on class names very ugly because sites with no default class names will return None, then doing
mjcf_model.find('site','mysite').dclass.dclass will result in errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant