I want to export the mass of a CATIA product using CATScript. This is my solution:
'Start code
Sub CATMain()
Dim SRT as ProductDocument
Set SRT = CATIA.Documents.Open ("T:\...\SRT_2030.CATProduct")
Set SRT = CATIA.ActiveDocument
Dim oSelection As Selection
Set oSelection = SRT.Selection
Dim oProduct As Selection
Set oProduct = oSelection.FindObject("SRT")
Dim oInertia As AnyObject
Set oInertia = oProduct.GetTechnologicalObject("Inertia")
Dim dMass As Double
dMass = oInertia.Mass
'Display the results
MsgBox dMass
'End code
End Sub
I get this error: The method FindObject failed
What do I do wrong?
Thanks for your help!