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

p = Plotter("mesh.vtm")
p.set_scalar("B-Mag (T)")
p.show()

# Hide a specific block
p.set_block_visibility("air", False)

# Show it again
p.set_block_visibility("air", True)

See Also