Hide Sensors

Hi there!
My component has some vcVolumeSensor behaviors that are visible when the component is selected in the HOME tab. Since it has many vcVolumeSensor behaviors, it looks too crowded. Is there a way to hide these? They don’t appear in the Properties list of the component (which is expected, because they’re not properties).


Screenshot 2023-11-14 172249

Behaviors have a “Visible” (or something like that) property that can be set to False to hide them from the component properties panel.

you can click on modelling tab and then select the faces that you’d like to be unvisible. than hit visible from the panel. in that way you can unvisible only the selected faces without lose the features of the components

Hmm… I couldn’t find such a property… This is the output for print([prop.Name for prop in comp.Properties]):

[‘Name’, ‘UpdateScene’, ‘TestParent’, ‘TestSiblings’, ‘TestOnlyContained’, ‘ShowVolume’, ‘VolumeMaterial’, ‘TestMethod’, ‘UseSampling’, ‘SampleTime’, ‘DetectionContainer’, ‘ComponentSignal’, ‘BoolSignal’, ‘LowerFrame’, ‘UpperFrame’]

This is the same as the list of Behavior Specific Properties for the Volume Sensor behaviour described by the Python API reference documentation. The list of Common Properties is: Component, Enabled, IgnoreEvents, Name, Parent, Properties, Type, World. I can’t use any of these to hide the behaviour in the Component Properties panel (ShowVolume is for showing it in the 3D world).

Thanks, but what I would like to make invisible are the properties of the volume sensors in the Component Properties panel, not the detection boxes of the volume volumes sensors. Those cannot even be clicked. You can define 2 corners for them, and that’s how they’re drawn in the 3D world, but they are not objects that the user can click.

comp = getComponent()

def OnFinalize():
  volumeSensors = [behaviour for behaviour in comp.Behaviours if behaviour.Type == VC_VOLUMESENSOR] 
  for volumeSensor in volumeSensors:
    volumeSensor.Visible = False

The Visible property is listed here as common property for all behaviors:

I think it was added in a somewhat recent version of VC.

1 Like

For older versions you can rename behaviour by adding postfix __HIDE__ at the end, for example VolumeSensor_1_6 rename to VolumeSensor_1_6__HIDE__ (two underscores before word HIDE and two underscores after them).

1 Like

@TSy @chungmin , after upgrading to 4.8 and running this, it worked. Thanks a lot guys!

1 Like