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