Add a new child element to this element. Args: element_name: The tag of the element to add. **kwargs: Attributes of the new element being created. Raises: ValueError: If the 'element_name' is not a valid child, or if an invalid attribute is specified in `kwargs`.
(self, element_name, **kwargs)
| 614 | .format(element_name, self._spec.name)) |
| 615 | |
| 616 | def add(self, element_name, **kwargs): |
| 617 | """Add a new child element to this element. |
| 618 | |
| 619 | Args: |
| 620 | element_name: The tag of the element to add. |
| 621 | **kwargs: Attributes of the new element being created. |
| 622 | |
| 623 | Raises: |
| 624 | ValueError: If the 'element_name' is not a valid child, or if an invalid |
| 625 | attribute is specified in `kwargs`. |
| 626 | |
| 627 | Returns: |
| 628 | An `mjcf.Element` corresponding to the newly created child element. |
| 629 | """ |
| 630 | return self.insert(element_name, position=None, **kwargs) |
| 631 | |
| 632 | def insert(self, element_name, position, **kwargs): |
| 633 | """Add a new child element to this element. |