Hello Eduard,
The document V5Automation.chm includes some descriptions which
will help you to understand.
Here is a sample I created which output the trajectory into a
excel file:
Language="VBSCRIPT"
Sub CATMain()
'get the Product doc
Dim myProductDocument As
ProductDocument
set myProductDocument =
CATIA.ActiveDocument
'select robot
product
Dim mySelection As
Selection
set mySelection =
myProductDocument.Selection
Dim status As String
Dim filter(0)
filter(0) =
"Product"
status =
mySelection.SelectElement2(filter, "Select the robot from the PPR
tree to work on.", False)
Dim robot as
Product
If status = "Cancel"
Then
MsgBox("Selection
Canceled")
Exit
Sub
End If
set robot =
mySelection.Item(1).value
'retrieval of the trace
manager
Dim objDevice As
TCPTraceManager
set objDevice =
robot.GetTechnologicalObject("TCPTraceManager")
'activate the trace
objDevice.TCPTraceMode=True
'Get the last
path
Dim NbPath As Long
NbPath =
objDevice.GetNbPath
If NbPath>0 Then
'
retrieval of the last trace
Dim
RobotTCPTrace As TCPTrace
Set
RobotTCPTrace = objDevice.GetPath(NbPath)
'Export the trace points
RobotTCPTrace.Export("C:\TEMP\RobotTrajectory.xls")
Else
msgbox("No trajectory in
current session!")
End If
End Sub
Hope it help.
Quanwen