Viewing Targets to visible Paths only?
Comments
-
Unfortunately, no. If you change the visibility of the 'Targets' node all targets will remain invisible.
But again here is two usuful macros:
This will turn all targets in the station invisible:
Sub AllTargetsInvisible()
Dim tgtT As Target
For Each tgtT In ActiveStation.Targets
tgtT.Visible = False
Next
ActiveStation.Refresh
End SubAnd this one will let you select a path for which we will make all of it's targets visible:
Sub TargetsInPathVisible()
'Get user input
Dim strPath As String
strPath = InputBox("Write in the name of a Path:", "Make all targets in selected path visible", "Path")
'See if the user selected path exists
Dim pthP As Path
Dim pthSelected As Path
Dim blFound As Boolean
blFound = False
For Each pthP In ActiveStation.Paths
If pthP.Name = strPath Then
Set pthSelected = ActiveStation.Paths(strPath)
blFound = True
End If
Next
If blFound = True Then
'Searches through the path for targets
Dim tgtT As Target
Dim piX As PathInstruction
Dim trfTarget As TargetRef
For Each piX In pthSelected.PathInstructions
If TypeOf piX Is TargetRef Then
Set trfTarget = piX
trfTarget.Target.Visible = True
If trfTarget.MotionType = rsMotionTypeCircular Then
trfTarget.ViaTarget.Visible = True
End If
End If
Next
Else
'If the path wasn't in the station
MsgBox "The path: " & strPath & " was not found in the station.", vbCritical, "Try again"
End If
ActiveStation.Refresh
End SubBy combining these two I hope that you'll be fine.
John
Developer Center0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings