Forum Migration Notice
Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
SmartComponent - Identify embedded SmartComponent
Henry123
✭
Hi there,
I am using a SmartComponent "A" including an embedded SmartComponent "B" from ABB Library.
I want to change the property binding between "A" and "B". To do that, I need to identify the embedded SmartComponent "B".
Unfortunately, the following code does not work since "targetObjectName" seems to be wrong defined. Can anyone give me a push into the right direction?
I am using a SmartComponent "A" including an embedded SmartComponent "B" from ABB Library.
I want to change the property binding between "A" and "B". To do that, I need to identify the embedded SmartComponent "B".
Unfortunately, the following code does not work since "targetObjectName" seems to be wrong defined. Can anyone give me a push into the right direction?
if (changedSignal.Name == "Active" && changedSignal.Value.ToString() == "0")
{
string sourceObjectName = component.Name;
string targetObjectName = "GraphicSwitch";
Station station = (Station)component.ContainingProject;
ProjectObject sourceObject = null;
sourceObject = station.FindObjects(obj => obj.Name == sourceObjectName, obj => true)?.FirstOrDefault();
ProjectObject targetObject = null;
targetObject = station.FindObjects(obj => obj.Name == targetObjectName, obj => true)?.FirstOrDefault();
PropertyBinding propBindHigh = new PropertyBinding(sourceObject, "PartHigh", targetObject, "PartHigh");
PropertyBinding propBindLow = new PropertyBinding(sourceObject, "PartLow", targetObject, "PartLow");
station.Bindings.Remove(propBindHigh);
station.Bindings.Remove(propBindLow);
}
0
Categories
- All Categories
- 5.7K RobotStudio
- 402 UpFeed
- 21 Tutorials
- 16 RobotApps
- 307 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 368 IRC5
- 92 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 859 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings