I mean that you can use the Python API to find the robot controller behavior from the UR3/5/10 component and read the speed and acceleration values assigned there, then e.g. print them out for you to see.
The getComponent() method is in vcScript, which is the type for a Python Script behavior. The method is imported along with all other methods in vcScript using “from vcScript import *”. That is component scripting.
If you are writing a script for add-on, that is application scripting. So the importing of modules is a very wild wild west. In the command file, you have access to the vcCommand methods. From there, you can get the application object and then find a component, app = getApplication() app.findComponent(<name>)
Tip! The vcHelpers modules can be imported in both component and application scripts.
TestModule can be placed in the My Commands folder in your Visual Components documents. That is, it does not need to be in C drive nor program files.
I would assume the TestModule is your add-on/command file. In that file, you can import vcCommand, and then use getApplication() to get the application object. From there, you can use the application object with the findCommand() method.
In the Python API, there is a topic about creating an add-on with sample code. Also, I very rarely ever have to define a class in a script.
But we are getting way off topic. What are yawl trying to do: modify the post-processor and/or read the speed and acceleration of UR robot joints? You do not need an add-on to read the values.
Sorry I was totally off the topic. Just saw you guys were talking about modules on here.
What i m trying to do is… I m trying to create a library that i can reach from every python code i create in any component. So if i create a class reachable from python codes in component. That would be enough for me.
I created several add-ons before somehow couldnt figure out how to do this one.
If I wanted to read the speed and acceleration of my ABB robot then, how should I do it?
Also, can I plot the speed and acceleration and show them in the statistics display? (Same way as the joint values can be shown)
As someone commented in your other post, you could use that deprecated component as example. If you want to do scripting, get the Dof object for each joint, sample the value and run the equations to get values you need, and then assign those values to component properties, e.g. Real type. Next, create a chart that plots value, e.g. speed of each axis.