Set ActiveWobj in VB.net
Klaus
✭✭
in RobotStudio
Thanks to per svenson for greate help with CRobt() in vb.net but how do i set activeWobj to Wobj0 or another in VB.net
Best Regards
Klaus Soenderhegn
www.cadalysator.dk
Klaus Soenderhegn
www.cadalysator.dk
0
Comments
-
Hi Klaus
Here is a simple example where the name of the workobject is "myWobj"
Public Sub Macro_SetWobjAsActive()
Dim stn As Station = Project.ActiveProject
If stn Is Nothing Then Exit Sub
Dim dds As RsWorkObject = stn.ActiveTask.DataDeclarations("myWobj")
stn.ActiveTask.ActiveWorkObject = dds
End SubThere is also a method FindDataDeclarationsByType so that you can find for example all RsWorkObject by this doesn't seam to work in VSTA (works if you write an addin in VisulaStudio) have to do some communication with ABB about this
Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
And for C# programmers as myself
public void Macro_SetWobjAsActive()
{
Station stn = Project.ActiveProject as Station;
if (stn == null) return;
RsWorkObject wobj = (RsWorkObject)stn.ActiveTask.DataDeclarations["myWobj"];
stn.ActiveTask.ActiveWorkObject = wobj;
}Per Svensson
Robotics and Vision Specialist
Consat Engineering0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings