Hey Guys,
I have access to VC 4.7 and 4.8 Professional.
I was wondering if anybody could help me figure out how to access variables outside of a component in a more standardized way. Currently, for me to grab a variable I typically use the “GetProperty” to access a variable from another component, give it a name, and use it.
There are times, like with a current client, where one or more components are being R&D’d while making the simulation that give us updated timings or data which could drastically effect the simulation, and with many components requiring changes constantly, I’ve tried to get all the references to components in one place. Some of these components have over 50 variables that are changed each time, which are referenced many times in the Process Flow and Python Script (some of which are referenced over 100 times each), however each one of these components also exists more than a dozen times, and there are different versions of each as well.
I’m currently having trouble trying to upload pictures to VC for some reason, but how it generally goes is:
Component has variable name (example: GeneralCycleTime::Push_Cycle_1 = 10 (sec).
Then in the Process Executor in the MoveJoint process we have “GeneralCycleTime::Push_Cycle_1” and we reference this multiple times throughout the component (We have Load_Push_Cycle_1 - 20, Unload_Push_Cycle_1 - 20, General_Cycle_Times, LoaderJoint cycle times, and more, per component)
Finally, in the Python Scripts I can just access the variable.
Of this specific component we have over 2 dozen of them in the simulation, but they only have 3 versions, and we have 3 other custom components with each having dozens of copies, each with a dozen variables to update.
My goal is to somehow have a separate component, we can have it be anything, even a cube, it is just a placeholder with variables attached. Then once created, each component in the simulation refers to this single component with variable names attached.
In this scenario, I could use the GetProperty to try and get all the variables from another component but:
a) I would need to add a GetProperty at every single variable location (these components have multiple Process Executors, about 30 apiece, and each would need a GetProperty for each variable), which on some of these components alone, would be over a thousand references apiece
b) It wouldn’t be as easily scalable, as due to the client needs, although some components are identical, some of them may run at different speeds and timings, so I’d still need to update each “GetProperty” individually at each reference to make multiple variable timings work. It’d be much easier to adapt the current system by updating the already referenced variable location with a pointer to the “placeholder” with variables. The system is explained below:
For example the placeholder would have the variables:
“Type_1::Component_GeneralCycleTime_1 = 10”
And then each of the Type_1 Components all reference this singular component via “GeneralCycleTime::Push_Cycle_1 = PlaceHolder.Component.Type_1::Component_GeneralCycleTime_1”
So that I could update all the variables only once, from a single component, rather than going into Process Flow, and accessing multiple components, multiple times, updating hundreds of variables each time, with just doing it once.
If anybody knows of a way to do this, it would greatly help me on my current and future projects.
Thanks again, and if I’m able to upload photos at a later point in time, I shall.