Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATScript - Keeping a Selection, but not Highlighting it 2

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
CA
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,
Jeff
 
Replies continue below

Recommended for you

Alternately, does anyone know how to change the selection color to BLACK in a CATScript?

Thanks,
Jeff
 
Hi,

Search for RGB Color Chart on Internet. In the Grays table you will get:

Color Name RGB CODE HEX #
Black 0-0-0 000000
Dark Slate Gray 49-79-79 2f4f4f
Dim Gray 105-105-105 696969
Slate Gray 112-138-144 708090
Light Slate Gray 119-136-153 778899
Gray 190-190-190 bebebe
Light Gray 211-211-211 d3d3d3


So, changing to black it will be something like:

Dim Obj As VispProperties
Set Obj = Selection.VisProperties
Obj.SetRealColor 0,0,0,0

Regards
Fernando

 
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.

Jeff
 
OK, maybe this will help you.

Selection1.Search "CatPrtSearch.Plane,All" 'search and select planes for example
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 1 'hide planes
Selection1.Clear 'clear selction

Now you can capture screen without selection done

Regards
Fernando

 
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.

So thanks again,
Jeff
 
Hi,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top