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
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Could you check if you can create a panel using the Panel dialog after selecting the same list of surface elements as the one you provided for your API code please? Have you managed to check your API code on v.2012?

Artur Kosakowski
Support Specialist
Product Support
Autodesk, Inc.
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
no i have not been able to check it on the 2012 api, since what i am doing may require older versions of robot. I need to have an unquestionably stable approach. Yes when creating a panel using the interface it works every time.
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello,
I am still not able to solve my previous problem. There seems to be no unconditionally stable and accurate method for creating shells from the api, at least not in the 2011 x86 version. So I have had some time over the last couple of days to go back and try again with the command CreateOnFiniteElems. I use the following code for testing.
RobotApplication robApp;
robApp = new RobotApplication();
robApp.Visible = 1;
robApp.Project.New(IRobotProjectType.I_PT_SHELL);
IRobotNodeServer nod = robApp.Project.Structure.Nodes;
double k = 0;
for (int i = 0; i < 8; i++)
{
nod.Create(1 + i * 10, 0, 0, 0 + k);
nod.Create(2 + i * 10, 0.5, 0, 0 + k);
nod.Create(3 + i * 10, 1, 0, 0 + k);
nod.Create(4 + i * 10, 1.5, 0, 0 + k);
nod.Create(5 + i * 10, 2, 0, 0 + k);
k = k + 0.5;
}
IRobotFiniteElementServer fe_serv = robApp.Project.Structure.FiniteElems;
RobotNumbersArray[] arr = new RobotNumbersArray[4];
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 4; j++)
{
arr[j] = new RobotNumbersArray();
arr[j].SetSize(4);
arr[j].Set(1, 1 + j + 10 * i);
arr[j].Set(2, 2 + j + 10 * i);
arr[j].Set(3, 12 + j + 10 * i);
arr[j].Set(4, 11 + j + 10 * i);
fe_serv.Create(1 + 10 * j + i, arr[j], false);
}
}
fe_serv.Update();
RobotSelection allFE = robApp.Project.Structure.Selections.CreateFull(IRo
RobotNumbersCollection col;
try
{
col = robApp.Project.Structure.Objects.CreateOnFiniteEle
}
catch (System.Runtime.InteropServices.COMException e)
{
MessageBox.Show(e.Message.ToString());
}
The funny thing about this is that i can run it and it will work 10 times in a row and then on the 11th time it will crash. Additionally, every time that it is run I catch the exception "HRESULT E_FAIL has been returned from the com component" regardless of if the program then crashes or not. If i replace "allFE.ToText()" with "allFE.ToString()" the program will not catch an error, but it will also not create a panel, in this case nothing happens....
I am looking for a solution for this problem that will work with all versions of Robot. Are you planning on releasing a service pack or something along those lines to fix this for older versions of Robot, or will all improvements be exclusive to future releases? I have tried creating finite elements using the api and i have tried using a text file, neither of them seem to allow me to create panels, nor do the results from the finite elements appear to be accurate. Any help or advice on getting a stable method working with all versions of Robot would be greatly appreciated. Any Ideas??
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The changes and improvements in the API are done for the current (last released) and next versions of Robot.

Artur Kosakowski
Support Specialist
Product Support
Autodesk, Inc.
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
well i finally have tested with the 2012 version and everything seems to work in that version but that leaves all of the previous version users behind...
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm very pleased that you finally decided to test the current version of Robot. Of course it would be great to update all older versions of Robot with all the changes and improvements done for the new ones but in the real world this is obviously for many reasons not possible.
If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.

Artur Kosakowski
Support Specialist
Product Support
Autodesk, Inc.
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I have created a series of finite element meshes, however want to convert them to a single panel/contour, as I am able to do through the GUI by selecting the surface objects as an FE list. Is this possible to do via the API? I then want to assign material properties to the panel.
I have printed below, what I have got so far, however this only creates single panel elements for individual FE objects. Your help is much appreciated!
Dim FEServer As IRobotFiniteElementServer
Dim MyArr As RobotNumbersArray
FEServer.Create(FENum, MyArr, False)
FEServer.Update
Dim AllFE As RobotSelection
Dim SelType As IRobotObjectType
SelType = IRobotObjectType.I_OT_FINITE_ELEMENT
AllFE = MyRobot.Selections.CreateFull(SelType)
Dim Collection As RobotNumbersCollection
Collection = MyRobot.Objects.CreateOnFiniteElems(AllFE.ToText()
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi
I have created a series of finite element meshes, however want to convert them to a single panel/contour,........
I have printed below, what I have got so far, however this only creates single panel elements for individual FE objects. Your help is much appreciated!
As far as I understood: you wanted you created so where the problem is?

Rafal Gaweda
Product Support
Autodesk, Inc.
Re: CreateOnFi niteElems crashes every time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Example code:
Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
Dim RSelection As RobotSelection Set RSelection = RobApp.Project.Structure.Selections.CreateFull(I_OT_FINITE_ELEMENT) Dim FECol As RobotFiniteElementCollection Dim Collection As RobotNumbersCollection Set FECol = RobApp.Project.Structure.FiniteElems.GetMany(RSele ction) Dim OD As RobotObjObject Dim PT As String Dim RT As String Dim CM As String For i = 1 To FECol.Count Set OD = RobApp.Project.Structure.Objects.Get(FECol.Get(i). ObjectNumber) PT = OD.GetLabelName(I_LT_PANEL_THICKNESS) RT = OD.GetLabelName(I_LT_PANEL_REINFORCEMENT) CM = OD.GetLabelName(I_LT_PANEL_CALC_MODEL) Set Collection = RobApp.Project.Structure.Objects.CreateOnFiniteEle ms(Str(FECol.Get(i).Number), 100000 + i) RobApp.Project.Structure.Objects.Get(Collection.Ge t(1)).SetLabel I_LT_PANEL_THICKNESS, PT RobApp.Project.Structure.Objects.Get(Collection.Ge t(1)).SetLabel I_LT_PANEL_REINFORCEMENT, RT RobApp.Project.Structure.Objects.Get(Collection.Ge t(1)).SetLabel I_LT_PANEL_CALC_MODEL, CM Next i

Rafal Gaweda
Product Support
Autodesk, Inc.


