Individually set Properties of Features from uniqe clones

Hi,

i would like to set the visibility of a feature (Block) in cloned components in .NET.

I use:

ISimComponent newComp = (ISimComponent)oldComponent.Clone(CloningMode.Unique, false);

and

if(setBlockInvisible)
{
   var block = newComp.RootNode.Features.FirstOrDefault(f => f.Type == FeatureType.Block);
   if (block != null)
      block.IsVisible = false;
}

The problem is, that once I set one block.IsVisible = false, all the other blocks of the other components are also IsVisible = false, but I choose to make the components unique. It also says IsSharedClone = false in the components.
Am I missing something?

Thanks in advance!

Best Regards,
Jürgen

Unfortunate, that no one tried to help.

Support told me it’s a bug from VisualComponents, that Geometries won’t get Unique.
They gave me a workaround, written in Python, where the Geometries are cloned, before modifying them:

part.makeUnique()
#clone geometry and delete original
geo = part.Geometry #type: vcGeometryContainer
user_geo = part.UserGeometry #type : vcGeometryContainer
geo.cloneGeometrySets(user_geo)
geo.clear()
user_geo.cloneGeometrySets(geo)
user_geo.clear()
user_geo.update()
geo.update()

#modify geometry
...

I tried to apply it in .NET, but could not get it working.

I then did it in Python, but there was no ned to apply the above workaround.
It just worked: Modifying the Property, without changing the same properties from the cloned components.

BG,
Jürgen

Hy @juergenb,
what Version of VC are you using?
On VC 4.10.2 this worked for me and Schiegetor is a cloned by same stuff you do, the only difference there was that second param was true…

The orginal stayed visible and in the clone it was invisible!

Regards