Run python script from RDK C++ API可打印版本 +- RoboDK Forum (//m.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//m.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//m.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Run python script from RDK C++ API (/Thread-Run-python-script-from-RDK-C-API) |
Run python script from RDK C++ API-backspace-09-05-2021 Hello , I need to execute python script embedded in RDK project but from application uses RDK C++ API. Is it possible do this somehow? RE: Run python script from RDK C++ API-Vineet-09-07-2021 Using ITEM_TYPE_PROGRAM_PYTHON, you can retrieve the Python Script and run it.
Code:
ITEM_TYPE_STATION=1 # station item (.rdk files)
RE: Run python script from RDK C++ API-backspace-09-08-2021 I tried this by doing like below ( this is just for testing purposes snippet ) :
Code:
if (robodk_instance_->Connected())
where 'InitParam' is a pythin script. When I run this script from RoboDK perspective it works. Script is going to show window used for providing parameters for "worker" script. So executing this via RDK API i would expect to see the same behavior but unfortunately i don't see anything except some strange effect like I would run 'worker' script - maybe its side effect of ...->RunProgram() ... To be honest i'm not sure if RunProgram() can execute selected python script or its just dedicated for running generated programs. So my question is if just taking/selecting item via .Item(... ) can should run python script or there is additional call required ( like RunProgram or something else ) ? |