Dear Users,
I am trying to connect a drawing to a 3D part, using the SelectElementOtherEditor method, found in the automation documentation (DSYAutomation.chm). In here, an example is given of a script where the user has to select a plane in a 3dmodel to create a frontview in a drawing (a snippet of the code is given below). However, when trying to run this script, it gives an empty selection no matter whether you select a plane, or other types of objects, resulting in the error: "Description: The CSO is empty. The Item operation could not be performed." I tried changing oOtherEditor.Selection.Item(1) to oSel.Selection.Item(1), which does return data, but seemingly only on the selected part itself, and not the underlying parameters. Is anyone familiar with the function, and knows a workaround for the empty CSO, so I can select a parameter set (e.g. Test_1 in the image), and pass information of the parameters within this set (Test_Spec1, Test_Spec2...) on to a drawing?
Thanks in advance!
Language="VBSCRIPT"
Sub CATMain()
Dim oSel As Selection
Dim editor1 As Editor
Set editor1 = CATIA.ActiveEditor
Set oSel = editor1.Selection
Dim InputObjectType(0), Status, oOtherEditor
InputObjectType(0) = "AnyObject"
Status = oSel.SelectElementOtherEditor(InputObjectType,"Switch to Test model", "Select test parameters",False, oOtherEditor)
Dim BiDimFeature, V1(2), V2(2)
Set BiDimFeature = oOtherEditor.Selection.Item(1).Value
End Sub