Skip to main content

set_block_visibility()

Sets the visibility for all actors associated with a block.

Updates the visibility state in the internal dictionary and applies it to all actors (feature edges, scalar field, contours, vector field) associated with the specified block, then renders the scene. Works in both desktop and notebook modes.

Parameters
  • block_name (str) — The name of the block to update.
  • visible (bool) — True to show the block, False to hide it.

Example

from pyemsi import Plotter, examples

file_path = examples.transient_path()
plt = Plotter(file_path)
plt.set_scalar("B-Mag (T)")
plt.render()

# Hide block '4' from the transient example
plt.set_block_visibility("4", False)

# Show it again
plt.set_block_visibility("4", True)

See Also