Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 8
odysseasg
999 Views, 7 Replies

Robot Steel API

Hello,

 

i'm trying to retrieve CodeResults using RobotOM steel API. My code (at the failure lines) goes like this:

 

....

....

IRDimDetailedRes RDmDetRes;
RDmDetRes = (IRDimDetailedRes) RdmAllRes.Get(49); //get a specific bar 


IRDimCodeResEC3 RdmCodeRes;
RdmCodeRes = (IRDimCodeResEC3) RDmDetRes.CodeResults;

 

double MPl = RdmCodeRes.PlastMomStrenMplyrd;

 

When i run my code I get this error message: 


 error: Unable to cast COM object of type 'System.__ComObject' to interface type 'RobotOM.IRDimCodeResEC3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{21F70924-8B6C-470F-A19F-5DC40565936D}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). (line: 186)

 

Am i using the wrong Code interface? Do i have to instansiate the codeparams for the specific code before that?

 

Thanks in advance. 


7 REPLIES 7
Message 2 of 8
Rafal.Gaweda
in reply to: odysseasg

Try to use IRDimCodeResE32 interface



Rafal Gaweda
Message 3 of 8
odysseasg
in reply to: Rafal.Gaweda

Rafal,

 

still that interface does not exist. I've also tried updating the com interface (from autodesks support page/COM hotfix)

but no change...

Message 4 of 8
Rafal.Gaweda
in reply to: odysseasg

Send me the whole code



Rafal Gaweda
Message 5 of 8
odysseasg
in reply to: Rafal.Gaweda

// new object Robot application
RobotApplication robApp;
robApp = new RobotApplicationClass();

robApp.Interactive = 1;

 

if (robApp.Project.IsActive == 0)
{
System.Windows.Forms.MessageBox.Show("ERROR : Open an instance of Robot with the Model you would like to Design");
return;
}

 

// Dim robapp As IRobotStructure
IRobotStructure str;
str = robApp.Project.Structure;


int res = robApp.Project.Structure.Results.Available;

if (res == 0){

RobotCalcEngine CalcEngine; //
CalcEngine = robApp.Project.CalcEngine; // Calculation Engine
CalcEngine.Calculate(); // Run Calculations


}


IRDimServer server = (IRDimServer) robApp.Kernel.GetExtension("RDimServer");
server.Mode = IRDimServerMode.I_DSM_STEEL;

IRDimCalcEngine RDMEngine;
RDMEngine = server.CalculEngine;


IRDimCalcParam RDmCalPar;
IRDimCalcConf RDmCalCnf;

RDmCalPar = RDMEngine.GetCalcParam();
RDmCalCnf = RDMEngine.GetCalcConf();


RDimStream RdmStream; //Data stream for setting parameters
RdmStream = server.Connection.GetStream();
RdmStream.Clear();


//Calculate results for all sections
RdmStream.WriteText("all");
RDmCalPar.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_MEMBERS_VERIF, RdmStream);//members verification

RDmCalPar.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_ULTIMATE, 1);//Set Limit State
RdmStream.Clear();

RdmStream.WriteText("9"); //Set Load Case
RDmCalPar.SetLoadsList(RdmStream);


RDMEngine.SetCalcConf(RDmCalCnf);
RDMEngine.SetCalcParam(RDmCalPar);


RDMEngine.Solve(null); //Solve Calculations for defined members


IRDimAllRes RdmAllRes;
IRDimDetailedRes RdmDetRes;

RdmAllRes = RDMEngine.Results();


IRDimDetailedRes RDmDetRes;
RDmDetRes = (IRDimDetailedRes) RdmAllRes.Get(49);

 

//IRDimCodeResEC3
IRDimCodeResE32 RdmCodeRes;
RdmCodeRes = (IRDimCodeResE32) RDmDetRes.CodeResults;


double Mply = RdmCodeRes.PlastMomStrenMplyrd;

 

 

 

Message 6 of 8
Rafal.Gaweda
in reply to: odysseasg

What is the code set in Job Prefereces?

It should be ENV 1993-1-2005/AC:2009

 

One more hint: check whether the results for selected bar exist (not null)



Rafal Gaweda
Message 7 of 8
odysseasg
in reply to: Rafal.Gaweda

Rafal,

 

i'm using that code and that i'm calculating design resluts for all the bars. Could you please send me the list of parent interfaces used in the API for Eurocode design codes? Or does IRDimEurocodeE32 superseeds all the previous eurocode interfaces?

Message 8 of 8
Rafal.Gaweda
in reply to: odysseasg

IRDimCodeResEC3 - old eurocode

IRDimCodeResEC32 - new one and all NADs. You should be able to get results for all NADs but setting some country specific data for calculations may not be possible.

 

There are also interfaces for PN, ASD, CM66 codes in Robot.



Rafal Gaweda

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report