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
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