Rename a Annotated View with script, is not working (DMU Navigator workbench)
Rename a Annotated View with script, is not working (DMU Navigator workbench)
(OP)
I try to rename a annotated view using a small script but is not working as it should.
If I check in the proprieties window of the Ann view, it seems that the name was changed, but in the tree I can see still the old name.
After I click Apply in the proprieties window, the name is also changed in the tree.
Thank you for your help.
If I check in the proprieties window of the Ann view, it seems that the name was changed, but in the tree I can see still the old name.
After I click Apply in the proprieties window, the name is also changed in the tree.
Thank you for your help.
CODE -->
Sub CATMain()
' Retrieve the AnnotatedViews collection
Dim cAnnotatedViews As AnyObject
Set cAnnotatedViews = CATIA.ActiveDocument.Product.GetTechnologicalObject("AnnotatedViews")
' Retrieve selection
Dim sel
set sel=Catia.ActiveDocument.Selection
' Check if selection is a annotated view
If sel.Item2(1).Type = "AnnotatedView" Then
name = sel.Item2(1).Value.Name
Else
MsgBox("Select Annotated View!!!")
Exit Sub
End If
' Retrieve selected annotated view
Dim annView
Set annView = cAnnotatedViews.Item(name)
' Change name to a desired one
annView.Name = "test"
End Sub 




RE: Rename a Annotated View with script, is not working (DMU Navigator workbench)
Can you try to force update the view ?
I didn't test but something like:
Set oSelection = catia.activedocument.Selection
oSelection.Clear
oSelection.Add annViewUpdate
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: Rename a Annotated View with script, is not working (DMU Navigator workbench)
It's not working, but I succeed by unlinking and linking the annotated view.