×
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

white background with black text

white background with black text

white background with black text

(OP)
Hello All,

When I change graphic background to white color, white text of captures are invisible.

How can I change text to black with a VBA code or Catscript) in Catia 2015 while background is in white so that I can see the text?

Thank you All

Quin

RE: white background with black text

i m sure there are several example in v5automation file about changing color.

what is your progress so far?

Eric N.
indocti discant et ament meminisse periti

RE: white background with black text

i m playing with selecting semantic + non semantic annotation - capture and changing color manually.

This works fine with the file I have.

you could look into this, find a search syntax that would work, then select the result and change color to black.

many example of all that on v5automation or catia portable script center.

post your code so i can help

Eric N.
indocti discant et ament meminisse periti

RE: white background with black text

(OP)
Hi itsmyjob, below is what I got so far.

Here is an example of the capture's text I want to get to and change text color to black.



---------------------------- VBA CODE ---------------

Sub CATMain()

MsgBox "Active document must be a part document and captures are expanded " & Chr(13) & "in order to have the macro works properly."

'//// Access the active document
Dim PartDoc As Document
Set PartDoc = CATIA.ActiveDocument
'//// Set PartRoot part from the PartDoc part document
Dim PartRoot
Set PartRoot = PartDoc.Part

'//// Set user's annotation collection = PartRoot annotation sets, which has multiple annotation sets
Dim myAnnotCollection
Set myAnnotCollection = PartRoot.AnnotationSets

' myAnnotCollection.Clear
'//// Get first annotation set from annotation collection, myAnnotCollection
Dim AnnoSet1
Set AnnoSet1 = myAnnotCollection.Item(1)

'//// Get the number of captures in "annotSet1" above
Dim myCaptures, NumberOfCaptures
Set myCaptures = AnnoSet1.Captures '//// Access captures inside the annotation set
NumberOfCaptures = AnnoSet1.Captures.Count

MsgBox "Number of annotation sets in active document is: " & myAnnotCollection.Count & " and number of captures is: " & NumberOfCaptures

'//// Loop through capture collection
Dim j As Integer
For j = 1 To myCaptures.Count

'//// Display the current capture
Set myCaptures = AnnoSet1.Captures.Item(j)

'//// Display the annotated Capture, one-by-one, on the monitor if it is not "All" or "Change" captures
myCaptures.DisplayCapture
MsgBox "Capture #: " & j & ", " & myCaptures.Name
MsgBox "Capture #: " & j & "," & myCaptures.Name.Value '//// Error is right here: "Object required"

Next
End Sub

-------------------------- end of vba code --------------------

My above VBA code only gets to the point where I can access and display the captures on the monitor.
I think I need to obtain "text value" of the captures first, then change text color to black, but I do not know how.

Please help me out?

"...many example of all that on v5automation or catia portable script center." I have looked into V5Automation but not able to locate those examples. Please lead me there.

I do not have "catia portable script center." Could you please give me a copy?

Thank you in advance

Quin

RE: white background with black text

in order to script CATIA you need a minimum of understanding of CATIA.

the Capture is not a text, it is a definition of what is visible or not when showed. When you DisplayCapture, it actually change the visible state of elements.

So what you want to do is actually change the color of the FTA elements. So first you need to select them.

Play with the advance search function in CATIA, once you can select only what you need, then go back to scripting and do it.

I would be surprised if I could not find selection search or how to change color in v5automation file.

I will not give you code for free, I am looking for a job, while you are being paid. I will guide you to find what you are looking for.

Keep posting your progress, there was nothing about selecting text/FTA or changing color in what you posted... keep trying



Eric N.
indocti discant et ament meminisse periti

RE: white background with black text

(OP)
What is FTA?

I am not familiar with the term and its meaning?

Quin

RE: white background with black text

(OP)
OK...i got it FTA = Functional Tolerancing and Annotation.

How can I select the text element.

I searched the V5Automation but not able to locate "text" references yet.

Thanks

Quin

RE: white background with black text

try first to select your text / FTA with the (advance) search tool (CTRL + F)

then go in CATIA VBA doc and search for "search"

Eric N.
indocti discant et ament meminisse periti

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