Hello. I'm trying to hide/unhide annotations under a specific View in a CATPart. I can count the total number of views but am not able to change a View's name. I can find the specific View using Search but am not sure if there is a way to access the annotations listed under that view. Attached is a pic of my spec tree and below is code I've written so far. Any ideas, is this even possible?
Sub CATMain()
Set PartDoc = CATIA.ActiveDocument
Set Part = PartDoc.Part
Set oAnnotationSets = Part.AnnotationSets
msgbox "Number of annotation sets: " & oannotationSets.Count
Dim AnnoSet1 As AnnotationSet
Set AnnoSet1 = oAnnotationSets.Item(1)
numViews=AnnoSet1.TPSViews.Count
msgbox "Number of views is: "& numViews
Dim sSelection As Selection
Set sSelection = CATIA.ActiveDocument.Selection
sSelection.Add oAnnotationSets.Item(1)
sSelection.Search "Name=REAR VIEW,sel"
Dim iCount As Integer
iCount2 = sSelection.Count
msgbox "Number of views found is "&icount2
Dim visPropertySet1 As VisPropertySet
Set visPropertySet1 = sSelection.VisProperties
visPropertySet1.SetShow 0
End Sub
Sub CATMain()
Set PartDoc = CATIA.ActiveDocument
Set Part = PartDoc.Part
Set oAnnotationSets = Part.AnnotationSets
msgbox "Number of annotation sets: " & oannotationSets.Count
Dim AnnoSet1 As AnnotationSet
Set AnnoSet1 = oAnnotationSets.Item(1)
numViews=AnnoSet1.TPSViews.Count
msgbox "Number of views is: "& numViews
Dim sSelection As Selection
Set sSelection = CATIA.ActiveDocument.Selection
sSelection.Add oAnnotationSets.Item(1)
sSelection.Search "Name=REAR VIEW,sel"
Dim iCount As Integer
iCount2 = sSelection.Count
msgbox "Number of views found is "&icount2
Dim visPropertySet1 As VisPropertySet
Set visPropertySet1 = sSelection.VisProperties
visPropertySet1.SetShow 0
End Sub