×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATScript - Keeping a Selection, but not Highlighting it
2

CATScript - Keeping a Selection, but not Highlighting it

CATScript - Keeping a Selection, but not Highlighting it

(OP)
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

RE: CATScript - Keeping a Selection, but not Highlighting it

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

Thanks,
Jeff

RE: CATScript - Keeping a Selection, but not Highlighting it

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

https://picasaweb.google.com/102257836106335725208

RE: CATScript - Keeping a Selection, but not Highlighting it

(OP)
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

RE: CATScript - Keeping a Selection, but not Highlighting it

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

https://picasaweb.google.com/102257836106335725208

RE: CATScript - Keeping a Selection, but not Highlighting it

(OP)
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

RE: CATScript - Keeping a Selection, but not Highlighting it

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources