Is there a way to prevent CATIA from highlighting a selection in a CATSCript? I want to keep my selection while I am taking screen shots, but I don't want the selection to be highlighted in the screen shot.
Thanks Fernando, but I don't want to change the object color. I just want to either (a) turn off highlighting when something is selected OR (b) change the color CATIA uses for highlighting (which I can find under Tools->Options->Display->Visualization->Selected Elements - but I don't know how to change using the CATScript.
Selection1.Search "CatPrtSearch.Plane,All" 'search and select planes for example
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1 'hide planes
Selection1.Clear 'clear selction
For some reason I thought my code needed to "remember" the selection, so I didn't want to clear it. But then I thought about your point and realized my item still exists so I can Add it again after clearing it to do other operations.
If you want to reuse the selected items and at the same time you want to clear the selection then there is another solution which I have used successfully in the machining workbench.
Below is a code snippet where I selected some machining-operations(from the catprocess document) and then stored them in a Collection. With this approach you can select the objects and clear the selection as many times as you want. And then you can recall the items from the collections in the same way you do it with Selection. Hope this helps you.
Dim sourceMOsCollection1 As New Collection
For i = 1 To selection1.Count
Set CurrentActivity = selection1.Item2(i).Value
If CurrentActivity.Type <> "PPInstruction" Then
sourceMOsCollection1.Add selection1.Item2(i).Value
End If
Next