I think I'm getting closer to an answer myself. The following code runs perfectly, but doesn't seem to produce any releases on the edges. What am I missing?
IRobotLabel linearReleaseLabel = robotApplication.Project.Structure.Labels.Create(IRobotLabelType.I_LT_LINEAR_RELEASE, this.name);
RobotLinearReleaseServerlinearReleaseServer = robotApplication.Project.Structure.Objects.LinearReleases;
RobotLinearReleaseData linearReleaseData = (RobotLinearReleaseData)linearReleaseLabel.Data;
linearReleaseData.HX =
this.HX;
linearReleaseData.KX =
this.KX;
linearReleaseData.KY =
this.KY;
linearReleaseData.KZ =
this.KZ;
linearReleaseData.RX = toRobotLinearReleaseDefinitionType(RX);
linearReleaseData.UX = toRobotLinearReleaseDefinitionType(UX);
linearReleaseData.UY = toRobotLinearReleaseDefinitionType(UY);
linearReleaseData.UZ = toRobotLinearReleaseDefinitionType(UZ);
robotApplication.Project.Structure.Labels.Store(linearReleaseLabel);
RobotObjObjectServerrobotObjObjectServer = robotApplication.Project.Structure.Objects;
for (inti = 0; i < panelIndices.Count; i++) {
IRobotObjObject robotObjObject = (RobotObjObject) robotObjObjectServer.Get(i+1);
RobotObjPartMain robotObjPartMain = (RobotObjPartMain) robotObjObject.Main;
RobotObjEdgeCollection objEdges = (RobotObjEdgeCollection) robotObjPartMain.Edges;
for (intj = 1; j <= objEdges.Count; j++) {
RobotObjEdge objEdge = (RobotObjEdge) objEdges.Get(j);
if (objEdge.HasLabel(IRobotLabelType.I_LT_LINEAR_RELEASE) == 0) {
objEdge.SetLabel(
IRobotLabelType.I_LT_LINEAR_RELEASE, this.name);
}
}
}