MRoth Posted December 5, 2021 Share Posted December 5, 2021 Hi all I would like to create a code that is executed when an object is selected. Optimally it would be any object, determined by its name, but if it's easier it could be a PIO. Is this possible (only in Python) and if so are there any examples? Thanks in advance for the answers. Manuel Quote Link to comment
JBenghiat Posted December 6, 2021 Share Posted December 6, 2021 Python is a runtime language, so you’re not able to have any sort of listeners that can respond to various events. An event enabled plug-in object is going to raise the WidgetPrep event when it’s selected, though it will also raise that event any time you change a parameter. You can develop an SDK module (using c++) that responds to selection changes. Quote Link to comment
MRoth Posted December 6, 2021 Author Share Posted December 6, 2021 Too bad, I don't know C++. Is there any way to make the listener work in C++ but call a Python script in it? And how complex is the whole thing with the SDK? Quote Link to comment
JBenghiat Posted December 6, 2021 Share Posted December 6, 2021 The process is not particularly easy, especially if you're not already familiar with compiling applications with Xcode or Visual Studio. It's probably not worth while if the automation is for a single user. You can, in theory, call a python script from an SDK plug-in, though once you have it figured out coding directly with the SDK had a lot of advantages. Would you mind sharing more about what exactly you would like to automate? That could help us direct you to another possible solution. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.