def get_object_name(name_or_handle: Union[str, int]) -> str: """Gets object name. :return: Object name. """ if isinstance(name_or_handle, int): name = sim.simGetObjectName(name_or_handle) else: name = name_or_handle return name
def copy(self) -> 'RobotComponent': """Copy and pastes the arm in the scene. The arm is copied together with all its associated calculation objects and associated scripts. :return: The new pasted arm. """ # Copy whole model handle = sim.simCopyPasteObjects([self._handle], 1)[0] name = sim.simGetObjectName(handle) # Find the number of this arm num = name[name.rfind('#') + 1:] if len(num) > 0: num = int(num) + 1 else: num = 0 return self.__class__(num)
def get_name(self) -> str: """Gets the objects name in the scene. :return: The objects name. """ return sim.simGetObjectName(self._handle)
def still_exists(self) -> bool: """Gets whether this object is still in the scene or not. :return: Whether the object exists or not. """ return sim.simGetObjectName(self._handle) != ''