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: 

Robot API - open and close project issues

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
guillaumeniel
1052 Views, 6 Replies

Robot API - open and close project issues

Hi,

First question : I want to close a Robot project without saving using API code 'Robot.Project.Close', and without closing RSA application.

But nothing happens. I would like to go back to the starting window (the grey one with 'Projects' And 'New Project' Option). But the project is still opened and still appears in the Robot window. How can I do that ? Is there a kind of 'refresh' script to add ?

 

 

Second question : I open RSA through API using 

 

Dim Robot As New RobotApplication
Robot.Visible = True
Robot.Window.Activate

 

I would like the RSA window to come to the front, above the window form which the API script is launched (Rhino&Grasshopper in my case - it could be Excel). It is not the case with my script, RSA just appears in the task bar, but does not become visible. How can I do that ?

 

 

Thanks

 

Guillaume

 

6 REPLIES 6
Message 2 of 7


First question : I want to close a Robot project without saving using API code 'Robot.Project.Close', and without closing RSA application.

But nothing happens. I would like to go back to the starting window (the grey one with 'Projects' And 'New Project' Option). But the project is still opened and still appears in the Robot window. How can I do that ? Is there a kind of 'refresh' script to add ?

 

IN fact robot can not open moer than 1 project so Close option does not work as you think.

Close just sets Modified flag onto false and then while loading (openining new file) program will not ask you whether to save changes in previous file. So Close project then open file.



Rafal Gaweda
Message 3 of 7

 

Second question : I open RSA through API using 

 

Dim Robot As New RobotApplication
Robot.Visible = True
Robot.Window.Activate

 

I would like the RSA window to come to the front, above the window form which the API script is launched (Rhino&Grasshopper in my case - it could be Excel). It is not the case with my script, RSA just appears in the task bar, but does not become visible. How can I do that ?

 

 

After Robot.Visible = True it should be visible.
If you want it in foreground you have to use windows system functions, most likely using RobotApplication.Window.Handle

 



Rafal Gaweda
Message 4 of 7

OK, 

Thanks.

Message 5 of 7
aruser
in reply to: guillaumeniel

Hi,
I would like to close the Project at the end of the sub after saving the changes.

"robot.project.close" seems nothing happens.

How can I close the Project or the application?
Thks
Message 6 of 7
Artur.Kosakowski
in reply to: aruser

Try robot.Quit(IRobotQuitOption.I_QO_SAVE_CHANGES)

 

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
Message 7 of 7
d.robin
in reply to: Artur.Kosakowski

hi,

 

is it possible to use the Close Menu with API to only close the file and not close robot ?

cause reopening Robot spend too much time

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

Post to forums  

Autodesk Design & Make Report