×
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

Rename a Annotated View with script, is not working (DMU Navigator workbench)

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.


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)

Hi,

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)

(OP)
Thank you for your answer.
It's not working, but I succeed by unlinking and linking the annotated view.

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