Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refresh the view in a scene in VBA?

Status
Not open for further replies.

Milie

Computer
Nov 27, 2013
12
FR
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top