How to clone Visual 3DObjects

Is it possible to "clone" Visual3D-Objects to easily get "similar Objects"?

I want to do the following:
* Create an object A
* Set several Parameters (size, Position, ...)
* Clone it to object B
* Change e.g. Material of B

--> Now both Objects are similar, only the color is different.

How can I achive this behavior?

Thank you very much,
Best regards,
There is no automatic way to clone a Visual3D object. 

However it is possible to a Model3D object (GeometryModel3D or Model3DGroup) - you can use Clone method. After cloning you can use Ab3d.Utilities.ModelUtils.ChangeMaterial (or ChangeBackMaterial) methods to change material on all Model3D objects in the Model3DGroup.

So if you want to close a simple ModelVisual3D or ContentVisual3D objects that only have Content property set (and does not have any Children assigned), then you can create a new instance of ModelVisual3D / ContentVisual3D and set its Content property to the cloned Model3D that is assigned on the original Content property. 

But this is not recommended for BoxVisual3D and other more complex Visual3D objects.

Here you will need to manually create a new Visual3D object and copy the values for each property.
Andrej Benedik

Forum Jump:

Users browsing this thread:
1 Guest(s)