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!

white background with black text

Status
Not open for further replies.

Thosnow

Aerospace
Feb 23, 2017
68
CA
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
 
Replies continue below

Recommended for you

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
 
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
 
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.

Capture_Text_bcuazm.jpg


---------------------------- 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
 
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
 
What is FTA?

I am not familiar with the term and its meaning?

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

Part and Inventory Search

Sponsor

Back
Top