×
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

How to refresh the view in a scene in VBA?

How to refresh the view in a scene in VBA?

How to refresh the view in a scene in VBA?

(OP)
Hi!

I'm on CATIA V5 on a VBA project : I'm working with scenes and I hide some products in a scene I created and I would like to update the scene so I see the object has been hidden.
To create the scene I do :

Set RootProduct = CATIA.ActiveDocument.product
ProductName = RootProduct.Name

Set px(0) = RootProduct

' Retrieve the ProductScenes collection
Set TheScenes = RootProduct.GetTechnologicalObject("ScenesCollection")
Set oScene1 = TheScenes.AddProductScenePartial(ProductName, px)

To hide the RootProduct I do (it could be any product, I take the RootProduct just to give an example) :

Dim sceneData As SceneProductData

sceneData = oScene1.GetSceneProductData(RootProduct)
sceneData.Hidden = True

The problem is that here nothing is hidden.
I think the problem is that I don't refresh the view cause if I exit the scene and then go back to the scene, the product is hidden.

I tried already to update the current viewer
CATIA.ActiveWindow.ActiveViewer.Update
but it's not working...

Moreover, I don't want to use selection in my code.

Could you help please? I'm really stuck here.

Thanks a lot!
Emilie

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