//TODO: check if it works public IO.Swagger.Model.ProjectRobotJoints GetFirstJoints(string robot_id = null, bool valid_only = false) { foreach (IO.Swagger.Model.ProjectRobotJoints robotJoint in Data.RobotJoints) { if ((robot_id != null && robot_id != robotJoint.RobotId) || (valid_only && !robotJoint.IsValid)) { continue; } return(robotJoint); } if (!string.IsNullOrEmpty(Data.Parent)) { ActionPoint parent = ProjectManager.Instance.GetActionPoint(Data.Parent); return(parent.GetFirstJoints()); } throw new ItemNotFoundException(); }