How to run a calculation (API)

How to run a calculation (API)

Anonymous
Not applicable
596 Views
3 Replies
Message 1 of 4

How to run a calculation (API)

Anonymous
Not applicable

Hello !

 

I would like to lauch a calculation without opening the file manually. Is it possible to do it with windows command line or with the API ?

 

Thank you very much,

 

Gregoire.

597 Views
3 Replies
Replies (3)
Message 2 of 4

Romanich
Mentor
Mentor

Hi @Anonymous ,

 

Did you try Calculation Manager?

https://help.autodesk.com/view/RSAPRO/2022/ENU/?contextId=IDD_ROBOT_CALC_MANAGER

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


0 Likes
Message 3 of 4

Anonymous
Not applicable

Yes I tried, but i still need to choose my file and click on "Execute".

I was wondering if it was possible to do something like "robot.exe calculate file.rtd result_path.rtd", or to use API to load a file a do the calculation.

0 Likes
Message 4 of 4

rsousa_
Advocate
Advocate

Hi @Anonymous 

Yes, you can do it easily with ROS API. Please see the tutorial, where you can see this example, that do exactly what you need

'Declare auxiliary constants for the file name in which RTD task is stored and for the name of the new file in which the calculated project will be saved.
 	
Const filepath = "c:\myproject.rtd"
Const newfilepath = "c:\myprojectnew.rtd"
' 	Declare and create the main object representing the Robot program.
 	
Dim robapp As IRobotApplication
Set robapp = New RobotApplication
' 	Open the project.
 	
robapp.Project.Open filepath
' 	Start the calculations.
 	
robapp.Project.CalcEngine.Calculate
' 	Save the project under a new name.
 	
robapp.Project.SaveAs newfilepath
' 	Close the project.
 	
robapp.Project.Close
' 	Free the object representing the Robot application.
 	
Set robapp = Nothing

Regards