Autodesk Robot Structural Analysis
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm trying to script some linear releases using the Robot API in C#, but can't seem to get my head around it. Can you please post an example defining a linear release?
What I'm trying to achieve is releasing all edges shared by two panels, but only on one of the panels to avoid getting to many DOFs.
Hope you are able to help me out,
Andreas
Solved! Go to Solution.
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.LinearR
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(li
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);
}
}
}
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
try to add
robotObjObject .Update
robotObjObject .Initialize
to the end of if

Rafal Gaweda
Product Support
Autodesk, Inc.
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Rafal,
Thanks for the reply... Unfortunatly it still doesn't work. The label is is created without any problems, nevertheless I tryed changing the label to a Robot native one:
objEdge.SetLabel(IRobotLabelType.I_LT_LINEAR_RELEASE, "pinned");
And I know for sure that the line of code is running, but it still doesn't work. Is this not the right way of applying a linerar release label to an edge?
Thanks again,
Andreas
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I need develeopers to check why SETLABEL and HASLABEL do not work for linear releases.

Rafal Gaweda
Product Support
Autodesk, Inc.
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Rafal,
Have you got any clarification on this?
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I have not checked yet but operation by labels (set , has) as you did works only for supports for objects.
For linear releases you should use:
robotApplication.Project.Structure.Objects.LinearR

Rafal Gaweda
Product Support
Autodesk, Inc.
Re: Linear Releases with API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
private void button1_Click(object sender, EventArgs e)
{
RobotApplication robotApplication = new RobotApplication();
IRobotLabel linearReleaseLabel = robotApplication.Project.Structure.Labels.Create(I RobotLabelType.I_LT_LINEAR_RELEASE, "apirel");
RobotLinearReleaseData linearReleaseData = (RobotLinearReleaseData)linearReleaseLabel.Data;
linearReleaseData.HX = 0;
linearReleaseData.KX =0;
linearReleaseData.KY =0;
linearReleaseData.KZ =0;
linearReleaseData.RX = IRobotLinearReleaseDefinitionType.I_LRDT_RELEASED ;
linearReleaseData.UX = IRobotLinearReleaseDefinitionType.I_LRDT_NONE;
linearReleaseData.UY = IRobotLinearReleaseDefinitionType.I_LRDT_NONE;
linearReleaseData.UZ = IRobotLinearReleaseDefinitionType.I_LRDT_NONE;
robotApplication.Project.Structure.Labels.Store(li nearReleaseLabel);
RobotObjObjectServer robotObjObjectServer = robotApplication.Project.Structure.Objects;
IRobotObjObject robotObjObject = (RobotObjObject)robotObjObjectServer.Get(1);
int Numberofedges = robotObjObject.Main.Edges.Count;
for (int i = 1; i <= Numberofedges; i++)
{
if (robotObjObjectServer.LinearReleases.FindEdge(robo tObjObject.Number,i) == 0)
{
robotObjObjectServer.LinearReleases.Set(robotObjOb ject.Number,i, robotObjObject.Number,1,"apirel");
}
}
robotObjObject.Update();
this.Close();
}

Rafal Gaweda
Product Support
Autodesk, Inc.
