01-23-2025, 11:03 PM
How can I add comments to a program's event via API? When I set the event Path Approach through the API it would always default to 'program call'. When I set the event through RoboDK itself I have the option to choose what instruction it should be. I want to do that through the API.
When I extract the ProgEvents with SetParam I can see the event's value starts with 3 and then the comment. I tried setting the events with the same values that I extracted. but in RoboDK it treats it like a 'program call' with a 3 at the start.
When I extract the ProgEvents with SetParam I can see the event's value starts with 3 and then the comment. I tried setting the events with the same values that I extracted. but in RoboDK it treats it like a 'program call' with a 3 at the start.
Code:
var progEvents = JsonConvert.DeserializeObject<JObject>(projectSettings.SetParam("ProgEvents"));
progEvents["CallRetract"] = "3approach started";
projectSettings.SetParam("ProgEvents", JsonConvert.SerializeObject(progEvents));