Cubit Python API  17.05
Classes | Functions | Variables
cubit Namespace Reference

Classes

class   AssemblyItem
  Class to implement assembly tree interface. More...
 
class   Body
  Defines a body object that mostly parallels Cubit's Body class. More...
 
class   BoltHoleInfo
 
class   CFD_BC_Entity
  Class to implement cfd bc data retrieval. More...
 
class   CIObserve
 
class   CubitFailureException
  An exception class to alert the caller when the underlying Cubit function fails. More...
 
class   CubitMessageHandler
  CubitMessageHandler provides a way to override how messages are displayed to the user. More...
 
class   CubitProgressHandler
 
class   CubitStringMessageHandler
 
class   Curve
  Defines a curve object that mostly parallels Cubit's RefEdge class. More...
 
class   Dir
  Defines a direction object. More...
 
class   Entity
  The base class of all the geometry and mesh types. More...
 
class   ExternalExitHandler
 
class   GeomEntity
  The base class for specifically the Geometry types (Body, Surface, etc.) More...
 
class   InvalidEntityException
  An exception class to alert the caller that an invalid entity was attempted to be used. More...
 
class   InvalidInputException
  An exception class to alert the caller of a function that invalid inputs were entered. More...
 
class   Loc
  Defines a location object. More...
 
class   MeshErrorFeedback
  Class to implement mesh command feedback processing. More...
 
class   MeshImport
 
class   Surface
  Defines a surface object that mostly parallels Cubit's RefFace class. More...
 
class   Vertex
  Defines a vertex object that mostly parallels Cubit's RefVertex class. More...
 
class   Volume
  Defines a volume object that mostly parallels Cubit's RefVolume class. More...
 
class   VolumeGap
 

Functions

def  body (id_in)
  Retrieve a body by its ID. More...
 
def  brick (width, depth=-1, height=-1)
  Create a brick of specified width, depth, and height. More...
 
def  copy_body (init_body)
  Create a duplicate of the specified body. More...
 
def  create_arc_curve (v0, v1, intermediate_point)
  Create an arc curve using end vertices and an intermediate point. More...
 
def  create_curve (v0, v1)
  Create a curve between two vertices. More...
 
def  create_spline (points, surface_id)
  Create a spline curve through a sequence of 3D points on a surface. More...
 
def  create_surface (curves)
  Create a sheet body from boundary curves. More...
 
def  create_vertex (x, y, z)
  Create a vertex at specified coordinates. More...
 
def  curve (id_in)
  Retrieve a curve object by its ID. More...
 
def  cylinder (height, x_radius, y_radius, top_radius)
  Create a cylinder or truncated cone of specified dimensions. More...
 
def  get_all_cfd_bcs ()
 
def  get_assembly_children (assembly_id)
 
def  get_assembly_items ()
 
def  get_mesh_error_count ()
 
def  get_mesh_errors ()
 
def  get_top_level_assembly_items ()
 
def  get_volume_CAD_material (volume_id)
 
def  get_volumes_for_node (node_name, node_instance)
 
def  move (entity, vector, preview=False)
  Translates an Entity by a specified vector. More...
 
def  prism (height, sides, major, minor)
  Create a prism of the specified dimensions. More...
 
def  pyramid (height, sides, major, minor, top=0.0)
  Create a pyramid of specified dimensions. More...
 
def  reflect (entity, axis, preview=False)
  Reflects an Entity about a specified axis (e.g., plane normal). More...
 
def  reset ()
  Reset Cubit state. More...
 
def  scale (entity, factor, preview=False)
  Scales an Entity uniformly by a specified factor. More...
 
def  set_element_variable (element_ids, variable_name, variables)
  Sets scalar variables on specified mesh elements for Exodus export. More...
 
def  set_nodal_variable (node_ids, variable_name, variables)
  Sets scalar variables on specified mesh nodes. More...
 
def  sphere (radius, x_cut=0, y_cut=0, z_cut=0, inner_radius=0)
  Create all or part of a sphere. More...
 
def  subtract (tool_in, from_in, imprint_in=False, keep_old_in=False)
  Performs a boolean subtract operation: removes tool bodies from target bodies. More...
 
def  surface (id_in)
  Retrieve a surface object by its ID. More...
 
def  sweep_curve (curves, along_curves, draft_angle, draft_type, rigid)
  Sweep one or more curves along a path to create sheet bodies. More...
 
def  torus (center_radius, swept_radius)
  Create a torus of specified dimensions. More...
 
def  tweak_curve_offset (curves, distances, keep_old=False, preview=False)
  2D equivalent of tweak_surface_offset: offsets specified curves on a sheet body. More...
 
def  tweak_curve_remove (curves, keep_old=False, preview=False)
  Removes specified curves and extends adjacent surfaces on a sheet body. More...
 
def  tweak_surface_offset (surfaces, distances)
  Offsets specified surfaces by given distances. More...
 
def  tweak_surface_remove (surfaces, extend_ajoining=True, keep_old=False, preview=False)
  Removes specified surfaces from a body, optionally extending adjacent surfaces. More...
 
def  tweak_vertex_fillet (verts, radius, keep_old=False, preview=False)
  2D sheet vertex chamfer: creates chamfers at specified vertices by offsetting adjacent curves. More...
 
def  unite (body_in, keep_old_in=False)
  Performs a boolean unite operation: merges specified bodies into one. More...
 
def  vertex (id_in)
  Retrieve a vertex object by its ID. More...
 
def  volume (id_in)
  Retrieve a volume by its ID. More...
 
CubitInterface Control
def  init (argv)
  Initialize the Cubit engine with optional startup arguments. More...
 
def  destroy ()
  Shut down Cubit and close the active journal file. More...
 
def  set_cubit_message_handler (hdlr)
  Redirect Cubit output to a custom message handler. More...
 
def  get_cubit_message_handler ()
  Retrieve the current Cubit message handler. More...
 
def  set_exit_handler (hdlr)
  Set a custom exit callback for Cubit. More...
 
def  set_progress_handler (progress)
  Register a progress-bar callback handler with Cubit. More...
 
def  replace_progress_handler (progress)
  Replace the current progress-bar callback handler and return the old one. More...
 
def  set_cubit_interrupt (interrupt)
  Enable or disable interruptible operations in Cubit. More...
 
System Control and Data
def  set_playback_paused_on_error (pause)
  Configure whether playback pauses on error. More...
 
def  is_playback_paused_on_error ()
  Query whether playback is paused on error. More...
 
def  pause_playback ()
  Pause journal playback immediately. More...
 
def  stop_playback ()
  Stop journal playback entirely. More...
 
def  resume_playback ()
  Resume a paused journal playback. More...
 
def  is_playback_paused ()
  Check if journal playback is currently paused. More...
 
def  developer_commands_are_enabled ()
  Check if developer commands are enabled. More...
 
def  get_interface (interface_name)
  Retrieve a Cubit interface by name. More...
 
def  release_interface (instance)
  Release a previously retrieved Cubit interface. More...
 
def  add_filename_to_recent_file_list (filename)
  Add a filename to Cubit's recent-file list in the GUI File menu. More...
 
def  get_version ()
  Retrieve the current Cubit version string. More...
 
def  get_revision_date ()
  Retrieve the Cubit revision date. More...
 
def  get_build_number ()
  Retrieve the Cubit build number. More...
 
def  get_acis_version ()
  Retrieve the ACIS kernel version string. More...
 
def  get_acis_version_as_int ()
  Retrieve the ACIS kernel version as an integer. More...
 
def  get_sgm_version ()
  Retrieve the SGM (Solid Geometry Manager) version. More...
 
def  get_exodus_version ()
  Retrieve the Exodus mesh library version. More...
 
def  get_meshgems_version ()
  Retrieve the MeshGems library version. More...
 
def  get_graphics_version ()
  Retrieve the VTK (Visualization Toolkit) version used by Cubit. More...
 
def  get_python_version ()
  Retrieve the Python interpreter version used by Cubit. More...
 
def  get_default_geometry_engine ()
  Get the name of the default modeler engine. More...
 
def  is_catia_engine_available ()
  Determine whether the CATIA geometry engine is available. More...
 
def  is_acis_engine_available ()
  Determine whether the ACIS geometry engine is available. More...
 
def  is_opencascade_engine_available ()
  Determine whether the OpenCASCADE geometry engine is available. More...
 
def  is_special_build (build_type)
  Check if a special build type is available. More...
 
def  print_cmd_options ()
  Display Cubit's supported startup options. More...
 
def  is_modified ()
  Check if the model has been modified since import or last save. More...
 
def  set_modified ()
  Reset the model's modified status to "unmodified". More...
 
def  is_undo_save_needed ()
  Check if the model requires an undo checkpoint save. More...
 
def  set_undo_saved ()
  Clear the undo-needed flag for the model. More...
 
def  is_performing_undo ()
  Query whether an undo operation is currently being performed. More...
 
def  was_last_cmd_undoable ()
  Report whether the last executed command was undoable. More...
 
def  get_undo_enabled ()
  Query whether undo is currently enabled. More...
 
def  number_undo_commands ()
  Query the number of undoable commands in the stack. More...
 
def  is_command_echoed ()
  Check whether Cubit echoes commands to the console. More...
 
def  get_command_from_history (command_number)
  Retrieve a specific command from Cubit's history buffer. More...
 
def  get_command_history_count ()
  Get the number of commands in Cubit's history buffer. More...
 
def  get_next_command_from_history ()
  Get the next command from the history buffer. More...
 
def  get_previous_command_from_history ()
  Get the previous command from the history buffer. More...
 
def  write_to_journal (words)
  Append a custom entry to Cubit's journal and recording streams. More...
 
def  journal_commands (state)
  Enable or disable journaling of Cubit commands. More...
 
def  is_command_journaled ()
  Query whether Cubit is journaling commands. More...
 
def  get_current_journal_file ()
  Get the filename of the current journal file. More...
 
def  is_working_dir_set ()
  Check if the "-workingdir" option was provided at Cubit startup. More...
 
def  app_util ()
  Return Cubit's AppUtil interface for global services. More...
 
def  cgm_iface ()
  Return the CGM-based geometry interface for Cubit. More...
 
def  cgm ()
  Return the raw CGMApp kernel instance used by Cubit. More...
 
Command Utilities
def  cmd (input_string)
  Execute a raw Cubit command string immediately (modifies model state). More...
 
def  silent_cmd (input_string)
  Execute a Cubit command without echoing or verbose output. More...
 
def  print_info (message)
  Print a message through Cubit's messaging system. More...
 
def  parse_cubit_list (type, entity_list_string)
  Parse a Cubit-style entity selection expression into a list of IDs. More...
 
def  parse_locations (location_str)
  Parse a Cubit location specification into concrete 3D coordinates. More...
 
def  string_from_id_list (ids)
  Convert a list of integers into a compact Cubit-style ID string. More...
 
def  get_id_string (entity_ids, sort=True)
  Convert a list of integers into a compact Cubit-style ID range string. More...
 
def  print_raw_help (input_line, order_dependent, consecutive_dependent)
  Display context-sensitive help while typing commands. More...
 
def  get_error_count ()
  Retrieve the total number of errors in the current Cubit session. More...
 
def  get_cubit_digits_setting ()
  Retrieve the current Cubit "digits" setting. More...
 
def  is_part_of_list (target_id, id_list)
  Check if an ID is present in a list of IDs. More...
 
def  get_last_id (entity_type)
  Get the ID of the last created entity of the given type. More...
 
def  entity_exists (entity_type, id)
  Check whether an entity of the specified type and ID exists. More...
 
def  get_idless_signature (entity_type, entity_id)
  Get the idless signature of a geometric or mesh entity. More...
 
def  get_idless_signatures (entity_type, entity_id_list)
  Get the idless signatures of a range of geometric or mesh entities. More...
 
def  get_aprepro_vars ()
  Retrieve the current Aprepro variable names. More...
 
def  get_aprepro_value_as_string (variable_name)
  Get the string value of an Aprepro variable. More...
 
def  get_aprepro_numeric_value (variable_name)
  Get the numeric value of a specified Aprepro variable. More...
 
Graphics Viewing
def  get_view_distance ()
  Get the camera's distance between its position and focus point. More...
 
def  get_view_at ()
  Get the camera's current "at" (target) point. More...
 
def  get_view_from ()
  Get the camera's current 'from' (position) point. More...
 
def  get_view_up ()
  Get the camera's 'up' direction vector. More...
 
def  reset_camera ()
  Reset the camera view and clear auxiliary graphics windows. More...
 
def  flush_graphics ()
  Force immediate rendering of pending graphics operations. More...
 
def  is_perspective_on ()
  Check if perspective projection is enabled. More...
 
def  is_occlusion_on ()
  Check if occlusion is enabled. More...
 
def  is_scale_visibility_on ()
  Check if the scale annotation is visible in the graphics window. More...
 
def  is_mesh_visibility_on ()
  Check if mesh graphics are visible in the graphics window. More...
 
def  is_geometry_visibility_on ()
  Check if geometry graphics are visible in the graphics window. More...
 
def  get_rendering_mode ()
  Get the current graphics rendering mode. More...
 
def  set_rendering_mode (mode)
  Set the current graphics rendering mode (equivalent to "Graphics Mode <option>"). More...
 
def  set_label_type (entity_type, label_flag)
  Sets label display type for a given entity type. More...
 
def  get_label_type (entity_type)
  Gets the current label display type for a given entity type. More...
 
Graphics Entity Selections
def  clear_drawing_set (set_name)
  Clear all geometry in a named drawing set (e.g., mesh preview). More...
 
def  unselect_entity (entity_type, entity_id)
  Unselect an entity that is currently selected. More...
 
def  get_rubberband_shape ()
  Get the current rubberband selection shape. More...
 
def  is_select_partial_on ()
  Check if partial selection is enabled. More...
 
def  clear_highlight ()
  Clear all entity highlights. More...
 
def  clear_preview ()
  Clear preview graphics without affecting other display settings. More...
 
def  highlight (entity_type, entity_id)
  Highlight the given entity in the graphics window without selecting it. More...
 
def  get_selected_ids ()
  Retrieve all currently selected entity IDs in pick order. More...
 
def  get_selected_id (index)
  Get the selected entity ID by index. More...
 
def  get_selected_type (index)
  Get the selected entity type by index. More...
 
def  get_pick_type ()
  Get the current pick mode for entity selection. More...
 
def  set_pick_type (pick_type, silent=False)
  Set the current pick mode for entity selection. More...
 
def  set_filter_types (num_types, filter_types)
  Set multiple pick filter types for graphics selections. More...
 
def  add_filter_type (filter_type)
  Add an entity type to the graphics pick filter. More...
 
def  remove_filter_type (filter_type)
  Remove an entity type from the graphics pick filter. More...
 
def  is_type_filtered (filter_type)
  Check if a specific entity type is currently excluded from picking. More...
 
def  get_pick_filters ()
  Retrieve the list of entity types currently allowed for picking. More...
 
def  clear_picked_list ()
  Clear the list of currently picked entities. More...
 
def  step_next_possible_selection ()
  Advance to the next entity in the current selection list. More...
 
def  step_previous_possible_selection ()
  Move back to the previous entity in the current selection list. More...
 
def  print_current_selections ()
  Print all selected entities and their types. More...
 
def  print_currently_selected_entity ()
  Print details of the current selected entity. More...
 
def  current_selection_count ()
  Get the number of entities in the current selection list. More...
 
Meshing Schemes Support
def  get_default_element_type ()
  Retrieve the current default element type for meshing. More...
 
def  is_volume_meshable (volume_id)
  Check if a volume is meshable under the current meshing scheme. More...
 
def  is_surface_meshable (surface_id)
  Check if a surface is meshable under the current meshing scheme. More...
 
def  get_vertex_type (surface_id, vertex_id)
  Retrieve the vertex type for a given vertex on a surface. More...
 
def  get_submap_corner_types (surface_id)
  Get a list of vertex IDs and their corner-type codes for a surface submap. More...
 
def  get_curve_bias_type (curve_id)
  Retrieve the bias scheme type applied to a curve. More...
 
def  get_curve_bias_geometric_factor (curve_id)
  Get the primary geometric progression factor used for biasing a curve. More...
 
def  get_curve_bias_geometric_factor2 (curve_id)
  Get the secondary geometric progression factor for a dual-bias curve. More...
 
def  get_curve_bias_first_interval_length (curve_id)
  Query the length of the first interval on a biased curve. More...
 
def  get_curve_bias_first_interval_fraction (curve_id)
  Retrieve the fraction of curve length used as the first interval size. More...
 
def  get_curve_bias_fine_size (curve_id)
  Get the "fine size" parameter for a biased curve, if set. More...
 
def  get_curve_bias_coarse_size (curve_id)
  Get the "coarse size" parameter for a biased curve, if set. More...
 
def  get_curve_bias_first_last_ratio1 (curve_id)
  Retrieve the ratio of first-to-last interval at the start of a biased curve. More...
 
def  get_curve_bias_first_last_ratio2 (curve_id)
  Retrieve the ratio of first-to-last interval at the end of a biased curve. More...
 
def  get_curve_bias_last_first_ratio1 (curve_id)
  Retrieve the ratio of last-to-first interval at the start of a biased curve. More...
 
def  get_curve_bias_last_first_ratio2 (curve_id)
  Retrieve the ratio of last-to-first interval at the end of a biased curve. More...
 
def  get_curve_bias_from_start (curve_id, value)
  Determine if the bias is measured from the curve's start vertex. More...
 
def  get_curve_bias_from_start_set (curve_id)
  Check if the "bias from start" flag has been explicitly set on a curve. More...
 
def  get_curve_bias_start_vertex_id (curve_id)
  Retrieve the vertex ID designated as the start of bias on a curve. More...
 
def  get_curve_mesh_scheme_curvature (curve_id)
  Retrieve the curvature mesh scheme adaptation value for a curve. More...
 
def  get_curve_mesh_scheme_pinpoint_locations (curve_id)
  Retrieve the pinpoint mesh scheme locations for a curve. More...
 
def  get_mesh_scheme (geometry_type, entity_id)
  Retrieve the meshing scheme applied to a geometric entity. More...
 
def  get_smooth_scheme (geometry_type, entity_id)
  Retrieve the smoothing scheme for a specified geometry entity. More...
 
def  get_mesh_scheme_firmness (geometry_type, entity_id)
  Retrieve the meshing scheme firmness for a specified surface or volume. More...
 
def  get_tetmesh_proximity_flag (volume_id)
  Get the proximity-layer flag for tet meshing on a volume. More...
 
def  get_tetmesh_proximity_layers (volume_id)
  Get the number of proximity layers for tet meshing on a volume. More...
 
def  get_tetmesh_growth_factor (volume_id)
  Get the growth factor for tet meshing on a volume. More...
 
def  get_tetmesh_parallel ()
  Get the global parallel-tetmesher flag (HPC) setting. More...
 
def  get_tetmesh_num_anisotropic_layers ()
  Get the global number of anisotropic tet layers setting. More...
 
def  get_tetmesh_optimization_level ()
  Get the global tet meshing optimization level. More...
 
def  get_tetmesh_insert_mid_nodes ()
  Get the global flag indicating insertion of mid-edge (quadratic) nodes during tet meshing. More...
 
def  get_tetmesh_optimize_mid_nodes ()
  Get the global flag indicating optimization of mid-edge nodes during tet meshing. More...
 
def  get_tetmesh_optimize_overconstrained_tets ()
  Get the global flag indicating optimization of overconstrained tetrahedra. More...
 
def  get_tetmesh_optimize_overconstrained_edges ()
  Get the global flag indicating optimization of overconstrained edges. More...
 
def  get_tetmesh_minimize_slivers ()
  Get the global flag indicating minimization of sliver tetrahedra. More...
 
def  get_tetmesh_minimize_interior_points ()
  Get the global flag indicating minimization of interior points in tet meshing. More...
 
def  get_tetmesh_relax_surface_constraints ()
  Get the global flag indicating relaxation of surface mesh constraints in tet meshing. More...
 
def  get_mesh_geometry_approximation_angle (geometry_type, entity_id)
  Get the geometry approximation angle for TriMesh/TetMesh on a given entity. More...
 
def  get_trimesh_surface_gradation ()
  Retrieve the global surface mesh gradation for the TriMesh scheme. More...
 
def  get_trimesh_volume_gradation ()
  Retrieve the global volume mesh gradation for the TriMesh scheme. More...
 
def  get_trimesh_use_surface_proximity ()
  Retrieve the global surface proximity flag for the TriMesh scheme. More...
 
def  get_trimesh_surface_proximity_ratio ()
  Retrieve the global surface proximity ratio for the TriMesh scheme. More...
 
def  get_trimesh_target_min_size (geometry_type, entity_id)
  Retrieve the target minimum triangle size set on a specific geometry entity for the TriMesh scheme. More...
 
def  get_trimesh_geometry_sizing ()
  Retrieve the global geometry sizing flag for the TriMesh scheme. More...
 
def  get_trimesh_num_anisotropic_layers ()
  Retrieve the global number of anisotropic triangle layers for the TriMesh scheme. More...
 
def  get_trimesh_split_overconstrained_edges ()
  Retrieve the global flag for splitting overconstrained edges in the TriMesh scheme. More...
 
def  get_trimesh_tiny_edge_length ()
  Retrieve the global tiny edge length for the TriMesh scheme. More...
 
def  get_trimesh_ridge_angle ()
  Retrieve the global ridge angle for the TriMesh scheme. More...
 
def  get_node_constraint ()
  Query whether node constraint is enabled (move mid-nodes to geometry). More...
 
def  get_node_constraint_value ()
  Query the numeric value of the node constraint setting. More...
 
def  get_node_constraint_smart_threshold ()
  Query the current quality threshold for smart node constraint. More...
 
def  get_node_constraint_smart_metric ()
  Query the current quality metric for smart node constraint. More...
 
def  get_dbl_sculpt_default (variable)
  Retrieve the default value of a named sculpt parameter. More...
 
def  get_int_sculpt_default (variable)
  Retrieve default integer-valued sculpt parameter. More...
 
def  get_bool_sculpt_default (variable)
  Retrieve default boolean-valued sculpt parameter. More...
 
def  get_string_sculpt_default (variable)
  Retrieve default string-valued sculpt parameter. More...
 
Mesh Sizing Support
def  get_mesh_intervals (geometry_type, entity_id)
  Get the mesh interval count for a specified entity. More...
 
def  get_mesh_size (geometry_type, entity_id)
  Retrieve the effective target edge length for meshing an entity. More...
 
def  get_requested_mesh_size (geometry_type, id)
  Retrieve the mesh size explicitly set on a geometry entity. More...
 
def  has_valid_size (geometry_type, entity_id)
  Check whether a geometric entity has a valid size. More...
 
def  get_mesh_interval_firmness (geometry_type, entity_id)
  Retrieve the interval firmness for a specified geometry entity. More...
 
def  get_requested_mesh_interval_firmness (geometry_type, entity_id)
  Retrieve the explicitly requested interval firmness for a specified entity. More...
 
def  get_mesh_size_type (geometry_type, entity_id)
  Retrieve the mesh size setting type for a specified entity. More...
 
def  get_requested_mesh_size_type (geometry_type, entity_id)
  Retrieve the mesh size setting type explicitly requested on a specified entity. More...
 
def  auto_size_needs_to_be_calculated ()
  Check if automatic mesh sizing is outdated and needs recomputation. More...
 
def  get_default_auto_size ()
  Compute Cubit's heuristic default automatic mesh size for the current model. More...
 
def  get_requested_mesh_intervals (geometry_type, entity_id)
  Retrieve the mesh interval count explicitly set on a geometry entity. More...
 
def  is_interval_count_odd (surface_id)
  Check if any loop on a surface has an odd number of mesh intervals. More...
 
def  get_auto_size (geometry_type, entity_id_list, auto_factor)
  Predict the automatic mesh size for a set of entities. More...
 
def  get_element_budget (element_type, entity_id_list, auto_factor)
  Estimate the total element count for a set of volumes given size settings. More...
 
def  get_exodus_sizing_function_variable_name ()
  Retrieve the Exodus-based sizing function variable name. More...
 
def  get_exodus_sizing_function_file_name ()
  Retrieve the Exodus sizing function file name. More...
 
def  get_sizing_function_name (entity_type, entity_id)
  Retrieve the meshing sizing function type for a surface or volume. More...
 
def  exodus_sizing_function_file_exists ()
  Check if the Exodus sizing function file currently exists. More...
 
Mesh Query Support
def  is_meshed (geometry_type, entity_id)
  Determine whether a specified geometry entity has been meshed. More...
 
def  get_hex_count ()
  Retrieve the count of hexahedral elements in the current model. More...
 
def  get_pyramid_count ()
  Retrieve the count of pyramid elements in the current model. More...
 
def  get_tet_count ()
  Retrieve the count of tetrahedral elements in the current model. More...
 
def  get_quad_count ()
  Retrieve the count of quadrilateral elements in the current model. More...
 
def  get_tri_count ()
  Retrieve the count of triangular elements in the current model. More...
 
def  get_edge_count ()
  Retrieve the count of edges between surface elements in the current model. More...
 
def  get_sphere_count ()
  Retrieve the count of sphere elements in the current model. More...
 
def  get_wedge_count ()
  Retrieve the count of wedge-shaped elements in the current model. More...
 
def  get_node_count ()
  Retrieve the count of nodes in the current model. More...
 
def  get_element_count ()
  Retrieve the count of exportable elements in the current model. More...
 
def  get_volume_element_count (volume_id)
  Retrieve the count of 3D elements in a specified volume. More...
 
def  get_surface_element_count (surface_id)
  Retrieve the count of elements on a specified surface. More...
 
def  volume_contains_tets (volume_id)
  Determine whether a specified volume contains any tetrahedral elements. More...
 
def  get_hex_sheet (node_id_1, node_id_2)
  Retrieve the IDs of all hexahedral elements forming a hex sheet through two nodes. More...
 
def  get_mesh_edge_length (edge_id)
  Compute the length of a specified mesh edge. More...
 
def  get_meshed_volume_or_area (geometry_type, entity_ids)
  Sum mesh volumes or surface areas for CAD entities or mesh elements. More...
 
def  get_elem_quality_stats (entity_type, id_list, metric_name, single_threshold, use_low_threshold, low_threshold, high_threshold, make_group)
  Python-friendly version of get_quality_stats without reference parameters. More...
 
def  get_quality_stats_at_geometry (geom_type, mesh_type, geom_id_list, expand_levels, metric_name, single_threshold, use_low_threshold, low_threshold, high_threshold, make_group)
  Python-friendly version of get_quality_stats operating on geometry entities. More...
 
def  get_quality_value (mesh_type, mesh_id, metric_name)
  Retrieve a specific quality metric value for a single mesh element. More...
 
def  get_quality_values (mesh_type, mesh_ids, metric_name)
  Retrieve quality metric values for multiple mesh elements. More...
 
def  calculate_timestep_estimate (entity_type, entity_ids)
  Estimate the time step based on element sizes and material properties. More...
 
def  calculate_timestep_estimate_with_props (entity_type, entity_id_list, density, youngs_modulus, poissons_ratio)
  Estimate the stable time step using user-specified material properties. More...
 
def  get_target_timestep ()
  Return the current target time step threshold used in the density multiplier metric. More...
 
def  get_overconstrained_tets_in_volumes (volumes)
  Retrieve IDs of overconstrained tetrahedra within specified volumes. More...
 
def  best_edge_to_collapse_interior_node (node_id)
  Find the best edge to collapse to remove an interior node in a triangular mesh. More...
 
def  get_edges_to_swap (curve_id)
  Get edges on triangles at a knife-edge curve that are candidates for swapping. More...
 
def  get_n_largest_distances_between_meshes (n, entity_type1, ids1, entity_type2, ids2)
  Finds the N largest node-to-element distances between two meshes. More...
 
Geometry Topology Support
def  get_entities (entity_type)
  Retrieve IDs of all current entities of a specified type (geometry and mesh). More...
 
def  get_current_ids (entity_type)
  Retrieve IDs of all current geometry entities of a specified type. More...
 
def  get_body_count ()
  Get the current number of bodies in the model. More...
 
def  get_volume_count ()
  Get the current number of volumes in the model. More...
 
def  get_surface_count ()
  Get the current number of surfaces in the model. More...
 
def  get_curve_count ()
  Get the current number of curves in the model. More...
 
def  get_vertex_count ()
  Get the current number of vertices in the model. More...
 
def  get_curve_count_in_volumes (target_volume_ids)
  Get the current number of curves in the specified volumes. More...
 
def  get_relatives (source_geometry_type, source_id, target_geom_type)
  Get the relatives (parents or children) of a specified entity. More...
 
def  are_adjacent_surfaces (surface_ids)
  Return whether two or more surfaces share at least one manifold curve. More...
 
def  are_adjacent_curves (curve_ids)
  Return whether two or more curves share at least one manifold vertex. More...
 
def  get_adjacent_surfaces (geometry_type, entity_id)
  Get a list of surfaces adjacent to a specified surface (including the surface itself). More...
 
def  get_adjacent_volumes (geometry_type, entity_id)
  Get a list of adjacent volumes to a specified entity. More...
 
def  get_num_volume_shells (volume_id)
  Get the number of shells in a volume. More...
 
def  get_valence (vertex_id)
  Get the valence (number of incident edges) for a specific vertex. More...
 
def  get_list_of_free_ref_entities (geometry_type)
  Get all free (unattached) entities of a given geometry type. More...
 
def  get_owning_body (geometry_type, entity_id)
  Get the owning body for a specified entity. More...
 
def  get_owning_volume (geometry_type, entity_id)
  Get the owning volume for a specified entity. More...
 
def  get_owning_volume_by_name (entity_name)
  Get the owning volume for an entity by its name. More...
 
def  get_common_curve_id (surface_1_id, surface_2_id)
  Return a curve shared by two surfaces. More...
 
def  get_common_vertex_id (curve_1_id, curve_2_id)
  Return a vertex shared by two curves. More...
 
def  get_connected_surfaces (surf_ids)
  Find surfaces connected to a given set of surfaces. More...
 
def  gather_surfaces_by_orientation (seed_surf_ids, all_surf_ids)
  Gathers surfaces connected across shared edges, forming a surface enclosure. More...
 
Geometry Attribute Support
def  is_visible (geometry_type, entity_id)
  Query visibility for a specific geometry entity. More...
 
def  is_virtual (geometry_type, entity_id)
  Query whether a specified geometry entity is virtual. More...
 
def  contains_virtual (geometry_type, entity_id)
  Query whether any child entities of a specified geometry entity are virtual. More...
 
def  is_merged (geometry_type, entity_id)
  Check if a specified geometry entity has been merged into another. More...
 
def  get_merge_setting (geometry_type, entity_id)
  Get merge mode ("on", "off", or "auto") for a given entity. More...
 
def  get_source_surfaces (volume_id)
  Retrieve the list of sweep source surfaces for a specified volume. More...
 
def  get_target_surfaces (volume_id)
  Retrieve the list of sweep target surfaces for a specified volume. More...
 
def  get_entity_modeler_engine (geometry_type, entity_id)
  Get the modeler engine type for a specified entity. More...
 
def  get_entity_name (entity_type, entity_id, no_default=False)
  Get the name of a specified entity. More...
 
def  get_entity_names (entity_type, entity_id, no_default=False, first_name_only=False)
  Get all names associated with a specified entity. More...
 
def  set_entity_name (entity_type, entity_id, new_name)
  Set the name of a specified entity. More...
 
def  get_id_from_name (name)
  Retrieve the integer ID of an entity by its name. More...
 
def  get_all_ids_from_name (geo_type, name)
  Retrieve all IDs of entities of a specified geometry type whose names start with a given prefix. More...
 
def  get_entity_color (entity_type, entity_id)
  Get the color of a specified entity. More...
 
def  get_entity_color_index (entity_type, entity_id)
  Get the color index of a specified entity. More...
 
def  is_multi_volume (body_id)
  Check if a body contains multiple volumes. More...
 
def  is_sheet_body (volume_id)
  Determine if a volume is a sheet body (zero thickness). More...
 
Geometry Query Support
def  get_vertex_coordinates (entityID)
  Get the 3D coordinates of a vertex. More...
 
def  get_distance_between (vertex_id_1, vertex_id_2)
  Get the Euclidean distance between two vertices. More...
 
def  get_curve_type (curve_id)
  Get the curve type for a specified curve. More...
 
def  get_curve_length (curve_id)
  Get the 3D length of a specified curve. More...
 
def  get_arc_length (curve_id)
  Get the parametric (arc) length of a specified curve. More...
 
def  get_distance_from_curve_start (x_coordinate, y_coordinate, z_coordinate, curve_id)
  Get the distance along a curve from its start to the closest point on the curve. More...
 
def  get_curve_radius (curve_id)
  Compute the radius of a specified curve. More...
 
def  get_curve_center (curve_id)
  Retrieve the center point of a specified curve. More...
 
def  get_arc_center_radius (curve_id)
  Get the center point and radius of a specified arc curve. More...
 
def  evaluate_exterior_angle_at_curve (curve_id, volume_id)
  Return the exterior angle at a single curve with respect to a volume. More...
 
def  evaluate_exterior_angle (curve_list, test_angle)
  Find curves whose exterior angle between adjacent surfaces is less than a given threshold. More...
 
def  get_similar_curves (curve_ids, tol=1e-3, use_percent_tol=True, on_similar_vols=True)
  Find curves with lengths similar to a given curve. More...
 
def  get_surface_type (surface_id)
  Get the surface type for a specified surface. More...
 
def  get_surface_normal (surface_id)
  Get the unit normal vector at the center of a specified surface. More...
 
def  get_surface_normal_at_coord (surface_id, coord)
  Get the unit normal vector at a specified point on a surface. More...
 
def  get_surface_centroid (surface_id)
  Get the approximate centroid of a specified surface based on graphics faceting. More...
 
def  get_surface_sense (surface_id)
  Get the orientation ("sense") of a specified surface. More...
 
def  is_surface_planer (surface_id)
  Query whether a specified surface is planar. More...
 
def  is_surface_planar (surface_id)
 
def  get_surface_area (surface_id)
  Get the area of a specified surface. More...
 
def  get_hydraulic_radius_surface_area (surface_id)
  Compute the hydraulic radius of a specified surface. More...
 
def  get_surface_principal_curvatures (surface_id)
  Get the principal curvatures of a surface at its midpoint. More...
 
def  evaluate_surface_angle_at_vertex (surf_id, vert_id)
  Return the interior angle at a vertex on a specified surface. More...
 
def  project_unit_square (pts, surface_id, quad_id, node00_id, node10_id)
  Map points in a unit square (u-v coordinates on a quad face) and project them onto a surface. More...
 
def  get_similar_surfaces (surface_ids, tol=1e-3, use_percent_tol=True, on_similar_vols=True)
  Find surfaces with similar area and curve count to given surfaces. More...
 
def  print_surface_summary_stats ()
  Print summary statistics for all surfaces in the model. More...
 
def  get_volume_area (volume_id)
  Get the total surface area of a specified volume. More...
 
def  get_volume_volume (vol_id)
  Get the enclosed volume of a specified volume. More...
 
def  get_hydraulic_radius_volume_area (volume_id)
  Compute the hydraulic radius of a specified volume. More...
 
def  get_similar_volumes (volume_ids, tol=1e-3, use_percent_tol=True)
  Find volumes with similar size and face count to given volumes. More...
 
def  get_bounding_box (geometry_type, entity_id)
  Get the axis-aligned bounding box for a specified entity. More...
 
def  get_total_bounding_box (geometry_type, entity_list)
  Get the combined bounding box for a list of entities. More...
 
def  get_tight_bounding_box (geometry_type, entity_list)
  Get the tight bounding box for a list of entities. More...
 
def  get_total_volume (volume_list)
  Get the total volume for a list of volumes. More...
 
def  print_volume_summary_stats ()
  Print summary statistics for all volumes in the model. More...
 
def  get_center_point (entity_type, entity_id)
  Get the 3D center or coordinates of a specified entity. More...
 
def  is_periodic (geometry_type, entity_id)
  Query whether a specified surface or curve is periodic. More...
 
def  get_geometry_type (geom_type, ent_ids)
  Return the analytic geometry type for a list of surfaces or curves. More...
 
def  get_distance_between_entities (geom_type_1, entity_id_1, geom_type_2, entity_id_2)
  Get the minimum distance between two geometry entities. More...
 
def  is_point_contained (geometry_type, entity_id, xyz_point)
  Determine if a point is inside, outside, on, or unknown relative to a given entity. More...
 
def  snap_locations_to_geometry (locations, entity_type, entity_id, tol)
  Snaps given XYZ locations to nearest points on specified entity. More...
 
def  measure_between_entities (entity_type1, entity_id1, entity_type2, entity_id2)
  Returns the shortest distance between two geometry entities and their closest points. More...
 
def  get_coordinate_systems_id_list ()
  Returns a list of coordinate system IDs. More...
 
Geometry-Mesh Entity Support
def  get_geometry_node_count (entity_type, entity_id)
  Get the number of mesh nodes on a geometric entity. More...
 
def  get_vertex_node (vertex_id)
  Get the node ID owned by a vertex. More...
 
def  get_curve_nodes (curve_id)
  Get the list of node IDs owned by a curve. More...
 
def  get_curve_edges (curve_id)
  Get the list of edge element IDs on a curve. More...
 
def  get_surface_nodes (surface_id)
  Get the list of node IDs owned by a surface. More...
 
def  get_surface_quads (surface_id)
  Get the list of quadrilateral (quad) element IDs on a surface. More...
 
def  get_surface_tris (surface_id)
  Get the list of triangle (tri) element IDs on a surface. More...
 
def  get_volume_nodes (volume_id)
  Get the list of node IDs owned by a volume. More...
 
def  get_volume_hexes (volume_id)
  Get the list of hexahedron (hex) IDs contained in a volume. More...
 
def  get_volume_tets (volume_id)
  Get the list of tetrahedron (tet) IDs contained in a volume. More...
 
def  get_volume_wedges (volume_id)
  Get the list of wedge IDs contained in a volume. More...
 
def  get_volume_pyramids (volume_id)
  Get the list of pyramid IDs contained in a volume. More...
 
def  get_surface_num_loops (surface_id)
  Get the number of loops on a surface. More...
 
def  get_surface_loop_nodes (surface_id)
  Get the ordered list of node IDs on the loops of a surface. More...
 
def  get_entity_sense (source_type, source_id, sideset_id)
  Get the sense of an entity in a sideset. More...
 
def  get_wrt_entity (source_type, source_id, sideset_id)
  Get the 'with-respect-to' entity of an item in a sideset. More...
 
def  get_geometric_owner (mesh_entity_type, mesh_entity_list)
  Get geometric owners for a set of mesh entities. More...
 
def  get_geometry_owner (entity_type, entity_id)
  Get the geometric owner of a mesh element. More...
 
def  get_all_geometric_owners (mesh_entity_type, mesh_entity_list)
  Get the list of geometric owners for a set of mesh entities and their child entities. More...
 
Mesh Element Queries
def  get_connectivity (entity_type, entity_id)
  Get the list of node IDs comprising a mesh element. More...
 
def  get_expanded_connectivity (entity_type, entity_id)
  Get the list of node IDs for a mesh element, including interior nodes. More...
 
def  get_sub_elements (entity_type, entity_id, dimension)
  Get the lower-dimensional entities of a higher-dimensional mesh element. More...
 
def  get_node_exists (node_id)
  Check whether a node exists in the model. More...
 
def  get_exodus_id (entity_type, entity_id)
  Get the Global Element ID for a mesh entity. More...
 
def  get_element_exists (element_id)
  Check whether a global mesh element ID exists in the model. More...
 
def  get_element_type (element_id)
  Get the specific mesh element type for a global element ID. More...
 
def  get_element_type_id (element_id)
  Map a Global Element ID back to its local mesh entity ID. More...
 
def  get_element_block (element_id)
  Get the block ID containing a given global element. More...
 
def  get_global_element_id (element_type, id)
  Alias for get_exodus_id: get the Global Element ID for a local mesh entity. More...
 
def  get_hex_global_element_id (hex_id)
  Get the Global Element ID for a specific hexahedral element. More...
 
def  get_tet_global_element_id (tet_id)
  Get the Global Element ID for a specific tetrahedral element. More...
 
def  get_wedge_global_element_id (wedge_id)
  Get the Global Element ID for a specific wedge element. More...
 
def  get_pyramid_global_element_id (pyramid_id)
  Get the Global Element ID for a specific pyramid element. More...
 
def  get_tri_global_element_id (tri_id)
  Get the Global Element ID for a specific triangular element. More...
 
def  get_quad_global_element_id (quad_id)
  Get the Global Element ID for a specific quadrilateral element. More...
 
def  get_edge_global_element_id (edge_id)
  Get the Global Element ID for a specific edge element. More...
 
def  get_sphere_global_element_id (sphere_id)
  Get the Global Element ID for a specific node (SPHERE element). More...
 
def  get_node_global_id (node_id)
  Get the global node ID assigned in the Exodus file for a mesh node. More...
 
def  get_closest_node (x_coordinate, y_coordinate, z_coordinate)
  Find the mesh node closest to a given point. More...
 
def  get_nodal_coordinates (node_id)
  Get the coordinates of a mesh node. More...
 
def  get_node_faces (node_id)
  Get the IDs of all quadrilateral elements (faces) adjacent to a node. More...
 
def  get_node_tris (node_id)
  Get the IDs of all triangular elements adjacent to a node. More...
 
def  get_node_edges (node_id)
  Get the IDs of all edge elements adjacent to a node. More...
 
def  get_node_position_fixed (node_id)
  Query whether a mesh node is fixed (constrained against smoothing). More...
 
def  get_mesh_element_type (entity_type, entity_id)
  Get the mesh element type applied to a geometric entity. More...
 
Geometry Defeaturing Support
def  get_small_curves (target_volume_ids, mesh_size)
  Find curves with edge length below a threshold within given volumes. More...
 
def  get_smallest_curves (target_volume_ids, number_to_return)
  Return IDs of the smallest curves in the specified volumes. More...
 
def  get_small_surfaces (target_volume_ids, area_threshold)
  Find surfaces with area below a given threshold. More...
 
def  get_small_surfaces_HR (target_volume_ids, mesh_size)
  Python-callable version: identify small hydraulic-radius surfaces. More...
 
def  is_narrow_surface (surface_id, mesh_size)
  Determine if any two non-adjacent edges on the surface form a narrow region. More...
 
def  get_narrow_surfaces (target_volume_ids, mesh_size)
  Find surfaces with narrow regions in specified volumes. More...
 
def  get_small_and_narrow_surfaces (target_ids, small_area, small_curve_size)
  Find surfaces that are either small in area or contain narrow regions. More...
 
def  get_closed_narrow_surfaces (target_ids, narrow_size)
  Find faces on closed surfaces whose two boundary edges remain within a distance threshold. More...
 
def  get_narrow_regions (target_ids, narrow_size)
  Find faces containing narrow regions within specified volumes. More...
 
def  get_surfs_with_narrow_regions (target_ids, narrow_size)
  Find surfaces with narrow regions based on edge-pair orientation and proximity. More...
 
def  is_close_loop_surface (surface_id, mesh_size)
  Check if a surface has multiple loops closer than a given threshold. More...
 
def  get_close_loops (target_volume_ids, mesh_size)
  Find faces with multiple loops closer than a given threshold. More...
 
def  get_close_loops_with_thickness (target_volume_ids, mesh_size, genus)
  Find faces with multiple loops closer than a threshold and return their minimum loop separations. More...
 
def  get_close_loop_thickness (surface_id)
  Compute the minimum separation distance between loops on a surface. More...
 
def  get_small_volumes (target_volume_ids, mesh_size)
  Find volumes whose size is below a threshold based on mesh size. More...
 
def  is_chamfer_surface (surface_id, thickness_threshold)
  Determine if a face's underlying surface is a chamfer. More...
 
def  get_chamfer_surfaces (target_volume_ids, thickness_threshold)
  Get the list of chamfer surfaces for a list of volumes. More...
 
def  get_chamfer_chains (surface_id)
  Returns the chamfer chains for a given surface. More...
 
def  get_chamfer_chain_collections (volume_list, thickness_threshold)
  Return collections of surfaces that form chamfer chains in the specified volumes. More...
 
def  is_cylinder_surface (surface_id)
  Determine if a given face's underlying surface is a circular cylinder. More...
 
def  is_blend_surface (surface_id)
  Determine if a face's underlying surface is a blend (fillet). More...
 
def  get_blend_surfaces (target_volume_ids)
  Find blend (fillet) surfaces within specified volumes. More...
 
def  get_small_radius_blend_surfaces (target_volume_ids, max_radius)
  Find blend surfaces with radius of curvature <= max_radius. More...
 
def  get_blend_chains (surface_id)
  Returns the blend chains for a given surface. More...
 
def  get_blend_chain_collections (volume_list, radius_threshold)
  Return collections of surfaces that form blend chains in the specified volumes. More...
 
def  is_cone_surface (surface_id)
  Determine whether a surface is a cone. More...
 
def  find_cone_surfaces (surface_id)
  Identify cone surface(s) starting from a candidate surface. More...
 
def  get_cone_surfaces (target_volume_ids)
  Identify cone surfaces in a set of volumes. More...
 
def  get_surface_cone_collections (volume_list, radius_threshold=0.0)
  Identify collections of surfaces that comprise cones in specified volumes. More...
 
def  is_cavity_surface (surface_id)
  Return whether the specified surface is part of a cavity. More...
 
def  get_cavity_surfaces (surface_id)
  Return the surfaces in the cavity adjacent to the specified surface. More...
 
def  get_surface_cavity_collections (volume_list, area_threshold=-1, angle_tolerance=-1, combine_cavities=True)
  Return collections of surfaces that form cavities in the specified volumes. More...
 
def  is_hole_surface (surface_id, radius_threshold)
  Return whether the specified surface is part of a hole. More...
 
def  get_hole_surfaces (surface_id)
  Return the surfaces in the hole adjacent to the specified surface. More...
 
def  get_surface_hole_collections (volume_list, radius_threshold)
  Return collections of surfaces that form holes in the specified volumes. More...
 
def  is_continuous_surface (surface_id, angle_tol)
  Return whether the surface has any adjacent continuous surfaces. More...
 
def  get_continuous_surfaces (surface_id, angle_tol)
  Return the list of adjacent continuous surfaces. More...
 
def  get_continuous_curves (curve_id, angle_tol, require_two_valent=False)
  Return the list of adjacent continuous curves. More...
 
def  get_continuous_curve_collections (volume_list, angle_tolerance=-1)
  Returns collections of continuous curves in the given volumes. More...
 
def  get_sharp_angle_vertices (target_volume_ids, upper_bound, lower_bound)
  Identify vertices at sharp curve angles in a set of volumes. More...
 
def  get_blunt_tangency_default_depth (vert_id, angle, add_material)
  Computes the default depth used to blunt a tangency at a vertex. More...
 
def  get_tangential_intersections (target_volume_ids, upper_bound, lower_bound)
  Find surfaces with tangential intersection angles outside specified bounds. More...
 
def  get_coincident_vertices (target_volume_ids, high_tolerance)
  Find vertex pairs within a specified tolerance across given volumes. More...
 
def  get_close_vertex_curve_pairs (target_volume_ids, high_tolerance)
  Find pairs of vertices and curves within a specified tolerance across given volumes. More...
 
def  get_overlapping_surfaces_in_bodies (body_ids, filter_slivers=False)
  Identify overlapping surfaces between different volumes in a set of bodies. More...
 
def  find_overlapping_curves (curve_ids)
  Identify overlapping curves in a specified list of curves. More...
 
def  get_gaps_between_volumes (target_volume_ids, maximum_gap_tolerance, maximum_gap_angle, cache_overlaps=0)
  Identify gaps between surfaces in a list of volumes. More...
 
def  get_overlapping_volumes (target_volume_ids)
  Identify overlapping volumes in a list of volumes. More...
 
def  get_overlapping_volumes_at_volume (volume_id, compare_volumes)
  Identify volumes in the model that overlap a single target volume. More...
 
def  get_overlapping_surfaces_at_surface (surface_id, compare_volumes, cache_overlaps=0)
  Identify surfaces in the model that overlap a single target surface. More...
 
def  get_overlap_max_gap ()
  Get the current maximum gap tolerance used for calculating surface overlaps. More...
 
def  set_overlap_max_gap (maximum_gap)
  Set the maximum gap tolerance for calculating surface overlaps. More...
 
def  get_overlap_min_gap ()
  Get the current minimum gap tolerance used for calculating surface overlaps. More...
 
def  set_overlap_min_gap (min_gap)
  Set the minimum gap tolerance for calculating surface overlaps. More...
 
def  get_overlap_max_angle ()
  Get the current maximum angle tolerance used for calculating surface overlaps. More...
 
def  set_overlap_max_angle (maximum_angle)
  Set the maximum angle tolerance for calculating surface overlaps. More...
 
def  get_nearby_entities (gtype, ent_ids, compare_ents, distance)
  Identify nearby entities of type curve, surface, or volume for a given list of the same type. More...
 
def  get_nearby_volumes_at_volume (volume_id, compare_volumes, distances, progress=None)
  Identify nearby volumes in the model for a list of target volumes. More...
 
def  get_unmerged_curves_on_shells (shell_vols, thickness)
  Identify unmerged curves between sheet (shell) volumes for use in shell construction workflows. More...
 
def  get_mergeable_vertices (target_volume_ids)
  Get the list of mergeable vertices from a list of volumes or bodies. More...
 
def  get_mergeable_curves (target_volume_ids)
  Get the list of mergeable curves from a list of volumes or bodies. More...
 
def  get_mergeable_surfaces (target_volume_ids)
  Get the list of mergeable surfaces from a list of volumes or bodies. More...
 
def  get_merge_tolerance ()
  Return the current merge tolerance value. More...
 
Geometry ITEM Solutions
def  get_solutions_for_close_loop (surface_id, mesh_size)
  Retrieve recommended remedies for a close-loop surface to resolve narrow regions. More...
 
def  get_solutions_for_near_coincident_vertices (vertex_id_1, vertex_id_2)
  Provide remedies for two nearly coincident vertices on different volumes to resolve gaps or misalignments. More...
 
def  get_solutions_for_bad_geometry (geom_type, geom_id)
  Provide remedy for bad geometry via ACIS healing (deprecated). More...
 
def  get_solutions_for_overlapping_volumes (volume_id_1, volume_id_2, maximum_gap_tolerance, maximum_gap_angle)
  Provide remedies for two overlapping volumes based on gap and angular tolerances. More...
 
def  get_solutions_for_overlapping_surfaces (surface_id_1, surface_id_2)
  Suggests remedies for two overlapping surfaces on different volumes. More...
 
def  get_volume_gap_solutions (surface_id_1, surface_id_2)
  Suggests remedies for a gap between two surfaces on different volumes. More...
 
def  get_solutions_for_near_coincident_vertex_and_curve (vertex_id, curve_id)
  Suggests remedies when a vertex lies nearly on a curve from a different volume. More...
 
def  get_solutions_for_near_coincident_vertex_and_surface (vertex_id, surface_id)
  Suggests remedies when a vertex lies nearly on a surface from a different volume. More...
 
def  get_solutions_for_imprint_merge (surface_id1, surface_id2)
  Suggests remedies for imprint/merge when two overlapping surfaces are on different volumes. More...
 
def  get_solutions_for_volumes (vol_id, small_curve_size, mesh_size)
  Recommend remediation operations for volumes with features below a size threshold. More...
 
def  get_solutions_for_classified_volume (classification, vol_id)
  Suggests geometry fixes or feature operations for a volume based on its classification. More...
 
def  get_solutions_for_bolt (bolt_id, insert_id, threaded_vol_id)
  Suggests operations for a volume classified as a bolt using known subcomponent IDs. More...
 
def  get_solutions_for_bolt_hole (bearing_hole, threaded_holes)
  Suggests repair or modification options for a set of concentric fastener pilot holes. More...
 
def  get_solutions_for_classified_surface (classification, surf_id)
  Suggests remedies or modifications for a classified surface. More...
 
def  get_solutions_for_thin_volume (vol_id, near_vols, include_weights=False, include_type=False)
  Generate candidate operations to reduce a thin volume into a sheet body. More...
 
def  get_solutions_for_sheet_volumes (vol_ids, thickness)
  Propose surface-extension and imprint/merge operations to connect sheet bodies. More...
 
def  get_solutions_for_sheet_volume_connection (args, kwargs)
  Propose surface-tweak, imprint, and merge operations to bridge two sheet-volume sets. More...
 
def  get_solutions_for_small_surfaces (surface_id, small_curve_size, mesh_size)
  Recommend remedial operations on a surface already flagged as small. More...
 
def  get_solutions_for_small_curves (curve_id, small_curve_size, mesh_size)
  Recommend remedial operations on a curve already flagged as small. More...
 
def  get_solutions_for_sharp_angle_vertex (vertex_id, small_curve_size, mesh_size)
  Retrieve recommended remedies for a sharp angle at a vertex. More...
 
def  get_solutions_for_surfaces_with_narrow_regions (surface_id, small_curve_size, mesh_size)
  Recommend operations to eliminate narrow regions on a surface identified as narrow. More...
 
def  get_solutions_for_cone_surface (surface_id)
  Suggests remedies for a surface classified as a cone. More...
 
def  get_solutions_for_decomposition (volume_list, exterior_angle, do_imprint_merge, tolerant_imprint)
  Provide possible decomposition solutions for volumes based on exterior angle criteria. More...
 
def  get_solutions_for_blends (surface_id)
  Provide possible blend removal solutions for a given surface (and its blend chain if applicable). More...
 
def  get_solutions_for_cavity_surface (surface_id)
  Provide possible cavity removal or adjustment solutions for a given surface (and its cavity if applicable). More...
 
def  get_mesh_error_solutions (error_code)
  Retrieve recommended solutions and context cues for a mesh error. More...
 
Geometry Idealization Support
def  get_reduce_bolt_core_default_dimensions (vol_id)
  Computes default core dimensions for a bolt volume in reduce bolt core operation. More...
 
def  get_bolt_diameters (vol_ids)
  Get the shank diameters of specified bolt volumes. More...
 
def  get_bolt_axis (vol_id)
  Get the normalized axis vector of a bolt volume. More...
 
def  get_bolt_shigley_radius (bolt_id, angle, washer_id=0)
  Get the equivalent Shigley frustum radius at the bolt interface. More...
 
def  get_bolt_washer (bolt_id)
  Get the washer volume ID associated with a given bolt. More...
 
def  get_bolt_coordinate_system (geom_type, id)
  Get local coordinate system for a bolt or bolt hole. More...
 
def  get_bolt_clamped_members (vol_ids, nearby_vols, progress=None)
  Identify clamped members associated with a bolt. More...
 
def  get_bolts_in_clamped_members (geo_type, clamped_vols, candidate_bolts)
  Identify bolts clamping the given volumes or blocks. More...
 
def  get_bolt_holes_info (geo_type, clamped_members, radius_threshold, gap_threshold)
  Identify concentric pilot holes across clamped members. More...
 
def  get_bolt_holes (geo_type, clamped_members, radius_threshold, gap_threshold)
  Identify upper and lower pilot hole surfaces from clamped members. More...
 
def  get_2D_sheet_volumes (vol_id)
  Get associated 2D sheet volumes from a reduced 3D thin volume. More...
 
def  get_3D_thin_volume (vol_id)
  Get the original 3D thin volume associated with a 2D sheet volume. More...
 
Blocks, Sidesets, and Nodesets
def  get_block_count ()
  Get the current number of element blocks in the model. More...
 
def  get_block_id (entity_type, entity_id)
  Get the element block ID associated with a geometric entity. More...
 
def  get_block_ids (mesh_geometry_file_name)
  Get list of block IDs from a mesh geometry file. More...
 
def  get_block_id_list ()
  Get a list of all active block IDs. More...
 
def  get_next_block_id ()
  Get the next available block ID. More...
 
def  get_block_volumes (block_id)
  Get the list of volume IDs contained in a block. More...
 
def  get_block_surfaces (block_id)
  Get the list of surface IDs contained in a block. More...
 
def  get_block_curves (block_id)
  Get the list of curve IDs contained in a block. More...
 
def  get_block_vertices (block_id)
  Get the list of vertex IDs contained in a block. More...
 
def  get_block_nodes (block_id)
  Get the list of node IDs contained in a block. More...
 
def  get_block_edges (block_id)
  Get the list of edge IDs contained in a block. More...
 
def  get_block_tris (block_id)
  Get the list of triangle (tri) IDs contained in a block. More...
 
def  get_block_faces (block_id)
  Get the list of face IDs contained in a block. More...
 
def  get_block_pyramids (block_id)
  Get the list of pyramid IDs contained in a block. More...
 
def  get_block_wedges (block_id)
  Get the list of wedge IDs contained in a block. More...
 
def  get_block_tets (block_id)
  Get the list of tetrahedron (tet) IDs contained in a block. More...
 
def  get_block_hexes (block_id)
  Get the list of hexahedron (hex) IDs contained in a block. More...
 
def  get_block_element_type (block_id)
  Get the element type associated with a block. More...
 
def  get_block_attribute_count (block_id)
  Get the number of attributes assigned to a block. More...
 
def  get_block_element_attribute_count (block_id)
  Get the number of attributes defined for elements in the specified block. More...
 
def  get_block_attribute_value (block_id, attribute_index)
  Get the value of a specific attribute for a block. More...
 
def  get_block_attribute_name (block_id, attribute_index)
  Get the name of a specific attribute for a block. More...
 
def  get_block_element_attribute_names (block_id)
  Get the list of attribute names associated with block elements. More...
 
def  get_valid_block_element_types (block_id)
  Get a list of valid element types for the specified block. More...
 
def  get_block_material (block_id)
  Get the ID of the material assigned to the specified block. More...
 
def  get_blocks_with_materials ()
  Get all block IDs and their associated material IDs. More...
 
def  get_sideset_count ()
  Get the current number of sidesets in the model. More...
 
def  get_sideset_id_list ()
  Get a list of all active sideset IDs. More...
 
def  get_next_sideset_id ()
  Get the next available sideset ID. More...
 
def  get_sideset_curves (sideset_id)
  Get the list of curve IDs associated with a sideset. More...
 
def  get_sideset_edges (sideset_id)
  Get the list of edge IDs contained in a sideset. More...
 
def  get_sideset_surfaces (sideset_id)
  Get the list of surface IDs contained in a sideset. More...
 
def  get_sideset_quads (sideset_id)
  Get the list of quadrilateral (quad) element IDs contained in a sideset. More...
 
def  get_sideset_tris (sideset_id)
  Get the list of triangle (tri) element IDs contained in a sideset. More...
 
def  get_sideset_area (sideset_id)
  Get the total area of a sideset. More...
 
def  get_sideset_element_type (sideset_id)
  Get the element type of a sideset. More...
 
def  get_nodeset_count ()
  Get the current number of nodesets in the model. More...
 
def  get_nodeset_id_list ()
  Get a list of all active nodeset IDs. More...
 
def  get_next_nodeset_id ()
  Get the next available nodeset ID. More...
 
def  get_nodeset_volumes (nodeset_id)
  Get the list of volume IDs associated with a nodeset. More...
 
def  get_nodeset_surfaces (nodeset_id)
  Get the list of surface IDs associated with a nodeset. More...
 
def  get_nodeset_curves (nodeset_id)
  Get the list of curve IDs associated with a nodeset. More...
 
def  get_nodeset_vertices (nodeset_id)
  Get the list of vertex IDs associated with a nodeset. More...
 
def  get_nodeset_nodes (nodeset_id)
  Get the list of node IDs explicitly assigned to a nodeset. More...
 
def  get_nodeset_nodes_inclusive (nodeset_id)
  Get the list of node IDs associated with a nodeset (inclusive). More...
 
def  get_nodeset_node_count (nodeset_id)
  Get the number of nodes in a nodeset. More...
 
def  get_exodus_element_count (entity_id, entity_type)
  Get the number of elements in a Exodus entity. More...
 
def  get_exodus_entity_name (entity_type, entity_id)
  Get the name of an Exodus entity. More...
 
def  get_exodus_entity_type (entity_type, entity_id)
  Get the Exodus type of an entity. More...
 
def  get_exodus_entity_description (entity_type, entity_id)
  Get the description of an Exodus entity. More...
 
def  get_all_exodus_times (filename)
  Get all available time steps from an Exodus file. More...
 
def  get_exodus_variable_names (container_type, container_id)
  Get the names of Exodus variables in a nodeset, sideset, or block. More...
 
def  get_all_exodus_variable_names (filename, variable_type)
  Get all variable names of a given type from an Exodus file. More...
 
def  get_exodus_variable_count (container_type, container_id)
  Get the number of Exodus variables in a nodeset, sideset, or block. More...
 
def  get_copy_nodeset_on_geometry_copy_setting ()
  Get the current nodeset behavior setting for geometry copy. More...
 
def  get_copy_sideset_on_geometry_copy_setting ()
  Get the current sideset behavior setting for geometry copy. More...
 
def  get_copy_block_on_geometry_copy_setting ()
  Get the current block behavior setting for geometry copy. More...
 
def  set_copy_nodeset_on_geometry_copy_setting (val)
  Set the behavior for nodeset propagation during geometry copy. More...
 
def  set_copy_sideset_on_geometry_copy_setting (val)
  Set the behavior for sideset propagation during geometry copy. More...
 
def  set_copy_block_on_geometry_copy_setting (val)
  Set the behavior for block propagation during geometry copy. More...
 
Group Support
def  get_group_groups (group_id)
  Retrieve direct child group IDs for a specified parent group, if any. More...
 
def  get_group_volumes (group_id)
  Return direct child volume IDs for a specified group, if any. More...
 
def  get_group_bodies (group_id)
  Return direct child body IDs for a specified group, if any. More...
 
def  get_group_surfaces (group_id)
  Return direct child surface IDs for a specified group, if any. More...
 
def  get_group_curves (group_id)
  Return direct child curve IDs for a specified group, if any. More...
 
def  get_group_vertices (group_id)
  Return direct child vertex IDs for a specified group, if any. More...
 
def  get_group_nodes (group_id)
  Return direct child node IDs for a specified group, if any. More...
 
def  get_group_edges (group_id)
  Return direct child edge IDs for a specified group, if any. More...
 
def  get_group_quads (group_id)
  Return direct child quad IDs for a specified group, if any. More...
 
def  get_group_tris (group_id)
  Return direct child triangle IDs for a specified group, if any. More...
 
def  get_group_tets (group_id)
  Return direct child tetrahedron IDs for a specified group, if any. More...
 
def  get_group_wedges (group_id)
  Return direct child wedge element IDs for a specified group, if any. More...
 
def  get_group_pyramids (group_id)
  Return direct child pyramid element IDs for a specified group, if any. More...
 
def  get_group_spheres (group_id)
  Return direct child sphere element IDs for a specified group, if any. More...
 
def  get_group_hexes (group_id)
  Return direct child hexahedral element IDs for a specified group, if any. More...
 
def  get_next_group_id ()
  Return the next available group ID from Cubit. More...
 
def  delete_all_groups ()
  Remove all groups from the current Cubit session. More...
 
def  delete_group (group_id)
  Delete a specific group by ID. More...
 
def  set_max_group_id (maximum_group_id)
  Reset Cubit's internal maximum group ID to a specified value. More...
 
def  create_new_group ()
  Create a new, empty group and return its ID. More...
 
def  remove_entity_from_group (group_id, entity_id, entity_type)
  Remove a specific entity from a given group. More...
 
def  add_entity_to_group (group_id, entity_id, entity_type)
  Add a specific entity to a given group. More...
 
def  add_entities_to_group (group_id, entity_ids, entity_type)
  Add a list of entities to a specified group. More...
 
def  group_names_ids ()
  Retrieve names and IDs of all defined groups (excluding the pick group). More...
 
def  get_mesh_group_parent_ids (element_type, element_id)
  Retrieve parent group IDs for a specific mesh element. More...
 
def  is_mesh_element_in_group (element_type, element_id)
  Check if a specific mesh element belongs to any group. More...
 
Metadata Support
def  get_assembly_classification_level ()
  Get classification level metadata. More...
 
def  get_assembly_classification_category ()
  Get classification category metadata. More...
 
def  get_assembly_weapons_category ()
  Get weapons category metadata. More...
 
def  get_assembly_metadata (volume_id, data_type)
  Get metadata for a specified volume. More...
 
def  is_assembly_metadata_attached (volume_id)
  Check if metadata is attached to a volume. More...
 
def  get_assembly_name (assembly_id)
  Get the name of an assembly node. More...
 
def  get_assembly_path (assembly_id)
  Get the full path of an assembly node, identifying its hierarchy. More...
 
def  get_assembly_type (assembly_id)
  Get the type of an assembly node ("part" or "assembly"). More...
 
def  get_parent_assembly_path (assembly_id)
  Get the path of an assembly node's parent. More...
 
def  get_assembly_level (assembly_id)
  Get the hierarchy level of an assembly node. More...
 
def  get_assembly_description (assembly_id)
  Get the description of an assembly node. More...
 
def  get_assembly_instance (assembly_id)
  Get the instance number of an assembly node. More...
 
def  get_parent_assembly_instance (assembly_id)
  Get the instance number of the parent of an assembly node. More...
 
def  get_assembly_file_format (assembly_id)
  Get the file format from which the assembly node was imported. More...
 
def  get_assembly_units (assembly_id)
  Get the units of measurement used in the assembly node. More...
 
def  get_assembly_material_description (assembly_id)
  Get the material description for a part. More...
 
def  get_assembly_material_specification (assembly_id)
  Get the material specification for a part. More...
 
Non-Exodus Boundary Condition Support
def  get_bc_id_list (bc_type_enum)
  Get active boundary condition (BC) IDs of a specified type. More...
 
def  get_bc_name (bc_type_enum, bc_id)
  Get the name of a specific boundary condition (BC). More...
 
def  get_nodeset_id_list_for_bc (bc_type_enum, bc_id)
  Get list of nodeset IDs associated with a boundary condition. More...
 
def  get_sideset_id_list_for_bc (bc_type_enum, bc_id)
  Get list of sideset IDs associated with a boundary condition. More...
 
def  is_on_thin_shell (bc_type_enum, entity_id)
  Check if a boundary condition is applied to a thin shell. More...
 
def  temperature_is_on_solid (bc_type_enum, entity_id)
  Check if a temperature BC is applied to a solid region. More...
 
def  convection_is_on_solid (entity_id)
  Check if a convection BC is on a solid. More...
 
def  convection_is_on_shell_area (entity_id, shell_area_enum)
  Check if a convection BC is on a shell top or bottom. More...
 
def  get_convection_coefficient (entity_id, bc_type_enum)
  Get convection coefficient from a convection BC. More...
 
def  get_bc_temperature (bc_type_enum, entity_id, temp_type_enum)
  Get the temperature value for a specified BC area. More...
 
def  temperature_is_on_shell_area (bc_type_enum, bc_area_enum, entity_id)
  Check if a temperature BC is on a shell area. More...
 
def  heatflux_is_on_shell_area (bc_area_enum, entity_id)
  Check if a heatflux BC is on a shell area. More...
 
def  get_heatflux_on_area (bc_area_enum, entity_id)
  Get the heatflux value on a specified area. More...
 
def  get_cfd_type (entity_id)
  Get the CFD boundary condition subtype. More...
 
def  get_contact_pair_friction_value (entity_id)
  Get the friction value for a contact pair. More...
 
def  get_contact_pair_tolerance_value (entity_id)
  Get the upper bound tolerance for a contact pair. More...
 
def  get_contact_pair_tol_lower_value (entity_id)
  Get the lower bound tolerance for a contact pair. More...
 
def  get_contact_pair_tied_state (entity_id)
  Get the tied state of a contact pair. More...
 
def  get_contact_pair_general_state (entity_id)
  Get the general contact state. More...
 
def  get_contact_pair_exterior_state (entity_id)
  Get the exterior state of a contact pair. More...
 
def  get_velocity_combine_type (entity_id)
  Get the velocity's combine type. More...
 
def  get_acceleration_combine_type (entity_id)
  Get the combine method for an acceleration BC. More...
 
def  get_displacement_combine_type (entity_id)
  Get the combine method for a displacement BC. More...
 
def  get_pressure_value (entity_id)
  Get the magnitude value of a pressure BC. More...
 
def  get_pressure_function (entity_id)
  Get the function expression associated with a pressure BC. More...
 
def  get_force_magnitude (entity_id)
  Get the force magnitude of a force BC. More...
 
def  get_moment_magnitude (entity_id)
  Get the moment magnitude of a force BC. More...
 
def  get_force_direction_vector (entity_id)
  Get the direction vector of a force BC. More...
 
def  get_force_moment_vector (entity_id)
  Get the moment vector of a force BC. More...
 
def  get_constraint_type (constraint_id)
  Get the type of a specified constraint. More...
 
def  get_constraint_reference_point (constraint_id)
  Get the reference point of a specified constraint. More...
 
def  get_constraint_dependent_entity_point (constraint_id)
  Get the dependent entity of a specified constraint. More...
 
def  get_material_property (material_property_enum, entity_id)
  Get the value of a material property. More...
 
def  get_media_property (entity_id)
  Get the media classification of a material. More...
 
def  get_media_name_list ()
  Get list of all CFD media names. More...
 
def  get_material_name_list ()
  Get list of all material names. More...
 
def  get_material_name (material_id)
  Get the name of a material or CFD media by ID. More...
 
Boundary Layer Support
def  get_next_boundary_layer_id ()
  Get the next available boundary layer ID. More...
 
def  is_boundary_layer_id_available (boundary_layer_id)
  Check if a boundary layer ID is currently available. More...
 
def  get_boundary_layer_algorithm (boundary_layer_id)
  Get the algorithm type used by the specified boundary layer. More...
 
def  get_boundary_layers_by_base (base_type, base_id)
  Get all boundary layers associated with a specified base entity. More...
 
def  get_boundary_layers_by_pair (base_type, base_id, parent_id)
  Get all boundary layers associated with a base-parent pair. More...
 
def  get_boundary_layer_continuity (boundary_layer_id)
  Get the continuity setting of a boundary layer. More...
 
def  get_boundary_layer_id_list ()
  Get a list of all defined boundary layer IDs. More...
 
Machine Learning Support
def  load_ML (args, kwargs)
  Load machine learning training data into memory. More...
 
def  unload_ML (args, kwargs)
  Unload machine learning training data from memory. More...
 
def  get_ML_operation_features (ml_op_names, entity1_ids, entity2_ids, params, mesh_size, reduced_features=False)
  Compute ML feature vectors for a list of Cubit operations. More...
 
def  get_ML_features (ml_op_names, entity1_ids, entity2_ids, params, mesh_size, reduced_features=False)
  Compute ML feature vectors for operations permitting multiple entities. More...
 
def  get_ML_predictions (ml_op_names, entity1_ids, entity2_ids, params, mesh_size, reduced_features=False)
  Compute ML predictions for a list of operations on single-entity pairs. More...
 
def  do_ML_predictions (ml_op_names, entity1_ids, entity2_ids, params, mesh_size, reduced_features=False)
  Compute ML predictions for a list of operations with multiple entities. More...
 
def  get_ML_classification (geom_type, ent_id)
  Get the top classification label for a single volume or surface. More...
 
def  get_ML_classifications (geom_type, ent_ids)
  Classify multiple volumes or surfaces in a single batch operation. More...
 
def  get_ML_classification_categories (geom_type)
  Retrieve all available classification categories for a geometry type. More...
 
def  ML_train (geom_type)
  Force retraining of the ML classification model for a specific geometry type. More...
 
def  get_ML_operation_feature_types (ml_op_name, reduced_features=False)
  Get the data-type descriptor for each feature of a specified ML operation. More...
 
def  get_ML_operation_feature_names (ml_op_name, reduced_features=False)
  Retrieve the list of feature names for a specified ML operation. More...
 
def  get_ML_operation_feature_size (ml_op_name, reduced_features=False)
  Retrieve the expected feature-vector length for a given ML operation. More...
 
def  get_ML_operation_label_size (ml_op_name)
  Retrieve the expected label vector length for a given ML operation. More...
 
def  get_ML_classification_models ()
  Retrieve the list of supported classification ML model names. More...
 
def  get_ML_regression_models ()
  Retrieve the list of supported regression ML model names. More...
 
def  get_ML_model_name (model_ID)
  Retrieve the name of an ML model based on its ID. More...
 
def  get_ML_model_ID (model_name)
  Retrieve the unique numeric ID for a given ML model or operation name. More...
 
def  get_ML_operation (op_name, entity_id1, entity_id2, params, small_curve_size, mesh_size)
  Generate the command, display label, and preview text for an ML operation. More...
 
def  get_ML_feature_importances (op_name)
  Retrieve feature importance scores for a given ML operation. More...
 
def  get_ML_feature_distance (op_name, f1, f2)
  Compute the weighted distance between two feature vectors. More...
 
def  set_ML_base_user_dir (path, print_info=False)
  Set the root directory for user-provided ML training data (classification only). More...
 
def  get_ML_initialize_surviving_entities (op_name, ent1, ent2)
  Capture entities for survival tracking before a CAD operation. More...
 
def  get_ML_surviving_entities (op_name, begin_ents)
  Identify which entities survive after a CAD operation. More...
 

Variables

  BAR = _cubit3.BAR
 
  BAR2 = _cubit3.BAR2
 
  BAR3 = _cubit3.BAR3
 
  BEAM = _cubit3.BEAM
 
  BEAM2 = _cubit3.BEAM2
 
  BEAM3 = _cubit3.BEAM3
 
  CI_BCENTITY_CC = _cubit3.CI_BCENTITY_CC
 
  CI_BCENTITY_CC_SHELL_BOTTOM = _cubit3.CI_BCENTITY_CC_SHELL_BOTTOM
 
  CI_BCENTITY_CC_SHELL_TOP = _cubit3.CI_BCENTITY_CC_SHELL_TOP
 
  CI_BCENTITY_FIRST = _cubit3.CI_BCENTITY_FIRST
 
  CI_BCENTITY_LAST = _cubit3.CI_BCENTITY_LAST
 
  CI_BCENTITY_SHELL_AREA_BOTTOM = _cubit3.CI_BCENTITY_SHELL_AREA_BOTTOM
 
  CI_BCENTITY_SHELL_AREA_GRADIENT = _cubit3.CI_BCENTITY_SHELL_AREA_GRADIENT
 
  CI_BCENTITY_SHELL_AREA_MIDDLE = _cubit3.CI_BCENTITY_SHELL_AREA_MIDDLE
 
  CI_BCENTITY_SHELL_AREA_TOP = _cubit3.CI_BCENTITY_SHELL_AREA_TOP
 
  CI_BCENTITY_SOLID_HEATFLUX = _cubit3.CI_BCENTITY_SOLID_HEATFLUX
 
  CI_BCENTITY_SOLID_TEMP = _cubit3.CI_BCENTITY_SOLID_TEMP
 
  CI_BCENTITY_TEMP = _cubit3.CI_BCENTITY_TEMP
 
  CI_BCENTITY_UNKNOWN = _cubit3.CI_BCENTITY_UNKNOWN
 
  CI_BCTYPE_ACCELERATION = _cubit3.CI_BCTYPE_ACCELERATION
 
  CI_BCTYPE_AXIS = _cubit3.CI_BCTYPE_AXIS
 
  CI_BCTYPE_CONSTRAINT = _cubit3.CI_BCTYPE_CONSTRAINT
 
  CI_BCTYPE_CONTACT_PAIR = _cubit3.CI_BCTYPE_CONTACT_PAIR
 
  CI_BCTYPE_CONTACT_REGION = _cubit3.CI_BCTYPE_CONTACT_REGION
 
  CI_BCTYPE_CONVECTION = _cubit3.CI_BCTYPE_CONVECTION
 
  CI_BCTYPE_DISPLACEMENT = _cubit3.CI_BCTYPE_DISPLACEMENT
 
  CI_BCTYPE_EXHAUSTFAN = _cubit3.CI_BCTYPE_EXHAUSTFAN
 
  CI_BCTYPE_FAN = _cubit3.CI_BCTYPE_FAN
 
  CI_BCTYPE_FIRST = _cubit3.CI_BCTYPE_FIRST
 
  CI_BCTYPE_FORCE = _cubit3.CI_BCTYPE_FORCE
 
  CI_BCTYPE_GAP = _cubit3.CI_BCTYPE_GAP
 
  CI_BCTYPE_HEATFLUX = _cubit3.CI_BCTYPE_HEATFLUX
 
  CI_BCTYPE_INLETVENT = _cubit3.CI_BCTYPE_INLETVENT
 
  CI_BCTYPE_INTAKEFAN = _cubit3.CI_BCTYPE_INTAKEFAN
 
  CI_BCTYPE_INTERFACE = _cubit3.CI_BCTYPE_INTERFACE
 
  CI_BCTYPE_INTERIOR = _cubit3.CI_BCTYPE_INTERIOR
 
  CI_BCTYPE_LAST = _cubit3.CI_BCTYPE_LAST
 
  CI_BCTYPE_LUMPMASS = _cubit3.CI_BCTYPE_LUMPMASS
 
  CI_BCTYPE_MASSFLOWINLET = _cubit3.CI_BCTYPE_MASSFLOWINLET
 
  CI_BCTYPE_MATERIAL = _cubit3.CI_BCTYPE_MATERIAL
 
  CI_BCTYPE_MEDIA = _cubit3.CI_BCTYPE_MEDIA
 
  CI_BCTYPE_MPC = _cubit3.CI_BCTYPE_MPC
 
  CI_BCTYPE_OUTFLOW = _cubit3.CI_BCTYPE_OUTFLOW
 
  CI_BCTYPE_OUTLETVENT = _cubit3.CI_BCTYPE_OUTLETVENT
 
  CI_BCTYPE_PERIODIC = _cubit3.CI_BCTYPE_PERIODIC
 
  CI_BCTYPE_PERIODICSHADOW = _cubit3.CI_BCTYPE_PERIODICSHADOW
 
  CI_BCTYPE_POROUSJUMP = _cubit3.CI_BCTYPE_POROUSJUMP
 
  CI_BCTYPE_PRESSURE = _cubit3.CI_BCTYPE_PRESSURE
 
  CI_BCTYPE_PRESSUREFARFIELD = _cubit3.CI_BCTYPE_PRESSUREFARFIELD
 
  CI_BCTYPE_PRESSUREINLET = _cubit3.CI_BCTYPE_PRESSUREINLET
 
  CI_BCTYPE_PRESSUREOUTLET = _cubit3.CI_BCTYPE_PRESSUREOUTLET
 
  CI_BCTYPE_RADIATOR = _cubit3.CI_BCTYPE_RADIATOR
 
  CI_BCTYPE_RIGIDBODY = _cubit3.CI_BCTYPE_RIGIDBODY
 
  CI_BCTYPE_SPRING = _cubit3.CI_BCTYPE_SPRING
 
  CI_BCTYPE_SUPERSONICINFLOW = _cubit3.CI_BCTYPE_SUPERSONICINFLOW
 
  CI_BCTYPE_SUPERSONICOUTFLOW = _cubit3.CI_BCTYPE_SUPERSONICOUTFLOW
 
  CI_BCTYPE_SYMMETRY = _cubit3.CI_BCTYPE_SYMMETRY
 
  CI_BCTYPE_TEMPERATURE = _cubit3.CI_BCTYPE_TEMPERATURE
 
  CI_BCTYPE_UNKNOWN = _cubit3.CI_BCTYPE_UNKNOWN
 
  CI_BCTYPE_VELOCITY = _cubit3.CI_BCTYPE_VELOCITY
 
  CI_BCTYPE_VELOCITYINLET = _cubit3.CI_BCTYPE_VELOCITYINLET
 
  CI_BCTYPE_WALL = _cubit3.CI_BCTYPE_WALL
 
  CI_CONDUCTIVITY = _cubit3.CI_CONDUCTIVITY
 
  CI_DENSITY = _cubit3.CI_DENSITY
 
  CI_ERROR = cvar.CI_ERROR
 
  CI_MATERIAL_FIRST = _cubit3.CI_MATERIAL_FIRST
 
  CI_MATERIAL_LAST = _cubit3.CI_MATERIAL_LAST
 
  CI_MATERIAL_UNKNOWNPROPERTY = _cubit3.CI_MATERIAL_UNKNOWNPROPERTY
 
  CI_MODULUS = _cubit3.CI_MODULUS
 
  CI_POISSON = _cubit3.CI_POISSON
 
  CI_SHEAR_MODULUS = _cubit3.CI_SHEAR_MODULUS
 
  CI_SPECIFIC_HEAT = _cubit3.CI_SPECIFIC_HEAT
 
  CI_THERMAL_EXPANSION = _cubit3.CI_THERMAL_EXPANSION
 
  CI_ULTIMATE_STRAIN = _cubit3.CI_ULTIMATE_STRAIN
 
  CI_ULTIMATE_STRENGTH = _cubit3.CI_ULTIMATE_STRENGTH
 
  CI_YIELD_STRENGTH = _cubit3.CI_YIELD_STRENGTH
 
  CUBIT_TRI = _cubit3.CUBIT_TRI
 
  CURVE = _cubit3.CURVE
 
  cvar = _cubit3.cvar
 
  HEX = _cubit3.HEX
 
  HEX20 = _cubit3.HEX20
 
  HEX21 = _cubit3.HEX21
 
  HEX26 = _cubit3.HEX26
 
  HEX27 = _cubit3.HEX27
 
  HEX8 = _cubit3.HEX8
 
  HEX9 = _cubit3.HEX9
 
  HEXSHELL = _cubit3.HEXSHELL
 
  INVALID_ELEMENT_TYPE = _cubit3.INVALID_ELEMENT_TYPE
 
  PYRAMID = _cubit3.PYRAMID
 
  PYRAMID13 = _cubit3.PYRAMID13
 
  PYRAMID18 = _cubit3.PYRAMID18
 
  PYRAMID5 = _cubit3.PYRAMID5
 
  PYRAMID8 = _cubit3.PYRAMID8
 
  QUAD = _cubit3.QUAD
 
  QUAD4 = _cubit3.QUAD4
 
  QUAD5 = _cubit3.QUAD5
 
  QUAD8 = _cubit3.QUAD8
 
  QUAD9 = _cubit3.QUAD9
 
  SHARED_PTR_DISOWN = _cubit3.SHARED_PTR_DISOWN
 
  SHEL = _cubit3.SHEL
 
  SHELL4 = _cubit3.SHELL4
 
  SHELL8 = _cubit3.SHELL8
 
  SHELL9 = _cubit3.SHELL9
 
  SPHERE_EXO = _cubit3.SPHERE_EXO
 
  SPRING = _cubit3.SPRING
 
  SUPERELEMENT_TOPOLOGY = _cubit3.SUPERELEMENT_TOPOLOGY
 
  SURFACE = _cubit3.SURFACE
 
  TETRA = _cubit3.TETRA
 
  TETRA10 = _cubit3.TETRA10
 
  TETRA14 = _cubit3.TETRA14
 
  TETRA15 = _cubit3.TETRA15
 
  TETRA4 = _cubit3.TETRA4
 
  TETRA8 = _cubit3.TETRA8
 
  TRI3 = _cubit3.TRI3
 
  TRI4 = _cubit3.TRI4
 
  TRI6 = _cubit3.TRI6
 
  TRI7 = _cubit3.TRI7
 
  TRISHELL = _cubit3.TRISHELL
 
  TRISHELL3 = _cubit3.TRISHELL3
 
  TRISHELL4 = _cubit3.TRISHELL4
 
  TRISHELL6 = _cubit3.TRISHELL6
 
  TRISHELL7 = _cubit3.TRISHELL7
 
  TRUSS = _cubit3.TRUSS
 
  TRUSS2 = _cubit3.TRUSS2
 
  TRUSS3 = _cubit3.TRUSS3
 
  VERTEX = _cubit3.VERTEX
 
  VOLUME = _cubit3.VOLUME
 
  WEDGE = _cubit3.WEDGE
 
  WEDGE15 = _cubit3.WEDGE15
 
  WEDGE16 = _cubit3.WEDGE16
 
  WEDGE20 = _cubit3.WEDGE20
 
  WEDGE21 = _cubit3.WEDGE21
 
  WEDGE6 = _cubit3.WEDGE6
 

Function Documentation

◆ add_entities_to_group()

def cubit.add_entities_to_group (   group_id,
  entity_ids,
  entity_type 
)

Add a list of entities to a specified group.

.. code-block:: python

# Initialize geometry
cubit.cmd ("brick x 10" )
# Create a new empty group and retrieve its ID.
group_id = cubit.create_new_group ()
# Prepare a list of vertices 1 through 8.
verts_to_add = list(range(1,9))
# Add multiple vertices in one call.
cubit.add_entities_to_group (group_id, verts_to_add, "vertex" )
# Verify by querying group vertices.
verts = cubit.get_group_vertices (group_id)
print("Group vertices:" , verts) # prints [1, 2, 3, 4, 5, 6, 7, 8]
 @n type of group_id:  int
Parameters
group_id ID of the group to which entities will be added.
type of entity_ids: std::vector< int,std::allocator< int > >
entity_ids Vector of entity IDs to add.
type of entity_type: string
entity_type Type of the entities (e.g., "vertex", "curve", "surface", "volume"). Only geometric entities are supported.
return type of : void
Returns
None.

◆ add_entity_to_group()

def cubit.add_entity_to_group (   group_id,
  entity_id,
  entity_type 
)

Add a specific entity to a given group.

.. code-block:: python

# Initialize geometry.
cubit.cmd ("brick x 10" )
# Create a new empty group and retrieve its ID.
group_id = cubit.create_new_group ()
# Add vertex with ID 1 to the new group.
cubit.add_entity_to_group (group_id, 1, "vertex" )
# Verify by querying group vertices.
verts = cubit.get_group_vertices (group_id)
print("Group vertices:" , verts) # prints "[1]"
 @n type of group_id:  int
Parameters
group_id ID of the group to which the entity will be added.
type of entity_id: int
entity_id ID of the entity to add.
type of entity_type: string
entity_type Type of the entity (e.g., "vertex", "curve", "surface", "volume"). Only geometric entities are supported.
return type of : void
Returns
None.

◆ add_filename_to_recent_file_list()

def cubit.add_filename_to_recent_file_list (   filename )

Add a filename to Cubit's recent-file list in the GUI File menu.

Registers the specified file path so it appears under "Recent Files" in Cubit's GUI.

.. code-block:: python
import cubit
filename = "C:/models/part.sat"
 @n type of filename:  string
Parameters
filename Reference to the file path string to add to the recent-file list.

◆ add_filter_type()

def cubit.add_filter_type (   filter_type )

Add an entity type to the graphics pick filter.

Allows picking entities of the specified type in addition to any existing filters.

.. code-block:: python
import cubit
# Add "volume" to the pick filter
cubit.add_filter_type ("volume" )
 @n type of filter_type:  string
Parameters
filter_type Entity type to add to the pickable set (e.g., "vertex", "curve", "surface", "volume", "node", "edge", "face").

◆ app_util()

def cubit.app_util ( )

Return Cubit's AppUtil interface for global services.

Provides access to application-level utilities–logging, configuration, file I/O, and more–required by higher-level modules like CubitML.

Python usage example:

.. code-block:: python

import cubit, cubitml
# Initialize Cubit (no GUI, no journal, offscreen driver)
cubit.init (['' , '-nojournal' , '-driver' , 'offscreen' ])
util = cubit.app_util ()
cml = cubitml.CubitML(util)
geom = cubit.cgm_iface ()
ml = cubitml.MLUtil(cml, geom)
ml.load_ML()

Typically used together with cgm_iface() to bootstrap ML workflows.


return type of : std:: shared_ptr< AppUtil >

Returns
Shared pointer to the AppUtil instance.

◆ are_adjacent_curves()

def cubit.are_adjacent_curves (   curve_ids )

Return whether two or more curves share at least one manifold vertex.

Given a list of curve IDs, this function returns whether the curves are adjacent. Two curves are considered adjacent if they share at least one manifold vertex: a vertex that is connected to exactly two curves.

If the shared vertex is connected to more than two curves, the curves are not considered adjacent .

.. code-block:: python
cubit.cmd ("brick x 10" )
print(cubit.are_adjacent_curves ([1, 2]))
# Expected output:
# False
cubit.cmd ("surface 1 copy" ) # Creates sheet body with curves 13, 14, etc.
print(cubit.are_adjacent_curves ([13, 14]))
# Expected output:
# True
 @n type of curve_ids:  std::vector< int,std::allocator< int > >
Parameters
curve_ids IDs of curves to query.
return type of : boolean
Returns
True if the curves are adjacent (share at least one manifold vertex - vertex connected to exactly two curves), false otherwise.

◆ are_adjacent_surfaces()

def cubit.are_adjacent_surfaces (   surface_ids )

Return whether two or more surfaces share at least one manifold curve.

Given a list of surface IDs, this function returns whether the surfaces are adjacent. Two surfaces are considered adjacent if they share at least one manifold curve (a curve that is part of exactly two surfaces).

.. code-block:: python
cubit.cmd ("brick x 10" )
print(cubit.are_adjacent_surfaces ([1, 6]))
# Expected output:
# True
print(cubit.are_adjacent_surfaces ([1, 2]))
# Expected output:
# False
 @n type of surface_ids:  std::vector< int,std::allocator< int > >
Parameters
surface_ids IDs of surfaces to query.
return type of : boolean
Returns
True if the surfaces are adjacent (share at least one manifold curve), false otherwise.

◆ auto_size_needs_to_be_calculated()

def cubit.auto_size_needs_to_be_calculated ( )

Check if automatic mesh sizing is outdated and needs recomputation.

Returns true if the model has changed since the last auto size calculation, indicating that automatic sizes (which can be expensive to compute) should be recalculated before generating a mesh.

.. code-block:: python
import cubit
# Recompute auto size on volume 1 if needed

if cubit.auto_size_needs_to_be_calculated() : cubit.cmd ("volume 1 size auto factor 3")

  @n return type of :  boolean
Returns
True if auto sizing is out of date and should be recalculated; false otherwise.

◆ best_edge_to_collapse_interior_node()

def cubit.best_edge_to_collapse_interior_node (   node_id )

Find the best edge to collapse to remove an interior node in a triangular mesh.

For a given interior mesh node (no geometry association), this function identifies the best adjacent edge whose collapse would remove the node. If no suitable edge is found, returns 0.

.. code-block:: python
# 1) Assume vertex 50 is an interior node in a surface mesh.

if best_edge > 0: print(f"Collapse interior node 50 along edge {best_edge}") else:

print("No valid edge to collapse for node 50" )


type of node_id: int

Parameters
node_id ID of the interior mesh node to remove.
return type of : int
Returns
ID of the best edge to collapse; 0 if no valid edge found.

◆ body()

def cubit.body (   id_in )

Retrieve a body by its ID.

Retrieves the body object corresponding to the provided ID.

   .. code-block:: python
# Create a 10x10x10 brick (body ID 1).
cubit.cmd ("brick x 10" )
# Select and retrieve body with ID 1.
body = cubit.body (1)
print("Body ID:" , body.id())
  @n type of id_in:  int
Parameters
id_in ID of the body to retrieve.
return type of : :py:class: Body
Returns
Body object corresponding to the specified ID.

◆ brick()

def cubit.brick (   width,
  depth = -1,
  height = -1 
)

Create a brick of specified width, depth, and height.

Creates a brick geometry with the given dimensions. If only width is provided (depth and height default to -1), a cube of side length width is generated.

   .. code-block:: python
import cubit
# Create a cube of side 10 (width only).
cube = cubit.brick (10.0)
print("Created cube Body ID:" , cube.id())
print("Cube volume:" , cube.volume())
# Expected output:
# Created cube Body ID: 1
# Cube volume: 1000
# Create a brick of width=2, depth=3, height=4.
brick_block = cubit.brick (2.0, 3.0, 4.0)
print("Created brick Body ID:" , brick_block.id())
print("Brick volume:" , brick_block.volume())
# Expected output:
# Created brick Body ID: 2
# Brick volume: 24
  @n type of width:  float, in
Parameters
width Width of the brick (or cube side length if only this argument is supplied).
type of depth: float, in, optional
depth Depth of the brick (default = -1, uses width).
type of height: float, in, optional
height Height of the brick (default = -1, uses width).
return type of : :py:class: Body
Returns
Body object representing the newly created brick geometry.

◆ calculate_timestep_estimate()

def cubit.calculate_timestep_estimate (   entity_type,
  entity_ids 
)

Estimate the time step based on element sizes and material properties.

Calculates a time step estimate for specified mesh elements of a given type. Supported "tet", "hex", "volume", "block", "group". Elements must belong to a single block with an assigned material defining at least elastic_modulus, poisson_ratio, and density.

.. code-block:: python
# Create geometry and define material properties.
cubit.cmd ("brick x 10" )
cubit.cmd ("create material \"steel\" property_group \"CUBIT-ABAQUS\"" )
cubit.cmd ("modify material \"steel\" scalar_properties \"MODULUS\" 2.068e+05 \"SHEAR_MODULUS\" 8.016e+04 \"POISSON\" 0.29 \"DENSITY\" 7e-06 \"SPECIFIC_HEAT\" 500 \"CONDUCTIVITY\" 0.045 \"THERMAL_EXPANSION\" 1.2e-05 \"YIELD_STRENGTH\" 374 \"ULTIMATE_STRENGTH\" 590" )
# Assign material and mesh.
cubit.cmd ("block 1 add volume 1" )
cubit.cmd ("block 1 material 'steel'" )
cubit.cmd ("mesh volume 1" )
# Estimate time step.
dt = cubit.calculate_timestep_estimate ('volume' , [1])
print(f"Estimated time step: {dt}" )
 @n type of entity_type:  string
Parameters
entity_type Mesh element type string ("tet", "hex", "volume", "block", "group").
type of entity_ids: std::vector< int,std::allocator< int > >
entity_ids List of IDs of elements to include in the estimate.
return type of : float
Returns
Smallest stable time step across specified elements.

◆ calculate_timestep_estimate_with_props()

def cubit.calculate_timestep_estimate_with_props (   entity_type,
  entity_id_list,
  density,
  youngs_modulus,
  poissons_ratio 
)

Estimate the stable time step using user-specified material properties.

Calculates a time step estimate for mesh elements of the given type, using provided density, Young's modulus, and Poisson's ratio rather than block-assigned materials.

.. code-block:: python
# Create geometry and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
vol_list = [1]
# Estimate time step with density=2.7, E=70, nu=0.35
2.7, 70.0, 0.35)
print(f"Custom estimate: {dt}" )
 @n type of entity_type:  string
Parameters
entity_type Mesh element type ("tet", "hex", "volume", "block", "group").
type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_list Vector of element IDs to include.
type of density: float
density Material density.
type of youngs_modulus: float
youngs_modulus Young's modulus.
type of poissons_ratio: float
poissons_ratio Poisson's ratio.
return type of : float
Returns
Smallest stable time step estimate.

◆ cgm()

def cubit.cgm ( )

Return the raw CGMApp kernel instance used by Cubit.

Grants direct access to lower-level CGM application calls (version, kernel settings, etc.).


return type of : CGMApp

Returns
Pointer to the active CGMApp instance (or None if CGM is unavailable).

◆ cgm_iface()

def cubit.cgm_iface ( )

Return the CGM-based geometry interface for Cubit.

Yields a CubitGeometryInterface implemented on the CGM kernel, enabling CAD topology queries and edits needed for ML feature extraction.

Python usage example:

.. code-block:: python

import cubit, cubitml
cubit.init (['' , '-nojournal' , '-driver' , 'offscreen' ])
util = cubit.app_util ()
cml = cubitml.CubitML(util)
geom = cubit.cgm_iface ()
ml = cubitml.MLUtil(cml, geom)
ml.load_ML()

Use this interface for all geometry operations in the ML pipeline.


return type of : CubitGeometryInterface

Returns
Pointer to the CGM-backed CubitGeometryInterface.

◆ clear_drawing_set()

def cubit.clear_drawing_set (   set_name )

Clear all geometry in a named drawing set (e.g., mesh preview).

Removes any preview graphics associated with the specified set name, leaving the set empty for fresh drawing operations.

.. code-block:: python
import cubit
# Preview a mesh
cubit.cmd ("mesh volume 5 scheme sweep preview mesh_preview" )
# Now clear the preview set
cubit.clear_drawing_set ("mesh_preview" )
 @n type of set_name:  string
Parameters
set_name Name of the drawing set to clear.

◆ clear_highlight()

def cubit.clear_highlight ( )

Clear all entity highlights.

Removes highlights and selections from every entity in the graphics window.

.. code-block:: python
import cubit
# First select nodes 10 and 20
cubit.cmd ("select node 10 20" )
# Now clear all highlights and selections

◆ clear_picked_list()

def cubit.clear_picked_list ( )

Clear the list of currently picked entities.

Empties the internal pick list without altering the pick filter or highlights.

.. code-block:: python
import cubit
# Clear all picked entities

◆ clear_preview()

def cubit.clear_preview ( )

Clear preview graphics without affecting other display settings.

Removes only the temporary preview without altering the main geometry or mesh visibility.

.. code-block:: python
import cubit
# Create a brick and preview moving it along the X axis by 10 units
cubit.cmd ("brick x 10" )
# A blue wireframe preview of the moved brick appears
cubit.cmd ("move volume 1 x 10 preview" )
# Now clear the blue wireframe preview

◆ cmd()

def cubit.cmd (   input_string )

Execute a raw Cubit command string immediately (modifies model state).

This is one of the two primary ways (silent_cmd) to change the CAD model within Cubit. Sends the exact command text to Cubit for execution with no pre-validation. See Cubit's command syntax in the online documentation for a full description.

.. code-block:: python
import cubit
# Create a 10x10x10 block
cubit.cmd ("brick x 10" )
# Then mesh volume 1
cubit.cmd ("mesh volume 1" )
 @n type of input_string:  string
Parameters
input_string Null-terminated C string containing the complete Cubit command.
return type of : boolean
Returns
true if the command executed successfully; false otherwise.

◆ contains_virtual()

def cubit.contains_virtual (   geometry_type,
  entity_id 
)

Query whether any child entities of a specified geometry entity are virtual.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("composite create surf 1 6" ) # create composite surface (Surface ID = 7)
# Check if volume 1 contains any virtual children (surface 7 is virtual)
has_virt = cubit.contains_virtual ("volume" , 1)
print("Volume 1 contains virtual children:" , has_virt)
cubit.cmd ("composite delete surf 7" ) # delete composite surface
has_virt = cubit.contains_virtual ("volume" , 1)
print("Volume 1 contains virtual children:" , has_virt)
 @n type of geometry_type:  string
Parameters
geometry_type The type of geometry ("curve", "surface", "volume", etc.).
type of entity_id: int
entity_id The ID of the entity to query.
return type of : boolean
Returns
True if any child entities of the specified entity are virtual; false otherwise.

◆ convection_is_on_shell_area()

def cubit.convection_is_on_shell_area (   entity_id,
  shell_area_enum 
)

Check if a convection BC is on a shell top or bottom.


type of entity_id: int

Parameters
entity_id ID of the BC.
type of shell_area_enum: int
shell_area_enum Use CI_BCEntityTypes: 7 for top, 8 for bottom.
return type of : boolean
Returns
True if BC is applied to specified shell area.

◆ convection_is_on_solid()

def cubit.convection_is_on_solid (   entity_id )

Check if a convection BC is on a solid.


type of entity_id: int

Parameters
entity_id ID of the convection boundary condition.
return type of : boolean
Returns
True if the BC is applied to a solid region.

◆ copy_body()

def cubit.copy_body (   init_body )

Create a duplicate of the specified body.

Returns a new Body object that is an exact copy of the input body, including geometry and mesh data.

   .. code-block:: python
import cubit
# Create a unit cube body.
original = cubit.brick (1.0)
print("Original Body ID:" , original.id())
# Duplicate the body.
copy = cubit.copy_body (original)
print("Copied Body ID:" , copy.id())
# Verify the copy has the same volume.
print("Copy volume:" , copy.volume())
# Expected output:
# Original Body ID: 1
# Copied Body ID: 2
# Copy volume: 1.0
  @n type of init_body:  :py:class:`Body`, in
Parameters
init_body Body object to duplicate.
type of init_body: :py:class: Body, in
init_body Body object to duplicate.
return type of : :py:class: Body
Returns
New Body object that is a copy of the input. :raises: CubitFailureException Thrown if copying fails.

◆ create_arc_curve()

def cubit.create_arc_curve (   v0,
  v1,
  intermediate_point 
)

Create an arc curve using end vertices and an intermediate point.

Constructs a circular arc passing through the specified start and end vertices and the given intermediate point.

   .. code-block:: python
import cubit
# Create vertices for arc endpoints.
v0 = cubit.create_vertex (1, 0, 0)
v1 = cubit.create_vertex (-1, 0, 0)
# Intermediate point on the arc (half-circle of radius 1).
mid_pt = [0.0, 1.0, 0.0]
# Create the arc curve.
arc = cubit.create_arc_curve (v0, v1, mid_pt)
print("Arc curve ID:" , arc.id())
print("Arc curve length:" , arc.length())
# Expected output:
# Arc curve ID: 1
# Arc curve length: 3.14159
  @n type of v0:  :py:class:`Vertex`, in
Parameters
v0 The start vertex of the arc.
type of v1: :py:class: Vertex, in
v1 The end vertex of the arc.
type of intermediate_point: std::array< double,3 >, in
intermediate_point Array of three coordinates representing a point on the arc.
return type of : :py:class: Curve
Returns
Curve object representing the created arc.

◆ create_curve()

def cubit.create_curve (   v0,
  v1 
)

Create a curve between two vertices.

Constructs a straight-line curve connecting the two specified vertices.

   .. code-block:: python
import cubit
# Create two vertices at (0,0,0) and (1,1,0).
v0 = cubit.create_vertex (0, 0, 0)
v1 = cubit.create_vertex (1, 1, 0)
# Create a curve between v0 and v1.
curve = cubit.create_curve (v0, v1)
print("Curve ID:" , curve.id())
# Retrieve and print curve length.
print("Curve length:" , curve.length())
# Expected output:
# Curve ID: 1
# Curve length: 1.41421
  @n type of v0:  :py:class:`Vertex`, in
Parameters
v0 The start vertex of the curve.
type of v1: :py:class: Vertex, in
v1 The end vertex of the curve.
return type of : :py:class: Curve
Returns
Curve object representing the connection between the vertices.

◆ create_new_group()

def cubit.create_new_group ( )

Create a new, empty group and return its ID.

.. code-block:: python

# Initialize geometry.
cubit.cmd ("brick x 10" )
# Create a new group and retrieve its ID.
# Add vertices in volume 1 to the new group using shorthand.
cubit.cmd (f"group {new_id} add vertex in vol 1" )
 @n return type of :  int
Returns
ID of the newly created group.

◆ create_spline()

def cubit.create_spline (   points,
  surface_id 
)

Create a spline curve through a sequence of 3D points on a surface.

Constructs a smooth spline curve passing through the provided points, projected onto the specified surface. Projection is mandatory: the surface_id must refer to an existing surface entity. At least two points are required; otherwise, a CubitFailureException is thrown. A non-existent surface_id produces an InvalidEntityException . Other errors during projection or spline creation will result in a CubitFailureException or runtime error.

   .. code-block:: python
import cubit
# Create a unit cube using the brick function (cube of side 1).
cube = cubit.brick (1.0)
# Retrieve the front surface with ID 1.
front_surface = cubit.surface (1)
# Define spline points on the plane z=0.5 (front face).
points = [[0.0, 0.0, 0.5], [0.5, 0.0, 0.5], [0.5, 0.5, 0.5]]
# Create spline projected onto surface ID 1.
spline = cubit.create_spline (points, front_surface.id())
print("Spline ID:" , spline.id())
print("Spline length:" , spline.length())
# Expected output:
# Spline ID: 1
# Spline length: 1.0304240189190117
  @n type of points:  std::vector< std::array< double,3 >,std::allocator< std::array< double,3 > > >, in
Parameters
points Ordered list of 3D coordinates (each array length = 3); must contain at least two points.
type of surface_id: int, in
surface_id ID of the surface onto which points are projected; must be a valid surface ID.
return type of : :py:class: Curve
Returns
Curve object representing the projected spline. :raises: CubitFailureException Thrown for invalid input or projection failure. :raises: InvalidEntityException Thrown if surface_id does not correspond to an existing surface.

◆ create_surface()

def cubit.create_surface (   curves )

Create a sheet body from boundary curves.

Constructs a sheet body bounded by the specified closed curves. The returned Body contains exactly one surface and one volume. To access the underlying Surface , retrieve it from the body's surface list.

   .. code-block:: python
import cubit
# Create four vertices of a unit square on the XY-plane.
v0 = cubit.create_vertex (0, 0, 0)
v1 = cubit.create_vertex (1, 0, 0)
v2 = cubit.create_vertex (1, 1, 0)
v3 = cubit.create_vertex (0, 1, 0)
# Create boundary curves of the square.
c0 = cubit.create_curve (v0, v1)
c1 = cubit.create_curve (v1, v2)
c2 = cubit.create_curve (v2, v3)
c3 = cubit.create_curve (v3, v0)
boundary = [c0, c1, c2, c3]
# Create a sheet body from the boundary curves.
sheet_body = cubit.create_surface (boundary)
print("Sheet Body ID:" , sheet_body.id())
# Access the underlying surface object.
surface = sheet_body.surfaces()[0]
print("Surface area:" , surface.area())
# Expected output:
# Sheet Body ID: 1
# Surface area: 1.0
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curves List of Curve objects forming a closed boundary loop.
return type of : :py:class: Body
Returns
Body object representing the created sheet (contains one surface and one volume). :raises: CubitFailureException Thrown if curves do not form a valid loop or creation fails.

◆ create_vertex()

def cubit.create_vertex (   x,
  y,
  z 
)

Create a vertex at specified coordinates.

Creates a 0-dimensional geometric entity (vertex) at the given (x, y, z) location. If no coordinates are specified, the vertex is placed at the origin (0,0,0).

   .. code-block:: python
import cubit
# Create a vertex at the default origin (0,0,0).
origin = cubit.create_vertex ()
coords = origin.coordinates()
print("Origin Vertex ID:" , origin.id())
print(f"Coordinates: ({coords[0]}, {coords[1]}, {coords[2]})" )
# Create a vertex at (1.0, 2.0, 3.0).
v = cubit.create_vertex (1.0, 2.0, 3.0)
coords = v.coordinates()
print("Vertex at (1,2,3) ID:" , v.id())
print(f"Coordinates: ({coords[0]}, {coords[1]}, {coords[2]})" )
  @n type of x:  float, in
Parameters
x X-coordinate of the vertex (default = 0).
type of y: float, in
y Y-coordinate of the vertex (default = 0).
type of z: float, in
z Z-coordinate of the vertex (default = 0).
return type of : :py:class: Vertex
Returns
Vertex object located at the specified coordinates.

◆ current_selection_count()

def cubit.current_selection_count ( )

Get the number of entities in the current selection list.

Returns how many entities have been picked and are available for navigation.

.. code-block:: python
import cubit
print("Selections:" , count)
 @n return type of :  int
Returns
Number of entities currently selected.

◆ curve()

def cubit.curve (   id_in )

Retrieve a curve object by its ID.

Retrieves the curve object corresponding to the provided ID.

   .. code-block:: python
import cubit
# Create a 10x10x10 brick (curve IDs include edges).
cubit.cmd ("brick x 10" )
curve = cubit.curve (1)
print("Curve ID:" , curve.id())
  @n type of id_in:  int
Parameters
id_in ID of the curve to retrieve.
return type of : :py:class: Curve
Returns
Curve object corresponding to the specified ID.

◆ cylinder()

def cubit.cylinder (   height,
  x_radius,
  y_radius,
  top_radius 
)

Create a cylinder or truncated cone of specified dimensions.

Creates a cylindrical or conical body based on provided bottom and top radii. A zero top radius yields a cone; a top radius equal to the x and y radii yields a straight cylinder.

   .. code-block:: python
import cubit
# Create a cone: height=5, x_radius=2, y_radius=2, top_radius=0.
my_cone = cubit.cylinder (5, 2, 2, 0)
print("Cone ID:" , my_cone.id())
print("Cone volume:" , my_cone.volume())
# Create a straight cylinder: height=5, x_radius=2, y_radius=2, top_radius=2.
my_cylinder = cubit.cylinder (5, 2, 2, 2)
print("Cylinder ID:" , my_cylinder.id())
print("Cylinder volume:" , my_cylinder.volume())
  @n type of height:  float, in
Parameters
height Height of the cylinder.
type of x_radius: float, in
x_radius Radius in the x direction (base ellipse x-axis).
type of y_radius: float, in
y_radius Radius in the y direction (base ellipse y-axis).
type of top_radius: float, in
top_radius Radius at the top: 0 for cone, equal to x and y radii for straight cylinder.
return type of : :py:class: Body
Returns
Body object representing the newly created cylinder or cone.

◆ delete_all_groups()

def cubit.delete_all_groups ( )

Remove all groups from the current Cubit session.

.. code-block:: python

# Create some groups.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"g1\" add vertex all" )
cubit.cmd ("group \"g2\" add volume all" )
# Delete all groups.
# Verify that no groups remain by querying entities of type "group".
groups = cubit.get_entities ("group" )
print("Remaining groups:" , len(groups)) # prints "0"
 @n return type of :  void
Returns
None.

◆ delete_group()

def cubit.delete_group (   group_id )

Delete a specific group by ID.

.. code-block:: python

# Create and name two groups.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"g1\" add vertex all" )
cubit.cmd ("group \"g2\" add volume all" )
# Retrieve ID of "g1" and delete it.
g1_id = cubit.get_id_from_name ("g1" )
# Verify deletion: remaining groups should not include g1.
groups = cubit.get_entities ("group" )
print("Remaining groups:" , groups) # prints list containing only g2's ID
 @n type of group_id:  int
Parameters
group_id ID of the group to delete.
return type of : void
Returns
None.

◆ destroy()

def cubit.destroy ( )

Shut down Cubit and close the active journal file.

Flushes any pending commands, closes the journal, and releases Cubit resources. After calling destroy() , no further Cubit calls should be made.

.. code-block:: python
import cubit
status = cubit.destroy ()


return type of : int

Returns
0 on success; non-zero error code on failure.

◆ developer_commands_are_enabled()

def cubit.developer_commands_are_enabled ( )

Check if developer commands are enabled.

Returns true if Cubit is running in developer mode, allowing access to internal or experimental commands.

.. code-block:: python
import cubit
# Enable developer commands
cubit.cmd ("set dev on" )
# Check developer mode status

if cubit.developer_commands_are_enabled() : print("Developer commands are enabled.")

  @n return type of :  boolean
Returns
True if developer mode is active; false otherwise.

◆ do_ML_predictions()

def cubit.do_ML_predictions (   ml_op_names,
  entity1_ids,
  entity2_ids,
  params,
  mesh_size,
  reduced_features = False 
)

Compute ML predictions for a list of operations with multiple entities.

This is a batch variant of get_ML_predictions() that accepts lists of entity IDs per operation, enabling more flexible inputs. Features are computed and predictions are generated via a scikit-learn ensemble of decision trees.


type of ml_op_names: std::vector< std::string,std::allocator< std::string > >

Parameters
ml_op_names Vector of ML operation or model names.
type of entity1_ids: std::vector< std::vector< size_t,std::allocator< size_t > >,std::allocator< std::vector< size_t,std::allocator< size_t > > > >
entity1_ids Vector of vectors of primary entity IDs for each operation.
type of entity2_ids: std::vector< std::vector< size_t,std::allocator< size_t > >,std::allocator< std::vector< size_t,std::allocator< size_t > > > >
entity2_ids Vector of vectors of secondary entity IDs for each operation.
type of params: std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >
params Vector of parameter lists for each operation.
type of mesh_size: float
mesh_size Target mesh size used in feature calculation.
type of reduced_features: boolean, optional
reduced_features If true (where supported), use the reduced feature set for faster inference.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
Outer vector matches ml_op_names length; each inner vector contains the predicted values for that operation.
   .. code-block:: python
ml_op_names = ['volume_no_op' , 'classify_surface' ]
entity1_ids = [[5, 10], [20, 25]]
entity2_ids = [[0, 0], [0, 0]]
params = [[-1, -1, -1], [-1, -1, -1]]
mesh_size = 1.5
predictions = cubit.do_ML_predictions (
ml_op_names, entity1_ids, entity2_ids, params, mesh_size)

◆ entity_exists()

def cubit.entity_exists (   entity_type,
  id 
)

Check whether an entity of the specified type and ID exists.

This function returns true if an entity of the given type and ID exists in the model; otherwise it returns false .

Supported entity types include: "vertex", "curve", "surface", "volume", "body", etc.

.. code-block:: python
# Check whether surface with ID 12 exists
exists = cubit.entity_exists ("surface" , 12)
print(f"Does surface 12 exist? {'Yes' if exists else 'No'}" )
 @n type of entity_type:  string
Parameters
entity_type Type of the entity being queried (e.g. "surface", "curve", "volume").
type of id: int
id ID of the entity.
return type of : boolean
Returns
true if the entity exists, false otherwise.

◆ evaluate_exterior_angle()

def cubit.evaluate_exterior_angle (   curve_list,
  test_angle 
)

Find curves whose exterior angle between adjacent surfaces is less than a given threshold.

This function implements the Cubit "draw curve with exterior_angle < test_angle" test. For each curve in curve_list, it computes the exterior angle (the angle on the outside of the volume) between the two faces sharing that curve and returns those curves whose exterior angle is below test_angle.

Example setup:

.. code-block:: python
# Create two 10x10x10 bricks.
cubit.cmd ("brick x 10" ) # volume 1
cubit.cmd ("brick x 10" ) # volume 2
# Move and subtract to form L-shaped volume.
cubit.cmd ("vol 2 move x 5 y 5" )
cubit.cmd ("subtract vol 2 from vol 1" )
# Get all curve IDs.
all_curves = cubit.get_current_ids ("curve" )
# Find curves with exterior angle < 100 degrees (returns [27]).
result = cubit.evaluate_exterior_angle (all_curves, 100.0)
print(result) # prints (27,)
 @n type of curve_list:  std::vector< int,std::allocator< int > >
Parameters
curve_list Vector of curve IDs to test.
type of test_angle: float
test_angle Exterior angle threshold in degrees; curves with exterior angle < test_angle are returned.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector<int> or Python tuple) of curve IDs satisfying the test.

◆ evaluate_exterior_angle_at_curve()

def cubit.evaluate_exterior_angle_at_curve (   curve_id,
  volume_id 
)

Return the exterior angle at a single curve with respect to a volume.

Computes the exterior angle (in degrees) on the outside of the specified volume between the two faces sharing the given curve.

.. code-block:: python
# Create two 10x10x10 bricks and subtract to form L-shape.
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 2 move x 5 y 5" )
cubit.cmd ("subtract vol 2 from vol 1" )
# Query the exterior angle at curve 27 on volume 1.
print("Exterior angle at curve 27 on volume 1:" , angle) # prints 90
 @n type of curve_id:  int
Parameters
curve_id ID of the curve.
type of volume_id: int
volume_id ID of the volume.
return type of : float
Returns
Exterior angle in degrees between the two faces sharing the curve on the specified volume.

◆ evaluate_surface_angle_at_vertex()

def cubit.evaluate_surface_angle_at_vertex (   surf_id,
  vert_id 
)

Return the interior angle at a vertex on a specified surface.

Computes the angle in degrees between the two edges meeting at vert_id on surf_id, measured inside the surface. For a planar cube face, each corner vertex has an interior angle of 90 degrees.

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; surface 1 is a square face.
cubit.cmd ("brick x 10" )
# Vertex 1 on surface 1 is a corner with interior angle of 90 degrees.
print("Interior angle at vertex 1 on surface 1:" , angle) # prints 90
 @n type of surf_id:  int
Parameters
surf_id ID of the surface.
type of vert_id: int
vert_id ID of the vertex on that surface.
return type of : float
Returns
Interior angle in degrees at the specified vertex on the given surface.

◆ exodus_sizing_function_file_exists()

def cubit.exodus_sizing_function_file_exists ( )

Check if the Exodus sizing function file currently exists.

Returns true if an Exodus II file has been imported as a sizing function and still resides on disk; returns false otherwise.

.. code-block:: python
import cubit
# After importing a field function:
# cubit.cmd("Import Sizing Function 'adapt.exo' Block 3 Variable 'strain' Last")
print("Sizing file exists?" , exists)
 @n return type of :  boolean
Returns
True if the imported Exodus II sizing file still exists on disk; false otherwise.

◆ find_cone_surfaces()

def cubit.find_cone_surfaces (   surface_id )

Identify cone surface(s) starting from a candidate surface.

Given a surface ID, this function determines if the surface is part of a cone. If the surface is a cone with an adjacent surface also part of the same cone, both surface IDs are returned. Otherwise, only the input surface ID is returned.

.. code-block:: python
# Create a cylinder volume with a cone on top.
cubit.cmd ('cylinder rad 1 height 5' ) # Create cylinder
cubit.cmd ('create frustum height 1 radius 1 top 0' ) # Create cone (frustum with top radius 0)
cubit.cmd ('vol 2 mov z 3' ) # Move cone on top of cylinder
cubit.cmd ('unite vol all' ) # Unite volumes into one
cubit.cmd ('split period vol 1' ) # Split cylinder and cone surfaces
cone_surfaces1 = cubit.find_cone_surfaces (4) # from frustum
cone_surfaces2 = cubit.find_cone_surfaces (1) # from cylinder
print("Cone surfaces starting from 4:" , [int(sid) for sid in cone_surfaces1])
print("Cone surfaces starting from 1:" , [int(sid) for sid in cone_surfaces2])
# Expected output:
# Cone surfaces starting from 4: [4]
# Cone surfaces starting from 1: [1]
 @n type of surface_id:  int
Parameters
surface_id Surface ID to test as a candidate cone.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs:
  • If the input surface is a cone with a cone neighbor, both surface IDs are returned.
  • If not, the list contains only the input surface ID.

◆ find_overlapping_curves()

def cubit.find_overlapping_curves (   curve_ids )

Identify overlapping curves in a specified list of curves.

The result is a vector of vectors. Each vector contains the IDs of curves that overlap with one another. Only overlaps between curves of different volumes or touching surfaces are reported.

.. code-block:: python
# Create two volumes placed exactly next to each other so that surfaces are touching.
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 exactly next to volume 1
curve_ids = cubit.get_entities ('curve' ) # Get all curve IDs
my_overlaps = cubit.find_overlapping_curves (curve_ids)
print("Overlapping curves:" )

for overlap in my_overlaps: print("Curves:", tuple(int(cid) for cid in overlap))

# Expected output:
# Curves: (10, 21)
# Curves: (1, 15)
# Curves: (5, 19)
# Curves: (12, 23)
 @n type of curve_ids:  std::vector< int,std::allocator< int > >
Parameters
curve_ids List of curve IDs to search for curve overlaps.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A list of curve overlap results. Each entry is a vector of curve IDs that overlap.

◆ flush_graphics()

def cubit.flush_graphics ( )

Force immediate rendering of pending graphics operations.

Ensures that any queued draw calls (for example, draw location or mesh preview) are displayed before subsequent commands execute. Requires an active graphics window.

.. code-block:: python
import cubit
cubit.cmd ("draw location 1 2 3" )

◆ gather_surfaces_by_orientation()

def cubit.gather_surfaces_by_orientation (   seed_surf_ids,
  all_surf_ids 
)

Gathers surfaces connected across shared edges, forming a surface enclosure.

Starting from a list of seed surfaces, recursively finds and returns all surfaces that are connected to them across shared edges. The resulting set typically forms a closed or connected surface group (enclosure).

If all_surf_ids is provided, the search is limited to those surfaces. If empty, all model surfaces are considered.

This function is useful for finding surface enclosures, identifying connected outer boundaries, or selecting surface groups in models with voids or non-manifold geometry.

.. code-block:: python
# Geometry setup
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
cubit.cmd ("subtract vol 2 from vol 1" )
seed_surf_ids = [1] # Starting from one outer surface
all_surf_ids = [] # Search all surfaces
gathered_surfs = cubit.gather_surfaces_by_orientation (seed_surf_ids, all_surf_ids)
print("Gathered surfaces:" , gathered_surfs)
# Expected behavior:
# Surfaces on outer boundary of volume 1 will be gathered.
# Interior surfaces of the void will not be included.
 @n type of seed_surf_ids:  std::vector< int,std::allocator< int > >
Parameters
seed_surf_ids List of starting surface IDs to grow from.
type of all_surf_ids: std::vector< int,std::allocator< int > >
all_surf_ids Optional list of candidate surface IDs to search within (empty means all surfaces).
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs connected across shared edges.

◆ get_2D_sheet_volumes()

def cubit.get_2D_sheet_volumes (   vol_id )

Get associated 2D sheet volumes from a reduced 3D thin volume.

Returns the IDs of sheet bodies created from a 3D thin volume using reduce thin commands. These sheet volumes preserve thickness and loft attributes for shell FEA purposes.

.. code-block:: python
thin_vol = 1001
sheet_vols = cubit.get_2D_sheet_volumes (thin_vol)
 @n type of vol_id:  int
Parameters
vol_id Volume ID representing the 3D thin volume.
return type of : std::vector< int,std:: allocator< int > >
Returns
IDs of 2D sheet volumes generated from the 3D volume.

◆ get_3D_thin_volume()

def cubit.get_3D_thin_volume (   vol_id )

Get the original 3D thin volume associated with a 2D sheet volume.

Used to retrieve the parent 3D geometry from a 2D sheet volume generated by a reduce thin operation. Supports traceability in shell FEA workflows.

.. code-block:: python
sheet_vol = 2002
parent_thin_vol = cubit.get_3D_thin_volume (sheet_vol)
 @n type of vol_id:  int
Parameters
vol_id Volume ID representing a 2D sheet volume.
return type of : int
Returns
ID of the associated 3D thin volume.

◆ get_acceleration_combine_type()

def cubit.get_acceleration_combine_type (   entity_id )

Get the combine method for an acceleration BC.

Valid options include "Overwrite", "Average", "SmallestCombine", or "LargestCombine".
type of entity_id: int

Parameters
entity_id ID of the acceleration BC.
return type of : string
Returns
Combine method as a string.

◆ get_acis_version()

def cubit.get_acis_version ( )

Retrieve the ACIS kernel version string.

Returns the ACIS geometric modeling kernel version used by Cubit.

.. code-block:: python
import cubit
acis_version = cubit.get_acis_version ()
print("ACIS version:" , acis_version)
 @n return type of :  string
Returns
A string containing the ACIS version number.

◆ get_acis_version_as_int()

def cubit.get_acis_version_as_int ( )

Retrieve the ACIS kernel version as an integer.

Returns the ACIS version encoded as an integer (e.g., 202107 for version 2021.07).

.. code-block:: python
# Python example
import cubit
acis_version_int = cubit.get_acis_version_as_int ()
print("ACIS version (int):" , acis_version_int)
 @n return type of :  int
Returns
An integer representing the ACIS version.

◆ get_adjacent_surfaces()

def cubit.get_adjacent_surfaces (   geometry_type,
  entity_id 
)

Get a list of surfaces adjacent to a specified surface (including the surface itself).

For a given surface, this returns all surfaces that either own the specified entity or share a boundary with it. The returned list includes the queried surface as well.

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
# Query adjacent surfaces to surface 1.
adj_surfs = cubit.get_adjacent_surfaces ("surface" , 1)
print(adj_surfs) # prints (1, 6, 5, 4, 3)
 @n type of geometry_type:  string
Parameters
geometry_type The type of the entity ("surface" for this function).
type of entity_id: int
entity_id ID of the surface to query.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector or Python tuple) of surface IDs adjacent to-and including-the queried surface.

◆ get_adjacent_volumes()

def cubit.get_adjacent_volumes (   geometry_type,
  entity_id 
)

Get a list of adjacent volumes to a specified entity.

For a specified entity, find all volumes that own the entity and volumes that touch the volume that owns this entity.

.. code-block:: python
volume_id_list = cubit.get_adjacent_volumes ("curve" , 22)
Parameters
geom_type Specifies the geometry type of the entity
type of entity_id: int
entity_id Specifies the id of the entity
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (python tuple) of volume ids

◆ get_all_cfd_bcs()

def cubit.get_all_cfd_bcs ( )

◆ get_all_exodus_times()

def cubit.get_all_exodus_times (   filename )

Get all available time steps from an Exodus file.

Opens an Exodus II file and returns a vector of all stored time values (time steps). These time values are used when importing deformed meshes (via the Time <time> or Step <step> options) to select which deformation state to import. The last time in the list corresponds to the default import time.

.. code-block:: python
# Query all available time steps in an Exodus file
times = cubit.get_all_exodus_times ("deformed_mesh.e" )
# Print the times
print("Available time steps:" )

for t in times: print(" Time:", t)

# Expected output (example):
# Available time steps:
# Time: 0.0
# Time: 1.0
# Time: 2.0
# Time: 3.0
 @n type of filename:  string
Parameters
filename Fully qualified Exodus II file name.
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector (Python tuple) of available time steps stored in the file.

◆ get_all_exodus_variable_names()

def cubit.get_all_exodus_variable_names (   filename,
  variable_type 
)

Get all variable names of a given type from an Exodus file.

Opens an Exodus II file and returns a vector of all variable names of the requested type. These variable names are used when importing nodal or element variable data into Cubit via the nodal_var and element_var import options.

Valid variable types:

  • ‘'g’ = global variables -'n' = nodal variables -'e'` = element variables
.. code-block:: python
# Query all nodal variable names in an Exodus file
nodal_vars = cubit.get_all_exodus_variable_names ("deformed_mesh.e" , "n" )
# Print the variable names
print("Available nodal variables:" )

for var_name in nodal_vars: print(" ", var_name)

# Expected output (example):
# Available nodal variables:
# displacement_x
# displacement_y
# displacement_z
# temperature
 @n type of filename:  string
Parameters
filename Fully qualified Exodus II file name.
type of variable_type: string
variable_type Variable type: 'g' (global), 'n' (nodal), or 'e' (element).
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector (Python tuple) of variable names of the requested type stored in the file.

◆ get_all_geometric_owners()

def cubit.get_all_geometric_owners (   mesh_entity_type,
  mesh_entity_list 
)

Get the list of geometric owners for a set of mesh entities and their child entities.

Returns the geometric owners of the specified mesh entities and any child entities (e.g., edges or nodes of a quad).

Title Supported mesh entity types

  • quad
  • face
  • tri
  • hex
  • tet
  • edge
  • node
.. code-block:: python
# Get owners of quads 1-8 and their child edges/nodes
owners = cubit.get_all_geometric_owners ("quad" , "1 to 8" )
print("Owners:" , owners) # Output: ['surface 1', 'edge 1', 'node 1', 'node 2', ...]
 @n type of mesh_entity_type:  string
Parameters
mesh_entity_type Mesh entity type: quad, face, tri, hex, tet, edge, or node.
type of mesh_entity_list: string
mesh_entity_list Space-delimited mesh entity IDs (e.g., "all", "1 to 8", "1 2 3").
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of owner strings for each specified entity and its children.

◆ get_all_ids_from_name()

def cubit.get_all_ids_from_name (   geo_type,
  name 
)

Retrieve all IDs of entities of a specified geometry type whose names start with a given prefix.

.. code-block:: python

# Create and name two volumes.
cubit.cmd ("volume 1 name 'member_2A'" )
cubit.cmd ("volume 3 name 'member_2B'" )
# Query all volume IDs with names starting with "member_2".
ids = cubit.get_all_ids_from_name ("volume" , "member_2" )
print("Found IDs:" , ids) # prints "[1, 3]"
 @n type of geo_type:  string
Parameters
geo_type Geometry entity type ("vertex", "curve", "surface", or "volume").
type of name: string
name Prefix of the entity names to search for.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of integer IDs of entities matching the name prefix.

◆ get_aprepro_numeric_value()

def cubit.get_aprepro_numeric_value (   variable_name )

Get the numeric value of a specified Aprepro variable.

Aprepro is a lightweight macro language in Cubit used for variable substitution and simple scripting.

.. code-block:: python
# Define an Aprepro variable with a numeric value.
cubit.cmd ("#{test_var=3.14}" )
val = cubit.get_aprepro_numeric_value ("test_var" )
print("test_var =" , val) # prints 3.14
 @n type of variable_name:  string
Parameters
variable_name Name of the Aprepro variable to query.
return type of : float
Returns
The variable's value as a double, or CUBIT_DBL_MAX on failure.

◆ get_aprepro_value_as_string()

def cubit.get_aprepro_value_as_string (   variable_name )

Get the string value of an Aprepro variable.

Aprepro is a lightweight macro language in Cubit used for variable substitution and simple scripting.

.. code-block:: python
# Define an Aprepro string variable.
cubit.cmd ("#{mesh_scheme='pave'}" )
val = cubit.get_aprepro_value_as_string ("mesh_scheme" )
print("mesh_scheme =" , val) # prints "pave"
 @n type of variable_name:  string
Parameters
variable_name Name of the Aprepro variable to query.
return type of : string
Returns
The string value of the specified Aprepro variable.

◆ get_aprepro_vars()

def cubit.get_aprepro_vars ( )

Retrieve the current Aprepro variable names.

Aprepro is a lightweight macro language in Cubit used for variable substitution and simple scripting.

.. code-block:: python
# Define two Aprepro variables.
cubit.cmd ("#{first_var=1}" )
cubit.cmd ("#{second_var=2}" )
# Query the list of Aprepro variables.
print(vars) # prints ('first_var', 'second_var')
 @n return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
A list (vector<int> or Python tuple) of the current Aprepro variable names.

◆ get_arc_center_radius()

def cubit.get_arc_center_radius (   curve_id )

Get the center point and radius of a specified arc curve.

If the curve is a circular or elliptical arc (e.g., an end circle of a cylinder), returns its center (X,Y,Z) and constant radius. For any other curve type, returns {0,0,0,0} and emits a warning.

.. code-block:: python
# 1) Create a cylinder of radius 3 and height 2
cubit.cmd ("cylinder rad 3 height 2" )
# 2) Query one of its end-circle curves (ID 2)
curve_id = 2
arc_data = cubit.get_arc_center_radius (curve_id)
print(f"Center = ({arc_data[0]:.0f}, {arc_data[1]:.0f}, {arc_data[2]:.0f})" )
print(f"Radius = {arc_data[3]:.0f}" )
# Expected output:
# Center = (0, 0, 1)
# Radius = 3
 @n type of curve_id:  int
Parameters
curve_id ID of the RefEdge to query.
return type of : std:: array< double,4 >
Returns
Array of four doubles: [0] = center.x, [1] = center.y, [2] = center.z, [3] = radius; returns {0,0,0,0} on unsupported curve types or failure.

◆ get_arc_length()

def cubit.get_arc_length (   curve_id )

Get the parametric (arc) length of a specified curve.

Returns the length measured along the curve's parameterization. For most curves in Cubit, this matches the physical 3D length, but for certain spline or NURBS representations, arc length may be computed by integrating the parametric form.

.. code-block:: python
# Create a cylinder of radius 1 (curves 1 and 2 are circular edges).
cubit.cmd ("create cylinder radius 1 height 2" )
# Curve 1 is a circle of radius 1: arc length = 2*PI.
arc_length = cubit.get_arc_length (1)
print("Curve 1 arc length:" , arc_length) # prints approximately 6.28319
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : float
Returns
The parametric (arc) length of the curve in model units.

◆ get_assembly_children()

def cubit.get_assembly_children (   assembly_id )

◆ get_assembly_classification_category()

def cubit.get_assembly_classification_category ( )

Get classification category metadata.


return type of : string

Returns
Classification category as a string.

◆ get_assembly_classification_level()

def cubit.get_assembly_classification_level ( )

Get classification level metadata.


return type of : string

Returns
Classification level as a string.

◆ get_assembly_description()

def cubit.get_assembly_description (   assembly_id )

Get the description of an assembly node.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Description string.

◆ get_assembly_file_format()

def cubit.get_assembly_file_format (   assembly_id )

Get the file format from which the assembly node was imported.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
File format string, e.g., "ACIS" or "STEP".

◆ get_assembly_instance()

def cubit.get_assembly_instance (   assembly_id )

Get the instance number of an assembly node.

Distinguishes nodes with the same name.
type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : int
Returns
Instance number.

◆ get_assembly_items()

def cubit.get_assembly_items ( )

◆ get_assembly_level()

def cubit.get_assembly_level (   assembly_id )

Get the hierarchy level of an assembly node.

Level 0 is the root.
type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : int
Returns
Integer hierarchy level.

◆ get_assembly_material_description()

def cubit.get_assembly_material_description (   assembly_id )

Get the material description for a part.


type of assembly_id: int

Parameters
assembly_id ID of the part node.
return type of : string
Returns
Material description string.

◆ get_assembly_material_specification()

def cubit.get_assembly_material_specification (   assembly_id )

Get the material specification for a part.


type of assembly_id: int

Parameters
assembly_id ID of the part node.
return type of : string
Returns
Material specification string.

◆ get_assembly_metadata()

def cubit.get_assembly_metadata (   volume_id,
  data_type 
)

Get metadata for a specified volume.

Returns metadata associated with a volume's part, such as part number, description, material info, or file reference.
type of volume_id: int

Parameters
volume_id ID of the volume.
type of data_type: int
data_type Integer representing the metadata type: 1 = Part Number, 2 = Description, 3 = Material Description, 4 = Material Specification, 5 = Assembly Path, 6 = Original File.
return type of : string
Returns
Corresponding metadata string.

◆ get_assembly_name()

def cubit.get_assembly_name (   assembly_id )

Get the name of an assembly node.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Name string of the node.

◆ get_assembly_path()

def cubit.get_assembly_path (   assembly_id )

Get the full path of an assembly node, identifying its hierarchy.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Full path string, e.g., "/root/subassembly/part".

◆ get_assembly_type()

def cubit.get_assembly_type (   assembly_id )

Get the type of an assembly node ("part" or "assembly").


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Type string.

◆ get_assembly_units()

def cubit.get_assembly_units (   assembly_id )

Get the units of measurement used in the assembly node.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Units string, e.g., "mm", "inch".

◆ get_assembly_weapons_category()

def cubit.get_assembly_weapons_category ( )

Get weapons category metadata.


return type of : string

Returns
Weapons category as a string.

◆ get_auto_size()

def cubit.get_auto_size (   geometry_type,
  entity_id_list,
  auto_factor 
)

Predict the automatic mesh size for a set of entities.

Calculates the mesh size (target edge length) that would be applied if the command 'size auto factor n' were issued on the given entities. This does not modify the model or set any sizes-it only returns the value.

.. code-block:: python
import cubit
# Predict auto mesh size with factor 3 on surfaces 4 and 5
size = cubit.get_auto_size ("surface" , [4, 5], 3.0)
print("Predicted auto mesh size:" , size)
 @n type of geometry_type:  string
Parameters
geometry_type Entity type: "curve", "surface", or "volume".
type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_list Vector of IDs for the specified entities.
type of auto_factor: float
auto_factor The factor n used in size auto factor n.
return type of : float
Returns
The mesh size that would result from auto-sizing.

◆ get_bc_id_list()

def cubit.get_bc_id_list (   bc_type_enum )

Get active boundary condition (BC) IDs of a specified type.

Returns a list of active BC IDs matching the given type enum.


type of bc_type_enum: int

Parameters
bc_type_enum Boundary condition type enum (CI_BCTypes). FEA types: 1-9, CFD types: 10-30.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of active BC IDs.

◆ get_bc_name()

def cubit.get_bc_name (   bc_type_enum,
  bc_id 
)

Get the name of a specific boundary condition (BC).

Retrieves the name associated with a given BC ID and type.


type of bc_type_enum: int

Parameters
bc_type_enum BC type enum (CI_BCTypes).
type of bc_id: int
bc_id ID of the boundary condition.
return type of : string
Returns
Name string of the specified BC.

◆ get_bc_temperature()

def cubit.get_bc_temperature (   bc_type_enum,
  entity_id,
  temp_type_enum 
)

Get the temperature value for a specified BC area.


type of bc_type_enum: int

Parameters
bc_type_enum BC type (temperature = 4, convection = 7).
type of entity_id: int
entity_id ID of the BC.
type of temp_type_enum: int
temp_type_enum CI_BCEntityTypes for area: 2 (solid convection), 3 (solid temp), 7 (top), 8 (bottom), 9 (gradient), 10 (middle).
return type of : float
Returns
Temperature value.

◆ get_blend_chain_collections()

def cubit.get_blend_chain_collections (   volume_list,
  radius_threshold 
)

Return collections of surfaces that form blend chains in the specified volumes.

A blend chain is a group of contiguous surfaces that together form a smooth transition feature, such as a fillet or round. Blend chains are filtered by their computed radius.

If radius_threshold is provided, only blend chains with radius less than this value are returned.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 2 12 8 11 blend radius 1" ) # Surfaces 7, 8, 9, 10 are created
volume_ids = [1]
radius_thresh = 2.0
blend_collections = cubit.get_blend_chain_collections (volume_ids, radius_thresh)

for surfaces, radius in blend_collections: print("Blend chain surfaces:", tuple(surfaces), "Radius:", radius)

# Expected output:
# Blend chain surfaces: (7, 8, 9, 10), Radius: 1.0
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of radius_threshold: float
radius_threshold Return only blend chains whose computed radius is less than this value.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
: A list of pairs each pair contains (1) a list of surface IDs defining a blend chain, and (2) the computed radius of the blend chain.

◆ get_blend_chains()

def cubit.get_blend_chains (   surface_id )

Returns the blend chains for a given surface.

Given a surface ID, this function returns all blend chains associated with that surface. If the surface is part of one or more blend chains, each chain will be returned as a list of surface IDs.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 12 2 8 11 blend radius 1" ) # Blend the four curves on surface 5
surface_id = 10
blend_chains = cubit.get_blend_chains (surface_id)

for chain in blend_chains: print("Blend chain:", tuple(chain))

# Expected output:
# Blend chain: (7, 8, 9, 10)
 @n type of surface_id:  int
Parameters
surface_id Surface to retrieve the blend chains from.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A list of lists of surface IDs in each blend chain.
Note
If using Python, lists will be returned as Python tuples.

◆ get_blend_surfaces()

def cubit.get_blend_surfaces (   target_volume_ids )

Find blend (fillet) surfaces within specified volumes.

Iterates over all faces of volumes in target_volume_ids and returns those for which is_blend_surface returns true.

.. code-block:: python
# Create a 2x2x2 brick and fillet edge 1 with radius 0.5.
cubit.cmd ("brick x 2 y 2 z 2" )
cubit.cmd ("modify curve 1 blend radius 0.5" )
# Identify blend surfaces in volume 1.
blends = cubit.get_blend_surfaces ([1])
print(blends) # expect [7]
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of surfaces that are blends (fillets).

◆ get_block_attribute_count()

def cubit.get_block_attribute_count (   block_id )

Get the number of attributes assigned to a block.

Each block can store up to 20 attributes, which represent physical properties like material parameters.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 attribute count 3" )
print("Attribute count:" , attr_count)
# Expected output: Attribute count: 3
 @n type of block_id:  int
Parameters
block_id The ID of the block to query.
return type of : int
Returns
The number of attributes currently assigned to the block.

◆ get_block_attribute_name()

def cubit.get_block_attribute_name (   block_id,
  attribute_index 
)

Get the name of a specific attribute for a block.

Returns the name associated with the attribute at the specified index for a given block. Attribute names are typically assigned to describe the purpose or meaning of each attribute, such as "thickness" or "thermal_conductivity".

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 attribute count 2" )
cubit.cmd ("block 1 attribute index 1 10.0" )
cubit.cmd ("block 1 attribute name 1 'thickness'" )
attr_name = cubit.get_block_attribute_name (1, 1)
print("Attribute name at index 1:" , attr_name)
# Expected output: Attribute name at index 1: thickness
 @n type of block_id:  int
Parameters
block_id ID of the block.
type of attribute_index: int
attribute_index Index of the attribute (1-based).
return type of : string
Returns
Name of the attribute at the specified index.

◆ get_block_attribute_value()

def cubit.get_block_attribute_value (   block_id,
  attribute_index 
)

Get the value of a specific attribute for a block.

Returns the floating-point value of the attribute at the specified index for a given block. Attributes are user-defined values assigned to represent physical or material properties in a block, such as shell thickness or temperature.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 attribute count 2" )
cubit.cmd ("block 1 attribute index 2 5.5" )
attr_value = cubit.get_block_attribute_value (1, 2)
print("Attribute value at index 2:" , attr_value)
# Expected output: Attribute value at index 2: 5.5
 @n type of block_id:  int
Parameters
block_id ID of the block.
type of attribute_index: int
attribute_index Index of the attribute (1-based).
return type of : float
Returns
Value of the attribute at the specified index.

◆ get_block_count()

def cubit.get_block_count ( )

Get the current number of element blocks in the model.

In Cubit, an element block groups related mesh elements of the same type into a single entity. Blocks can be defined by geometric entities (volumes, surfaces, curves) or by directly specifying mesh entities. Once defined, all elements owned by those entities become part of the block.

.. code-block:: python
# Create a 10x10x10 brick and mesh it.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
# Define block 20 to contain volume 1.
cubit.cmd ("Block 20 add volume 1" )
# get_block_count() returns 1.
print("Block count:" , count) # prints 1
 @n return type of :  int
Returns
The number of element blocks currently defined in the model.

◆ get_block_curves()

def cubit.get_block_curves (   block_id )

Get the list of curve IDs contained in a block.

This function returns the IDs of all curves that are part of the specified block.

.. code-block:: python
# Create a brick and assign curves 1 to 12 to block 30
cubit.cmd ("brick x 10" )
cubit.cmd ("block 30 curve 1 to 12" )
# Query the curves in block 30
curve_ids = cubit.get_block_curves (30)
print(f"Block 30 contains {len(curve_ids)} curve(s)." )

for curve_id in curve_ids: print(f" Curve ID: {curve_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of curve IDs contained in the block.

◆ get_block_edges()

def cubit.get_block_edges (   block_id )

Get the list of edge IDs contained in a block.

This function returns the IDs of all edges that are part of the specified block.

.. code-block:: python
# Create a brick
cubit.cmd ("brick x 10" )
# Assign edges from curves in volume 1 to block 20
cubit.cmd ("block 20 edge in curve in vol 1" )
# Query the edges in block 20
edge_ids = cubit.get_block_edges (20)
print(f"Block 20 contains {len(edge_ids)} edge(s)." )

for edge_id in edge_ids: print(f" Edge ID: {edge_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of edge IDs contained in the block.

◆ get_block_element_attribute_count()

def cubit.get_block_element_attribute_count (   block_id )

Get the number of attributes defined for elements in the specified block.

This returns the number of attribute values associated with each element in a block. Attributes can represent properties like shell thickness, material coefficients, etc.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 attribute count 2" )
print("Element attribute count:" , count)
# Expected output: Element attribute count: 2
 @n type of block_id:  int
Parameters
block_id The ID of the block.
return type of : int
Returns
Number of element-level attributes defined in the block.

◆ get_block_element_attribute_names()

def cubit.get_block_element_attribute_names (   block_id )

Get the list of attribute names associated with block elements.

Returns the names of all attributes associated with the elements of a given block. These names describe the meaning of each attribute (e.g., "thickness", "material_id").

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 attribute count 2" )
cubit.cmd ("block 1 attribute index 1 10.0" )
cubit.cmd ("block 1 attribute index 2 25.0" )
cubit.cmd ("block 1 attribute name 1 'thickness'" )
cubit.cmd ("block 1 attribute name 2 'density'" )

for name in names: print(name)

# Expected output:
# thickness
# density
 @n type of block_id:  int
Parameters
block_id ID of the block.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of attribute names associated with the block elements.

◆ get_block_element_type()

def cubit.get_block_element_type (   block_id )

Get the element type associated with a block.

Returns the finite element type (e.g., HEX8, HEX20, TET10) used in the specified block.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 element type hex20" )
cubit.cmd ("mesh vol 1" )
print("Element type:" , elem_type)
# Expected output: Element type: HEX20
 @n type of block_id:  int
Parameters
block_id ID of the block to query.
return type of : string
Returns
A string indicating the element type used in the block.

◆ get_block_faces()

def cubit.get_block_faces (   block_id )

Get the list of face IDs contained in a block.

This function returns the IDs of all face elements that are part of the specified block.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign faces from surface 1 to block 40
cubit.cmd ("block 40 face in surface 1" )
# Query the faces in block 40
face_ids = cubit.get_block_faces (40)
print(f"Block 40 contains {len(face_ids)} face(s)." )

for face_id in face_ids: print(f" Face ID: {face_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of face IDs contained in the block.

◆ get_block_hexes()

def cubit.get_block_hexes (   block_id )

Get the list of hexahedron (hex) IDs contained in a block.

This function returns the IDs of all hexahedron (hex) elements that are part of the specified block.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign hexes in volume 1 to block 80
cubit.cmd ("block 80 hex in vol 1" )
# Query the hexes in block 80
hex_ids = cubit.get_block_hexes (80)
print(f"Block 80 contains {len(hex_ids)} hex(s)." )

for hex_id in hex_ids: print(f" Hex ID: {hex_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of hexahedron (hex) IDs contained in the block.

◆ get_block_id()

def cubit.get_block_id (   entity_type,
  entity_id 
)

Get the element block ID associated with a geometric entity.

Returns the ID of the element block that is associated with the specified curve, surface, or volume. A geometric entity may be assigned to only one block. If no block is assigned, this function returns 0.

.. code-block:: python
# Create geometry and assign it to a block
cubit.cmd ("brick x 10 y 10 z 10" )
cubit.cmd ("block 5 add volume 1" )
# Query the block ID associated with volume 1
block_id = cubit.get_block_id ("volume" , 1)
# Print the result
print("Block ID for volume 1:" , block_id)
# Expected output (example):
# Block ID for volume 1: 5
 @n type of entity_type:  string
Parameters
entity_type Type of the entity: "curve", "surface", or "volume".
type of entity_id: int
entity_id ID of the entity.
return type of : int
Returns
Block ID associated with the entity, or zero (0) if none.

◆ get_block_id_list()

def cubit.get_block_id_list ( )

Get a list of all active block IDs.

Returns a vector of all currently active element block IDs in the model. A geometric entity may be assigned to only one block.

.. code-block:: python
# Create geometry
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 2 mov x 10" )
# Create a blocks and assign volumes
cubit.cmd ("block 10 vol 1" )
cubit.cmd ("block 20 vol 2" )
# Query all active block IDs
block_ids = cubit.get_block_id_list ()
# Print the block IDs
print("Active block IDs:" )

for block_id in block_ids: print(" Block ID:", block_id)

# Expected output (example):
# Active block IDs:
# Block ID: 10
# Block ID: 20
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
Vector (Python tuple) of all active block IDs.

◆ get_block_ids()

def cubit.get_block_ids (   mesh_geometry_file_name )

Get list of block IDs from a mesh geometry file.

Opens a mesh geometry file (Exodus II format) and returns a vector of all element block IDs defined in the file. This allows users to inspect available blocks before importing the mesh, and to selectively import blocks by ID.

.. code-block:: python
# Query all block IDs in a mesh geometry file
block_ids = cubit.get_block_ids ("mesh_geometry.e" )
# Print the block IDs
print("Available block IDs:" )

for block_id in block_ids: print(" Block ID:", block_id)

# Expected output (example):
# Available block IDs:
# Block ID: 1
# Block ID: 5
# Block ID: 10
 @n type of mesh_geometry_file_name:  string
Parameters
mesh_geometry_file_name Fully qualified name of a mesh geometry file (Exodus II format).
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector (Python tuple) of block IDs defined in the mesh geometry file.

◆ get_block_material()

def cubit.get_block_material (   block_id )

Get the ID of the material assigned to the specified block.

Returns the material ID associated with the block. This ID corresponds to a defined material (as created with material commands). A value of 0 indicates that no material is currently assigned.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("material 1 name 'Steel'" )
cubit.cmd ("block 1 material 1" )
print("Material ID:" , mat_id)
 @n type of block_id:  int
Parameters
block_id ID of the block.
return type of : int
Returns
Material ID assigned to the block, or 0 if none.

◆ get_block_nodes()

def cubit.get_block_nodes (   block_id )

Get the list of node IDs contained in a block.

This function returns the IDs of all nodes that are part of the specified block.

.. code-block:: python
# Create a brick and mesh it
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign nodes from surface 1 to block 1
cubit.cmd ("block 1 node in surface 1" )
# Query the nodes in block 1
node_ids = cubit.get_block_nodes (1)
print(f"Block 1 contains {len(node_ids)} node(s)." )

for node_id in node_ids: print(f" Node ID: {node_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs contained in the block.

◆ get_block_pyramids()

def cubit.get_block_pyramids (   block_id )

Get the list of pyramid IDs contained in a block.

This function returns the IDs of all pyramid elements that are part of the specified block.

Note
In Cubit, only one type of element can be assigned to a block. To separate element types, use multiple blocks. For example, after meshing with tets and pyramids, assign tets and pyramids to separate blocks as shown below.
.. code-block:: python
# Create two bricks and mesh them with different schemes
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
cubit.cmd ("merge all" )
cubit.cmd ("vol 1 scheme map" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("vol 2 scheme tetmesh" )
cubit.cmd ("mesh vol 2" )
# Assign tets and pyramids in volume 2 to separate blocks
cubit.cmd ("block 2 tet in vol 2" )
cubit.cmd ("block 3 pyramid in vol 2" )
# Query the pyramids in block 3
pyramid_ids = cubit.get_block_pyramids (3)
print(f"Block 3 contains {len(pyramid_ids)} pyramid(s)." )

for pyr_id in pyramid_ids: print(f" Pyramid ID: {pyr_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of pyramid IDs contained in the block.

◆ get_block_surfaces()

def cubit.get_block_surfaces (   block_id )

Get the list of surface IDs contained in a block.

This function returns the IDs of all surfaces that are part of the specified block.

.. code-block:: python
# Create a brick and assign surfaces 1 to 6 to block 20
cubit.cmd ("brick x 10" )
cubit.cmd ("block 20 surface 1 to 6" )
# Query the surfaces in block 20
surface_ids = cubit.get_block_surfaces (20)
print(f"Block 20 contains {len(surface_ids)} surface(s)." )

for surf_id in surface_ids: print(f" Surface ID: {surf_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs contained in the block.

◆ get_block_tets()

def cubit.get_block_tets (   block_id )

Get the list of tetrahedron (tet) IDs contained in a block.

This function returns the IDs of all tetrahedron (tet) elements that are part of the specified block.

.. code-block:: python
# Create a brick and tetmesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Assign tets in volume 1 to block 60
cubit.cmd ("block 60 tet in vol 1" )
# Query the tets in block 60
tet_ids = cubit.get_block_tets (60)
print(f"Block 60 contains {len(tet_ids)} tet(s)." )

for tet_id in tet_ids: print(f" Tet ID: {tet_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of tetrahedron (tet) IDs contained in the block.

◆ get_block_tris()

def cubit.get_block_tris (   block_id )

Get the list of triangle (tri) IDs contained in a block.

This function returns the IDs of all triangle elements that are part of the specified block.

.. code-block:: python
# Create a brick and tetmesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Assign triangles from surface 1 to block 30
cubit.cmd ("block 30 tri in surface 1" )
# Query the triangles in block 30
tri_ids = cubit.get_block_tris (30)
print(f"Block 30 contains {len(tri_ids)} triangle(s)." )

for tri_id in tri_ids: print(f" Tri ID: {tri_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of triangle (tri) IDs contained in the block.

◆ get_block_vertices()

def cubit.get_block_vertices (   block_id )

Get the list of vertex IDs contained in a block.

This function returns the IDs of all vertices that are part of the specified block.

.. code-block:: python
# Create a brick and assign vertices 1 to 8 to block 40
cubit.cmd ("brick x 1" )
cubit.cmd ("block 40 vertex 1 to 8" )
# Query the vertices in block 40
vertex_ids = cubit.get_block_vertices (40)
print(f"Block 40 contains {len(vertex_ids)} vertex(s)." )

for vertex_id in vertex_ids: print(f" Vertex ID: {vertex_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of vertex IDs contained in the block.

◆ get_block_volumes()

def cubit.get_block_volumes (   block_id )

Get the list of volume IDs contained in a block.

This function returns the IDs of all volumes that are part of the specified block.

.. code-block:: python
# Create a brick and assign it to block 1
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
# Query the volumes in block 1
volume_ids = cubit.get_block_volumes (1)
print(f"Block 1 contains {len(volume_ids)} volume(s)." )

for vol_id in volume_ids: print(f" Volume ID: {vol_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of volume IDs contained in the block.

◆ get_block_wedges()

def cubit.get_block_wedges (   block_id )

Get the list of wedge IDs contained in a block.

This function returns the IDs of all wedge elements that are part of the specified block.

.. code-block:: python
# Create a brick and mesh surface 1 with triangles
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 scheme trimesh" )
cubit.cmd ("mesh surface 1" )
# Sweep the surface mesh to create wedges
cubit.cmd ("vol 1 scheme sweep" )
cubit.cmd ("mesh vol 1" )
# Assign wedges in volume 1 to block 50
cubit.cmd ("block 50 wedge in vol 1" )
# Query the wedges in block 50
wedge_ids = cubit.get_block_wedges (50)
print(f"Block 50 contains {len(wedge_ids)} wedge(s)." )

for wedge_id in wedge_ids: print(f" Wedge ID: {wedge_id}")

  @n type of block_id:  int
Parameters
block_id ID of the block to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of wedge IDs contained in the block.

◆ get_blocks_with_materials()

def cubit.get_blocks_with_materials ( )

Get all block IDs and their associated material IDs.

Returns a list of all existing block IDs and the corresponding material ID assigned to each. This function helps identify which blocks are assigned materials. Blocks without an assigned material will have a material ID of 0 in the returned pair.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("material 1 name 'Steel'" )
cubit.cmd ("block 1 material 1" )

for pair in block_mats: print("Block", pair[0], "has material", pair[1])

  @n return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
List of [block_id, material_id] pairs. Material ID is 0 if unassigned.

◆ get_blunt_tangency_default_depth()

def cubit.get_blunt_tangency_default_depth (   vert_id,
  angle,
  add_material 
)

Computes the default depth used to blunt a tangency at a vertex.

Used with the blunt tangency command to eliminate small angles caused by fillets. This function estimates the default depth parameter based on the specified angle and whether material is added or removed.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 5 height 10" )
cubit.cmd ("vol 2 mov z 10" )
cubit.cmd ("unite vol 1 2" )
depth = cubit.get_blunt_tangency_default_depth (12, 10.0, True )
print("Default depth:" , depth)
 @n type of vert_id:  int
Parameters
vert_id ID of the vertex to modify.
type of angle: float
angle Desired target angle after blunting.
type of add_material: boolean
add_material If true, material is added; if false, material is removed.
 @n return type of :  float
Returns
Suggested depth value for the operation.

◆ get_body_count()

def cubit.get_body_count ( )

Get the current number of bodies in the model.

.. code-block:: python

# Create two bricks as separate bodies.
cubit.cmd ("brick x 10" ) # body 1
cubit.cmd ("brick x 5" ) # body 2
body_count = cubit.get_body_count () # returns 2
print("Body count:" , body_count)
 @n return type of :  int
Returns
The number of bodies currently defined in the model.

◆ get_bolt_axis()

def cubit.get_bolt_axis (   vol_id )

Get the normalized axis vector of a bolt volume.

Returns the primary axis direction of the specified bolt geometry, normalized to unit length. If the volume is invalid or the axis cannot be determined, the returned vector will be [0, 0, 0].

.. code-block:: python
axis = cubit.get_bolt_axis (2)
print("Bolt axis:" , axis)


type of vol_id: int

Parameters
vol_id Volume ID representing a bolt geometry.
return type of : std::vector< double,std:: allocator< double > >
Returns
Normalized axis vector of the bolt, or [0, 0, 0] if invalid.

◆ get_bolt_clamped_members()

def cubit.get_bolt_clamped_members (   vol_ids,
  nearby_vols,
  progress = None 
)

Identify clamped members associated with a bolt.

Returns the ordered list of volume IDs that represent the bolt's clamped components:

  • Bearing surface member
  • Sandwiched members (if any)
  • Threaded member

If nearby_vols is empty, Cubit will automatically determine nearby volumes (less efficient).

   .. code-block:: python
clamped = cubit.get_bolt_clamped_members ([12], [])

for group in clamped: print(group)

   @n type of vol_ids:  std::vector< int,std::allocator< int > >
Parameters
vol_ids List of bolt volume IDs.
type of nearby_vols: std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > >
nearby_vols Optional list of nearby volume IDs for each bolt. Leave empty to compute automatically.
type of progress: :py:class: CubitProgressHandler, optional
progress Optional CubitProgressHandler for monitoring progress.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
: Nested list one entry per bolt, each a list of volume IDs representing clamped members.

◆ get_bolt_coordinate_system()

def cubit.get_bolt_coordinate_system (   geom_type,
  id 
)

Get local coordinate system for a bolt or bolt hole.

Returns the coordinate system as three 3D points defining the origin, the Z-direction point, and a point in the XZ plane. This is useful for aligning or analyzing bolt and hole geometry in local space.

For hole-based queries, only one surface from the hole is needed; it must uniquely identify the hole.

   .. code-block:: python
# For a bolt volume
bolt_coord = cubit.get_bolt_coordinate_system ("bolt" , 12)
origin = bolt_coord[0]
z_axis_point = bolt_coord[1]
xz_plane_point = bolt_coord[2]
# For a hole surface
hole_coord = cubit.get_bolt_coordinate_system ("hole" , 35)
h_origin = hole_coord[0]
h_z_axis_point = hole_coord[1]
h_xz_plane_point = hole_coord[2]
  @n type of geom_type:  string
Parameters
geom_type "bolt" for bolt volume or "hole" for hole surface.
type of id: int
id Volume ID for bolts or surface ID from the hole geometry.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
: Three 3D points as vectors origin, Z-direction point, and XZ-plane point.

◆ get_bolt_diameters()

def cubit.get_bolt_diameters (   vol_ids )

Get the shank diameters of specified bolt volumes.

Returns the estimated shank diameter for each volume in the input list. Volumes that are invalid or for which the diameter cannot be determined will return a value of 0.

.. code-block:: python
diameters = cubit.get_bolt_diameters ([2, 3])
print("Bolt diameter for vol 2:" , diameters[0])
print("Bolt diameter for vol 3:" , diameters[1])


type of vol_ids: std::vector< int,std::allocator< int > >

Parameters
vol_ids Volume IDs representing bolt geometries.
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector of shank diameters (in same order as vol_ids).

◆ get_bolt_holes()

def cubit.get_bolt_holes (   geo_type,
  clamped_members,
  radius_threshold,
  gap_threshold 
)

Identify upper and lower pilot hole surfaces from clamped members.

Analyzes the provided volumes or blocks to extract the top and bottom surfaces of pilot holes (e.g., for bolts) based on radius and proximity criteria. The output can be passed directly to reduce bolt commands.

.. code-block:: python
clamped_vols = [301, 302, 303]
upper_surfs, lower_surfs = cubit.get_bolt_holes ("volume" , clamped_vols, 6.0, 0.25)
 @n type of geo_type:  string
Parameters
geo_type "volume" or "block", specifying clamped member type.
type of clamped_members: std::vector< int,std::allocator< int > >
clamped_members IDs of volumes or blocks with candidate pilot holes.
type of radius_threshold: float
radius_threshold Maximum radius for a hole to be considered.
type of gap_threshold: float
gap_threshold Maximum separation for concentric hole matching.
 @n return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A vector of two surface ID lists:
  • First list: upper hole surfaces.
  • Second list: lower hole surfaces (may include more than one per hole).

◆ get_bolt_holes_info()

def cubit.get_bolt_holes_info (   geo_type,
  clamped_members,
  radius_threshold,
  gap_threshold 
)

Identify concentric pilot holes across clamped members.

Analyzes a list of clamped volumes or blocks to identify sets of concentric holes that qualify as bolt pilot holes, based on a maximum radius and proximity criteria. Returns detailed information including hole surfaces, radii, axes, and associated volumes.

.. code-block:: python
clamped_vols = [301, 302, 303]
pilot_holes = cubit.get_bolt_holes_info ("volume" , clamped_vols, 6.0, 0.25)

for hole in pilot_holes: print("Bearing volume:", hole.bearingVolume, "radius:", hole.bearingRadius)

  @n type of geo_type:  string
Parameters
geo_type "volume" or "block", specifying how the clamped members are defined.
type of clamped_members: std::vector< int,std::allocator< int > >
clamped_members IDs of volumes or blocks potentially containing pilot holes.
type of radius_threshold: float
radius_threshold Maximum hole radius to be considered a pilot hole.
type of gap_threshold: float
gap_threshold Maximum gap between concentric holes to be treated as aligned.
  @n return type of : std::vector< BoltHoleInfo,std:: allocator< BoltHoleInfo > >
Returns
A list of BoltHoleInfo structs containing:
  • bearing hole surface IDs and volume,
  • bearing hole axis and radius,
  • thread hole surface IDs, volumes, axes, and radii,
  • bounding box of the full hole set and total volume.

◆ get_bolt_shigley_radius()

def cubit.get_bolt_shigley_radius (   bolt_id,
  angle,
  washer_id = 0 
)

Get the equivalent Shigley frustum radius at the bolt interface.

Calculates the radius of a Shigley-style frustum representing the stress cone between upper and lower volumes surrounding a bolt. This is typically used to evaluate stress distribution. A standard angle of 30 degrees is common.

Optionally accounts for a washer in the bolt-washer clamp mechanism by specifying its entity ID (set to 0 if no washer is used).

.. code-block:: c++
# Without washer
radius1 = cubit.get_bolt_shigley_radius (2, 0, 30.0)
print("Shigley radius (no washer):" , radius1)
# With washer (ID 5)
radius2 = cubit.get_bolt_shigley_radius (2, 5, 30.0)
print("Shigley radius (with washer):" , radius2)


type of bolt_id: int

Parameters
bolt_id ID of the bolt volume entity.
type of washer_id: int, optional
washer_id Optional ID of the washer entity in the bolt-washer mechanism (use 0 if none).
type of angle: float
angle Cone half-angle in degrees (typical value is 30).
return type of : float
Returns
Radius at the bolt interface, or x1 if it cannot be computed.

◆ get_bolt_washer()

def cubit.get_bolt_washer (   bolt_id )

Get the washer volume ID associated with a given bolt.

Returns the volume ID of the washer corresponding to the specified bolt ID. If no washer is associated with the bolt, the function returns 0.

   .. code-block:: python
# Assume bolt 1 has been created
washer_id = cubit.get_bolt_washer (1)
print("Washer volume ID:" , washer_id)
  @n type of bolt_id:  int
Parameters
bolt_id The ID of the bolt whose washer volume ID is requested.
return type of : int
Returns
The volume ID of the washer associated with the bolt, or 0 if none exists.

◆ get_bolts_in_clamped_members()

def cubit.get_bolts_in_clamped_members (   geo_type,
  clamped_vols,
  candidate_bolts 
)

Identify bolts clamping the given volumes or blocks.

Performs ML-based classification on provided candidate volumes to identify which are bolts, then checks which of those bolts clamp the specified clamped members.

.. code-block:: python
clamped_ids = [201, 202]
candidate_bolts = [100, 105, 110]
bolts = cubit.get_bolts_in_clamped_members ("volume" , clamped_ids, candidate_bolts)
print(bolts)
 @n type of geo_type:  string
Parameters
geo_type "volume" or "block", indicating the type of clamped entities.
type of clamped_vols: std::vector< int,std::allocator< int > >
clamped_vols List of volume or block IDs that are clamped by one or more bolts.
type of candidate_bolts: std::vector< int,std::allocator< int > >
candidate_bolts Volumes to consider as potential bolts. ML classification is run on them to identify actual bolts.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of volume IDs classified as bolts that clamp the given entities.

◆ get_bool_sculpt_default()

def cubit.get_bool_sculpt_default (   variable )

Retrieve default boolean-valued sculpt parameter.

Matches the input variable name substring to known sculpt parameters and returns its default.

Title Available boolean parameters

  • OVERWRITE
  • EXECUTE
  • VOID
  • SEPARATE_VOID_BLOCKS
  • HTET
    * PATH_ABSOLUTE, PATH_COMMAND
    * CLEAN, SHOW, IMPORT, COMBINE
  • BBOX_EXPAND
  • GEN_INPUT_FILE
  • PERIODIC
    * PILLOW_SURFACES, PILLOW_CURVES, PILLOW_BOUNDARIES, PILLOW_SMOOTH
  • DEFEATURE_BBOX
    * ADAPT_EXPORT, ADAPT_NON_MANIFOLD, USE_DEFAULT_ADAPT_THRESHOLD
    * QUALITY, COMPARE_VOLUME, COMPUTE_SS_STATS
    * WRITE_GEOM, WRITE_MBG
  • UNIQUE_GENESIS_IDS


type of variable: string

Parameters
variable Name of the sculpt parameter substring.
return type of : boolean
Returns
Default boolean value for the specified parameter.

◆ get_boundary_layer_algorithm()

def cubit.get_boundary_layer_algorithm (   boundary_layer_id )

Get the algorithm type used by the specified boundary layer.

Returns the name of the algorithm (e.g., "Structured", "Unstructured").
type of boundary_layer_id: int

Parameters
boundary_layer_id ID of the boundary layer.
return type of : string
Returns
Algorithm name as a string.

◆ get_boundary_layer_continuity()

def cubit.get_boundary_layer_continuity (   boundary_layer_id )

Get the continuity setting of a boundary layer.

Indicates whether the boundary layer is continuous across adjacent entities.
type of boundary_layer_id: int

Parameters
boundary_layer_id ID of the boundary layer.
return type of : boolean
Returns
True if the boundary layer is continuous; otherwise false.

◆ get_boundary_layer_id_list()

def cubit.get_boundary_layer_id_list ( )

Get a list of all defined boundary layer IDs.


return type of : std::vector< int,std:: allocator< int > >

Returns
List of boundary layer IDs currently defined in the model.

◆ get_boundary_layers_by_base()

def cubit.get_boundary_layers_by_base (   base_type,
  base_id 
)

Get all boundary layers associated with a specified base entity.

Retrieves boundary layer IDs that use the given base entity.
type of base_type: string

Parameters
base_type Type of base entity (e.g., "surface", "volume").
type of base_id: int
base_id ID of the base entity.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of boundary layer IDs using the specified base.

◆ get_boundary_layers_by_pair()

def cubit.get_boundary_layers_by_pair (   base_type,
  base_id,
  parent_id 
)

Get all boundary layers associated with a base-parent pair.

Returns boundary layers defined using both the base and parent entities.
type of base_type: string

Parameters
base_type Type of base entity (e.g., "surface", "volume").
type of base_id: int
base_id ID of the base entity.
type of parent_id: int
parent_id ID of the parent entity.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of boundary layer IDs that match the base-parent pair.

◆ get_bounding_box()

def cubit.get_bounding_box (   geometry_type,
  entity_id 
)

Get the axis-aligned bounding box for a specified entity.

.. code-block:: python

bbox = cubit.get_bounding_box ("surface" , 22)
print(bbox) # Displays 10 values: minx, maxx, rangex, miny, maxy, rangey, minz, maxz, rangez, diagonal
 @n type of geometry_type:  string
Parameters
geometry_type Specifies the geometry type ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity.
return type of : std:: array< double,10 >
Returns
A 10-element array containing the bounding box parameters.

Title: Array contents

  • [0] min x coordinate
  • [1] max x coordinate
  • [2] x-range (max x ? min x)
  • [3] min y coordinate
  • [4] max y coordinate
  • [5] y-range (max y ? min y)
  • [6] min z coordinate
  • [7] max z coordinate
  • [8] z-range (max z ? min z)
  • [9] diagonal length of the box

◆ get_build_number()

def cubit.get_build_number ( )

Retrieve the Cubit build number.

Returns the build identifier for the current Cubit binary.

.. code-block:: python
import cubit
build_number = cubit.get_build_number ()
print("Build number:" , build_number)
 @n return type of :  string
Returns
A string containing the current Cubit build number.

◆ get_cavity_surfaces()

def cubit.get_cavity_surfaces (   surface_id )

Return the surfaces in the cavity adjacent to the specified surface.

The function returns a list of surface IDs that belong to the same cavity as the given surface. The input surface_id must already be part of a cavity. The result includes surface_id itself.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
cubit.cmd ("vol 5 move x 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
surf_id = 17
cavity_surfs = cubit.get_cavity_surfaces (surf_id)
print("Cavity surfaces:" , tuple(cavity_surfs))
# Expected output:
# Cavity surfaces: (17, 15, 16, 13, 14)
 @n type of surface_id:  int
Parameters
surface_id Surface ID that is part of a cavity.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of surface IDs belonging to the cavity (includes surface_id itself).

◆ get_center_point()

def cubit.get_center_point (   entity_type,
  entity_id 
)

Get the 3D center or coordinates of a specified entity.

Returns the centroid for geometry entities (body, volume, surface), midpoint for curves, coordinates for vertices, or center for mesh entities (node, edge, face, tri, quad, hex, tet, wedge, pyramid, sphere).

.. code-block:: python
cubit.cmd ("brick x 10" )
center = cubit.get_center_point ("surface" , 1)
print("Surface 1 center:" , center) # (0.0, 0.0, 5.0)
# For a vertex:
vcoord = cubit.get_center_point ("vertex" , 12)
print("Vertex 12 coords:" , vcoord)
 @n type of entity_type:  string
Parameters
entity_type Entity type: "body", "volume", "surface", "curve", "vertex", "node", "edge", "face", "tri", "quad", "hex", "tet", "wedge", "pyramid", or "sphere".
type of entity_id: int
entity_id ID of the entity to query.
return type of : std:: array< double,3 >
Returns
A 3-element array [x, y, z] representing the entity's center or vertex coordinates.

◆ get_cfd_type()

def cubit.get_cfd_type (   entity_id )

Get the CFD boundary condition subtype.


type of entity_id: int

Parameters
entity_id ID of the CFD boundary condition.
return type of : int
Returns
CFD type as defined in CI_BCTypes.

◆ get_chamfer_chain_collections()

def cubit.get_chamfer_chain_collections (   volume_list,
  thickness_threshold 
)

Return collections of surfaces that form chamfer chains in the specified volumes.

A chamfer chain is a group of contiguous planar surfaces that together form a chamfer feature. Chamfer chains are filtered by their computed thickness (distance between chamfer edges).

If thickness_threshold is provided, only chamfer chains with thickness less than this value are returned.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 2 12 8 11 chamfer radius 1" ) # Surfaces 7, 8, 9, 10 are created
volume_ids = [1]
thickness_thresh = 2.0
chamfer_collections = cubit.get_chamfer_chain_collections (volume_ids, thickness_thresh)

for surfaces, thickness in chamfer_collections: print("Chamfer chain surfaces:", tuple(surfaces), "Thickness:", thickness)

# Expected output:
# Chamfer chain surfaces: (7, 8, 9, 10), Thickness: 1.0
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of thickness_threshold: float
thickness_threshold Return only chamfer chains whose computed thickness is less than this value.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
: A list of pairs each pair contains (1) a list of surface IDs defining a chamfer chain, and (2) the computed thickness of the chamfer chain.

◆ get_chamfer_chains()

def cubit.get_chamfer_chains (   surface_id )

Returns the chamfer chains for a given surface.

Given a surface ID, this function returns all chamfer chains associated with that surface. If the surface is part of one or more chamfer chains, each chain will be returned as a list of surface IDs.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 4 1 2 3 chamfer radius 1" ) # Chamfer the four curves on surface 5
surface_id = 10
chamfer_chains = cubit.get_chamfer_chains (surface_id)

for chain in chamfer_chains: print("Chamfer chain:", tuple(chain))

# Expected output:
# Chamfer chain: (7, 8, 9, 10)
 @n type of surface_id:  int
Parameters
surface_id Surface to retrieve the chamfer chains from.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A list of lists of surface IDs in each chamfer chain.
Note
If using Python, lists will be returned as Python tuples.

◆ get_chamfer_surfaces()

def cubit.get_chamfer_surfaces (   target_volume_ids,
  thickness_threshold 
)

Get the list of chamfer surfaces for a list of volumes.


type of target_volume_ids: std::vector< int,std::allocator< int > >

Parameters
target_volume_ids List of volume ids to examine.
type of thickness_threshold: float
thickness_threshold max thickness criteria for chamfer
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
List (python tuple) of chamfer surface ids (as doubles) and their thicknesses

◆ get_close_loop_thickness()

def cubit.get_close_loop_thickness (   surface_id )

Compute the minimum separation distance between loops on a surface.

For a surface with two or more boundary loops, returns the smallest distance between any two loops. If the surface has fewer than two loops, returns 0.

.. code-block:: python
# Create two concentric cylinders and subtract inner from outer.
cubit.cmd ("cylinder x 3 height 10" )
cubit.cmd ("cylinder x 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
# Surface 9 has two loops; get their minimum separation.
print("Surface 9 thickness:" , thickness) # expect 1.0
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to measure.
return type of : float
Returns
Minimum loop-to-loop distance (thickness). Returns 0 if fewer than two loops.

◆ get_close_loops()

def cubit.get_close_loops (   target_volume_ids,
  mesh_size 
)

Find faces with multiple loops closer than a given threshold.

Iterates over all faces of volumes in target_volume_ids. A face is included if it has two or more boundary loops and the minimum distance between any two loops is <= mesh_size.

This differs from get_narrow_regions and get_surfs_with_narrow_regions by only checking loop-to-loop proximity on faces with multiple loops, rather than edge splits or oriented edge-pair tests.

.. code-block:: python
# Create two concentric cylinders and subtract inner from outer.
cubit.cmd ("cylinder x 3 height 10" )
cubit.cmd ("cylinder x 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
# Surface 9 has two loops separated by distance 1.
mesh_size = 1.0
close_loop_faces = cubit.get_close_loops ([1], mesh_size)
print(close_loop_faces) # expect [9]
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Distance threshold for loop separation.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of surface IDs whose loops lie within mesh_size of each other.

◆ get_close_loops_with_thickness()

def cubit.get_close_loops_with_thickness (   target_volume_ids,
  mesh_size,
  genus 
)

Find faces with multiple loops closer than a threshold and return their minimum loop separations.

Iterates over all faces of volumes in target_volume_ids. A face is included if it has (genus + 1) loops (where genus = num_loops - 1) and the minimum distance between any two loops is <= mesh_size. Returns a list of [surface_id, min_distance] pairs for each qualifying face.

This function differs from get_close_loops by filtering faces by genus and also returning the minimum loop-to-loop distance for each face.

.. code-block:: python
# Create two concentric cylinders and subtract inner from outer.
cubit.cmd ("cylinder x 3 height 10" )
cubit.cmd ("cylinder x 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
# Now surface 9 has two loops (genus = 1) separated by distance 1.
mesh_size = 1.0
genus = 1 # Only surfaces with exactly two loops.
results = cubit.get_close_loops_with_thickness ([1], mesh_size, genus)

for sid, dist in results: print("Surface", sid, "has min loop distance", dist) # expect: Surface 9 has min loop distance 1.0

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Distance threshold for loop separation.
type of genus: int
genus Number of loops minus one. To return faces of any genus, use genus < 0.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
Vector of [surface_id, min_distance] for each face whose loops lie within mesh_size and match the specified genus.

◆ get_close_vertex_curve_pairs()

def cubit.get_close_vertex_curve_pairs (   target_volume_ids,
  high_tolerance 
)

Find pairs of vertices and curves within a specified tolerance across given volumes.

Unlike get_coincident_vertices, which identifies vertices that coincide with other vertices, this function finds vertices that lie within high_tolerance of a curve. Iterates over all vertices and curves of volumes in target_volume_ids and returns pairs whose shortest distance is <= high_tolerance.

.. code-block:: python
# Create two 1x1x1 bricks and offset the second so its vertices are close to curves on the first.
cubit.cmd ("brick x 1" )
cubit.cmd ("brick x 1" )
cubit.cmd ("volume 2 move x 1 y 0.5" )
tol = 1e-6 # Tolerance for close detection.
pairs = cubit.get_close_vertex_curve_pairs ([1, 2], tol)
# Expected output: (15, 5, 12, 1, 5, 19, 2, 15)

for i in range(0, len(pairs), 2): print("Vertex", pairs[i], "is close to Curve", pairs[i+1])

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of high_tolerance: float
high_tolerance Distance threshold below which a vertex and a curve are considered close.
return type of : std::vector< int,std:: allocator< int > >
Returns
Flat vector of [vertex_id, curve_id, ...] representing close vertex-curve pairs.

◆ get_closed_narrow_surfaces()

def cubit.get_closed_narrow_surfaces (   target_ids,
  narrow_size 
)

Find faces on closed surfaces whose two boundary edges remain within a distance threshold.

A surface is "closed in U" (or "closed in V") if traversing its U (or V) parameter from minimum to maximum returns to the same point (no open edge). For each face of volumes in target_ids, the following criteria are applied:

  • The underlying surface is closed in U or V (no open boundary in that parametric direction).
  • The face has exactly two loops and exactly two edges (inner and outer boundaries).
  • Sampling five points uniformly along one edge, each point's shortest distance to the other edge must be <= narrow_size. Faces meeting all criteria are returned.

This function differs from get_narrow_regions and get_surfs_with_narrow_regions by only considering closed two-loop faces and sampling along their boundary loops, rather than testing all faces or arbitrary edge pairs.

.. code-block:: python
cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("modify curve 1 blend radius 0.5" )
cubit.cmd ("cylinder radius 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
narrow_thresh = 1.0
closed_narrow = cubit.get_closed_narrow_surfaces ([1], narrow_thresh)
print(closed_narrow) # expect two IDs
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_ids Vector of volume IDs whose faces are checked.
type of narrow_size: float
narrow_size Distance threshold for edge proximity.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of faces whose underlying surface is closed in U or V, has two loops, and whose two edges remain within narrow_size.

◆ get_closest_node()

def cubit.get_closest_node (   x_coordinate,
  y_coordinate,
  z_coordinate 
)

Find the mesh node closest to a given point.

This function searches the current mesh and returns the ID of the node whose coordinates are nearest to the specified (x, y, z) point. If the mesh contains no nodes, it returns 0.

.. code-block:: python
# Create a brick and mesh its volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Find the node closest to (5, 5, 5)
closest = cubit.get_closest_node (5.0, 5.0, 5.0)
print("Closest node to (5,5,5):" , closest)
 @n type of x_coordinate:  float
Parameters
x_coordinate X coordinate of the query point.
type of y_coordinate: float
y_coordinate Y coordinate of the query point.
type of z_coordinate: float
z_coordinate Z coordinate of the query point.
return type of : int
Returns
ID of the closest node, or 0 if no nodes are present.

◆ get_coincident_vertices()

def cubit.get_coincident_vertices (   target_volume_ids,
  high_tolerance 
)

Find vertex pairs within a specified tolerance across given volumes.

Iterates over all vertices of volumes in target_volume_ids and identifies pairs whose distance is <= high_tolerance. Returns a flat list of vertex ID pairs: [v1_a, v1_b, v2_a, v2_b, . . .].

.. code-block:: python
# Create two 1x1x1 bricks and move the second so they share a face.
cubit.cmd ("brick x 1" )
cubit.cmd ("brick x 1" )
cubit.cmd ("volume 2 move x 1" )
tol = 1e-6 # Tolerance for coincident detection.
pairs = cubit.get_coincident_vertices ([1, 2], tol)
# Expected output: (6, 15, 5, 16, 2, 11, 1, 12)

for i in range(0, len(pairs), 2): print("Coincident pair:", pairs[i], "and", pairs[i+1])

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of high_tolerance: float
high_tolerance Distance threshold below which two vertices are considered coincident.
return type of : std::vector< int,std:: allocator< int > >
Returns
Flat vector of vertex ID pairs [v1, v2, v3, v4, . . .] representing coincident vertices.

◆ get_command_from_history()

def cubit.get_command_from_history (   command_number )

Retrieve a specific command from Cubit's history buffer.

.. code-block:: python

import cubit

for i in range(count): print(cubit.get_command_from_history(i))

  @n type of command_number:  int
Parameters
command_number Zero-based index into the history buffer.
return type of : string
Returns
The command string at the given index.

◆ get_command_history_count()

def cubit.get_command_history_count ( )

Get the number of commands in Cubit's history buffer.

.. code-block:: python

import cubit
 @n return type of :  int
Returns
The total number of commands stored in history.

◆ get_common_curve_id()

def cubit.get_common_curve_id (   surface_1_id,
  surface_2_id 
)

Return a curve shared by two surfaces.

Finds the curve that bounds both input surfaces. Assumes both surface IDs are valid and that only topologically adjacent surfaces can share a curve. Returns -1 if no shared curve exists.

.. code-block:: python
cubit.cmd ("brick x 10" ) # surfaces 1-6
cid = cubit.get_common_curve_id (1, 6) # Expected: 1
print(cid)
 @n type of surface_1_id:  int
Parameters
surface_1_id ID of the first surface.
type of surface_2_id: int
surface_2_id ID of the second surface.
return type of : int
Returns
ID of the shared curve, or -1 if none exists.

◆ get_common_vertex_id()

def cubit.get_common_vertex_id (   curve_1_id,
  curve_2_id 
)

Return a vertex shared by two curves.

Finds the vertex that bounds both input curves. Assumes both curves exist and that only adjacent curves share a vertex. Returns 0 if no shared vertex exists.

.. code-block:: python

      cubit.cmd("brick x 10")                     // curves 1-12
      vid = cubit.get_common_vertex_id(1, 2)      // expected: 2
print(vid)
 @n type of curve_1_id:  int
Parameters
curve_1_id ID of the first curve.
type of curve_2_id: int
curve_2_id ID of the second curve.
return type of : int
Returns
ID of the shared vertex, or 0 if none exists.

◆ get_cone_surfaces()

def cubit.get_cone_surfaces (   target_volume_ids )

Identify cone surfaces in a set of volumes.

This function returns the surfaces that represent cones defined by a conic surface and a hard point in the specified volumes.

The function is callable from both C++ and Python.

.. code-block:: python
cubit.cmd ('brick x 10' )
cubit.cmd ('cylinder rad 1 height 5' )
cubit.cmd ('create frustum height 1 radius 1 top 0' )
cubit.cmd ('vol 2 mov z 3' )
cubit.cmd ('unite vol all' )
cone_surfaces = cubit.get_cone_surfaces ([1])
print("Cone surfaces:" , [int(sid) for sid in cone_surfaces])
# Expected output:
# Cone surfaces: [4]
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to analyze.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs that are cones defined by a conic surface and a hard point.

◆ get_connected_surfaces()

def cubit.get_connected_surfaces (   surf_ids )

Find surfaces connected to a given set of surfaces.

Given a list of surface IDs, this function groups them into "patches" of connected surfaces (connection means sharing a common curve). Merged surfaces are always excluded.

Title Behavior based on the number of patches found:

  • If the input surfaces form a single patch, return all surfaces connected to that patch (excluding merged surfaces).
  • If the input surfaces form exactly two separate patches, return all surfaces that lie between those two patches (excluding merged surfaces), plus the original patches.
  • If the input surfaces form more than two patches, return an empty list.
.. code-block:: python
# Create a 10x10x10 brick; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
# Surfaces 1 and 2 are opposite faces on volume 1, forming two separate patches.
connected = cubit.get_connected_surfaces ([1, 2])
# connected will be (1, 2, 3, 4, 5, 6)
print("Connected surfaces:" , connected)
Parameters
surface_ids IDs of the surfaces to start from.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector or Python tuple) of surface IDs that satisfy the connectivity rules above.

◆ get_connectivity()

def cubit.get_connectivity (   entity_type,
  entity_id 
)

Get the list of node IDs comprising a mesh element.

This function returns the connectivity of the specified mesh element by listing the IDs of its corner nodes. The ordering of nodes follows the Exodus convention; see the Exodus documentation for the element type-specific node ordering.

.. code-block:: python
# Create geometry and mesh it
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query connectivity of hex element 221
node_id_list = cubit.get_connectivity ("hex" , 221)
print("Hex 221 is connected to nodes:" , node_id_list)
 @n type of entity_type:  string
Parameters
entity_type Mesh element type (e.g., "hex", "tet", "tri", "quad").
type of entity_id: int
entity_id ID of the mesh element.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs defining the element's connectivity.

◆ get_constraint_dependent_entity_point()

def cubit.get_constraint_dependent_entity_point (   constraint_id )

Get the dependent entity of a specified constraint.


type of constraint_id: int

Parameters
constraint_id ID of the constraint.
return type of : string
Returns
Dependent entity as a string.

◆ get_constraint_reference_point()

def cubit.get_constraint_reference_point (   constraint_id )

Get the reference point of a specified constraint.


type of constraint_id: int

Parameters
constraint_id ID of the constraint.
return type of : string
Returns
Reference point as a string.

◆ get_constraint_type()

def cubit.get_constraint_type (   constraint_id )

Get the type of a specified constraint.


type of constraint_id: int

Parameters
constraint_id ID of the constraint.
return type of : string
Returns
: Constraint type "Kinematic", "Distributing", or "Rigidbody".

◆ get_contact_pair_exterior_state()

def cubit.get_contact_pair_exterior_state (   entity_id )

Get the exterior state of a contact pair.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : boolean
Returns
True if contact is considered exterior.

◆ get_contact_pair_friction_value()

def cubit.get_contact_pair_friction_value (   entity_id )

Get the friction value for a contact pair.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : float
Returns
Friction value.

◆ get_contact_pair_general_state()

def cubit.get_contact_pair_general_state (   entity_id )

Get the general contact state.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : boolean
Returns
True if general contact is active.

◆ get_contact_pair_tied_state()

def cubit.get_contact_pair_tied_state (   entity_id )

Get the tied state of a contact pair.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : boolean
Returns
True if tied state is active.

◆ get_contact_pair_tol_lower_value()

def cubit.get_contact_pair_tol_lower_value (   entity_id )

Get the lower bound tolerance for a contact pair.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : float
Returns
Lower tolerance value.

◆ get_contact_pair_tolerance_value()

def cubit.get_contact_pair_tolerance_value (   entity_id )

Get the upper bound tolerance for a contact pair.


type of entity_id: int

Parameters
entity_id ID of the contact pair.
return type of : float
Returns
Upper tolerance value.

◆ get_continuous_curve_collections()

def cubit.get_continuous_curve_collections (   volume_list,
  angle_tolerance = -1 
)

Returns collections of continuous curves in the given volumes.

Continuous curves are defined as curves connected at 2-valent vertices, where the tangents at the common vertex form an angle of 180 degrees +/- the specified angle tolerance.

.. code-block:: python
volume_ids = [1, 2]
angle_tol_deg = 5.0
collections = cubit.get_continuous_curve_collections (volume_ids, angle_tol_deg)

for curve_ids, total_length in collections: print("Curve IDs:", curve_ids, "Length:", total_length)

  @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of angle_tolerance: float, optional
angle_tolerance Tangent angle tolerance in degrees. Continuous curves must have tangents at 180 +/- this tolerance. If angle_tolerance < 0 or not specified, defaults to 10 degrees.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
: Ordered list of pairs (1) vector of contiguous curve IDs forming a continuous curve, (2) total length of the curves. The list is ordered from smallest to largest total length.

◆ get_continuous_curves()

def cubit.get_continuous_curves (   curve_id,
  angle_tol,
  require_two_valent = False 
)

Return the list of adjacent continuous curves.

Two curves are considered continuous if the angle between them at a shared vertex is 180 degrees +/- angle_tol.

The returned list includes the input curve_id and any connected continuous curves.

If require_two_valent is true, continuity does not extend across vertices connected to more than two curves.

.. code-block:: python
cubit.cmd ("cylinder rad 1 height 5" )
cubit.cmd ("vol 1 split periodic" ) # Splits the cylinder surface into surfaces 4 and 5 with continuous curves
continuous_curves = cubit.get_continuous_curves (4, 0.1)
print("Continuous curves:" , tuple(continuous_curves))
# Expected output:
# (4, 8)
 @n type of curve_id:  int
Parameters
curve_id Curve ID to query.
type of angle_tol: float
angle_tol Angle tolerance for continuity (degrees).
type of require_two_valent: boolean, optional
require_two_valent If true, continuity does not extend across vertices with more than two adjacent curves.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of curve IDs in the continuous set (including curve_id).

◆ get_continuous_surfaces()

def cubit.get_continuous_surfaces (   surface_id,
  angle_tol 
)

Return the list of adjacent continuous surfaces.

Two surfaces are considered continuous if the exterior angle between them at a shared curve is 180 degrees +/- angle_tol.

The returned list includes the input surface_id and any connected continuous surfaces.

.. code-block:: python
cubit.cmd ("cylinder rad 1 height 5" )
cubit.cmd ("vol 1 split periodic" ) # Splits cylinder surface into surfaces 4 and 5
continuous_surfs = cubit.get_continuous_surfaces (4, 0.1)
print("Continuous surfaces:" , tuple(continuous_surfs))
# Expected output:
# Continuous surfaces: (4, 5)
 @n type of surface_id:  int
Parameters
surface_id Surface ID to query.
type of angle_tol: float
angle_tol Angle tolerance for continuity (degrees).
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of surface IDs in the continuous set (including surface_id).

◆ get_convection_coefficient()

def cubit.get_convection_coefficient (   entity_id,
  bc_type_enum 
)

Get convection coefficient from a convection BC.


type of entity_id: int

Parameters
entity_id ID of the convection BC.
type of bc_type_enum: int
bc_type_enum CI_BCEntityTypes: 1 (normal), 5 (shell top), 6 (shell bottom).
return type of : float
Returns
Convection coefficient value.

◆ get_coordinate_systems_id_list()

def cubit.get_coordinate_systems_id_list ( )

Returns a list of coordinate system IDs.

Retrieves the IDs of all coordinate systems currently defined in the model.

In Python, the returned list is a tuple of IDs.

.. code-block:: python
print("Coordinate system IDs:" , coord_ids)
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
List of coordinate system IDs.

◆ get_copy_block_on_geometry_copy_setting()

def cubit.get_copy_block_on_geometry_copy_setting ( )

Get the current block behavior setting for geometry copy.

When a geometric entity is copied, this setting controls how blocks are propagated:

  • "OFF": Copied geometry/mesh is not included in any block.
  • "use_original": Copied geometry/mesh is added to the original block.
  • "on": New blocks are created for the copied geometry/mesh, mirroring the originals.
.. code-block:: python
# Create a brick and assign a block
cubit.cmd ("brick x 10" )
cubit.cmd ("block 10 volume 1" )
# Set block copy OFF and verify setting
print("After setting OFF:" , setting)
# Copy volume; block should NOT be copied
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 2 x 10" )
# List blocks to verify behavior
cubit.cmd ("list block" )
cubit.cmd ("list block 10" )
# Set block copy ON and verify setting
print("After setting ON:" , setting)
# Copy volume; block should now be copied as new block 11
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 3 x 20" )
# List blocks to verify behavior
cubit.cmd ("list block" )
cubit.cmd ("list block 11" )
# Final check of the setting
print("Final setting:" , setting)
 @n return type of :  string
Returns
Current copy block on geometry copy setting ("on", "OFF", or "use_original").

◆ get_copy_nodeset_on_geometry_copy_setting()

def cubit.get_copy_nodeset_on_geometry_copy_setting ( )

Get the current nodeset behavior setting for geometry copy.

When a geometric entity is copied, this setting controls how nodesets are propagated:

  • "OFF": Copied geometry/mesh is not included in any nodeset.
  • "use_original": Copied geometry/mesh is added to the original nodeset.
  • "on": New nodesets are created for the copied geometry/mesh, mirroring the originals.
.. code-block:: python
# Create a brick and assign a nodeset
cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 10 vertex 1 2" )
# Set nodeset copy OFF and verify setting
print("After setting OFF:" , setting)
# Copy volume; nodeset should NOT be copied
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 2 x 10" )
# List nodesets to verify behavior
cubit.cmd ("list nodeset" )
cubit.cmd ("list nodeset 10" )
# Set nodeset copy ON and verify setting
print("After setting ON:" , setting)
# Copy volume; nodeset should now be copied as new nodeset 11
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 3 x 20" )
# List nodesets to verify behavior
cubit.cmd ("list nodeset" )
cubit.cmd ("list nodeset 11" )
# Final check of the setting
print("Final setting:" , setting)
 @n return type of :  string
Returns
Current copy nodeset on geometry copy setting ("on", "OFF", or "use_original").

◆ get_copy_sideset_on_geometry_copy_setting()

def cubit.get_copy_sideset_on_geometry_copy_setting ( )

Get the current sideset behavior setting for geometry copy.

When a geometric entity is copied, this setting controls how sidesets are propagated:

  • "OFF": Copied geometry/mesh is not included in any sideset.
  • "use_original": Copied geometry/mesh is added to the original sideset.
  • "on": New sidesets are created for the copied geometry/mesh, mirroring the originals.
.. code-block:: python
# Create a brick and assign a sideset
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 10 surface 1" )
# Set sideset copy OFF and verify setting
print("After setting OFF:" , setting)
# Copy volume; sideset should NOT be copied
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 2 x 10" )
# List sidesets to verify behavior
cubit.cmd ("list sideset" )
cubit.cmd ("list sideset 10" )
# Set sideset copy ON and verify setting
print("After setting ON:" , setting)
# Copy volume; sideset should now be copied as new sideset 11
cubit.cmd ("volume 1 copy" )
cubit.cmd ("move volume 3 x 20" )
# List sidesets to verify behavior
cubit.cmd ("list sideset" )
cubit.cmd ("list sideset 11" )
# Final check of the setting
print("Final setting:" , setting)
 @n return type of :  string
Returns
Current copy sideset on geometry copy setting ("on", "OFF", or "use_original").

◆ get_cubit_digits_setting()

def cubit.get_cubit_digits_setting ( )

Retrieve the current Cubit "digits" setting.

Returns the number of digits after the decimal point that Cubit uses when printing numeric output. This corresponds to the value set by the Cubit command set digits N .

.. code-block:: python
import cubit
# Set digits to 10 via Python command interface
cubit.cmd ("set digits 10" )
print("Digits setting:" , digits) # prints 10
 @n return type of :  float
Returns
The number of decimal digits Cubit will print, or -1 if no setting exists.

◆ get_cubit_message_handler()

def cubit.get_cubit_message_handler ( )

Retrieve the current Cubit message handler.

Returns the handler instance currently receiving Cubit messages.

.. code-block:: python
import cubit
handler.print_message("Test info message" )
handler.print_error("Test error message" )
 @n return type of : :py:class: `CubitMessageHandler`
Returns
Shared pointer to the active CubitMessageHandler.

◆ get_current_ids()

def cubit.get_current_ids (   entity_type )

Retrieve IDs of all current geometry entities of a specified type.

Returns the IDs of every geometry entity matching the given type. Supported types are "body", "volume", "surface", "curve", and "vertex".

Notes To include mesh entities (e.g. "node", "element"), use get_entities() .

.. code-block:: python
cubit.cmd ("brick x 10" ) # body 1
cubit.cmd ("brick x 5" ) # body 2
body_ids = cubit.get_current_ids ("body" ) # returns (1, 2)
 @n type of entity_type:  string
Parameters
entity_type Geometry entity type: "body", "volume", "surface", "curve", or "vertex".
return type of : std::vector< int,std:: allocator< int > >
Returns
A vector<int> (or Python tuple) of IDs of all current geometry entities of the specified type.

◆ get_current_journal_file()

def cubit.get_current_journal_file ( )

Get the filename of the current journal file.

Returns the path to the active journal file. With journaling on by default, this shows which file Cubit is writing to upon startup.

.. code-block:: python
import cubit
print("Journal file:" , cubit.get_current_journal_file ())
 @n return type of :  string
Returns
The full path to the active journal file, or an empty string if journaling is off.

◆ get_curve_bias_coarse_size()

def cubit.get_curve_bias_coarse_size (   curve_id )

Get the "coarse size" parameter for a biased curve, if set.

Returns the user-specified "coarse" interval size for the curve's bias scheme. If no coarse size is set, returns 0.

.. code-block:: python
import cubit
# Create geometry and set fine/coarse sizes.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 2 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias fine size 0.1" )
cubit.cmd ("curve 1 scheme bias coarse size 0.5" )
# Query the coarse size.
print("Curve 1 coarse size:" , coarse_size) # Should print 0.5
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose coarse size is retrieved.
return type of : float
Returns
Coarse interval size (double > 0), or 0 if not defined.

◆ get_curve_bias_fine_size()

def cubit.get_curve_bias_fine_size (   curve_id )

Get the "fine size" parameter for a biased curve, if set.

Returns the user-specified "fine" interval size for the curve's bias scheme. If no fine size is set, returns 0.

.. code-block:: python
import cubit
# Create geometry and set fine size.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 3 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias fine size 0.1" )
# Query the fine size.
print("Curve 1 fine size:" , fine_size) # Should print 0.1
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose fine size is retrieved.
return type of : float
Returns
Fine interval size (double > 0), or 0 if not defined.

◆ get_curve_bias_first_interval_fraction()

def cubit.get_curve_bias_first_interval_fraction (   curve_id )

Retrieve the fraction of curve length used as the first interval size.

Returns the first interval length expressed as a fraction of total curve length. (e.g., if fraction = 0.25, the first interval = 0.25 * curve_length).

.. code-block:: python
import cubit
# Create geometry and set bias fraction.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 2 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias fraction 0.25" )
# Query the first interval fraction.
print("Curve 1 first interval fraction:" , frac) # Should print 0.25
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose first interval fraction is retrieved.
return type of : float
Returns
Fraction (0 < fraction <= 1) of total curve length, or 0 if not set.

◆ get_curve_bias_first_interval_length()

def cubit.get_curve_bias_first_interval_length (   curve_id )

Query the length of the first interval on a biased curve.

Returns the absolute length of the first (smallest) mesh interval on the curve. This corresponds to the "first_delta" if that form was used, or the automatically computed value.


type of curve_id: int

Parameters
curve_id ID of the curve whose first interval length is retrieved.
return type of : float
Returns
Length of the first mesh interval (double > 0), or 0 if not set.
.. code-block:: python
import cubit
# Create geometry and set first_delta.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 1 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias first_delta 0.2" )
# Query the first interval length.
print("Curve 1 first interval length:" , first_len) # Should print 0.2

◆ get_curve_bias_first_last_ratio1()

def cubit.get_curve_bias_first_last_ratio1 (   curve_id )

Retrieve the ratio of first-to-last interval at the start of a biased curve.

Returns the ratio of the length of the first interval to the last interval at the curve's start vertex. Useful for understanding how aggressively the mesh is biased at the beginning.

.. code-block:: python
import cubit
# Create geometry and set bias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 5 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 2.0" )
# Query the start first/last ratio.
print("Curve 1 start first/last ratio:" , ratio1)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose start ratio is retrieved.
return type of : float
Returns
Ratio (double > 0) of first interval length to last interval length at start.

◆ get_curve_bias_first_last_ratio2()

def cubit.get_curve_bias_first_last_ratio2 (   curve_id )

Retrieve the ratio of first-to-last interval at the end of a biased curve.

Returns the ratio of the length of the first interval to the last interval at the curve's end vertex. Useful for understanding how aggressively the mesh is biased near the end.

.. code-block:: python
import cubit
# Create geometry and set bias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 5 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 2.0" )
# Query the end first/last ratio.
print("Curve 1 end first/last ratio:" , ratio2)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose end ratio is retrieved.
return type of : float
Returns
Ratio (double > 0) of first interval length to last interval length at end.

◆ get_curve_bias_from_start()

def cubit.get_curve_bias_from_start (   curve_id,
  value 
)

Determine if the bias is measured from the curve's start vertex.

By default, any "bias" scheme is applied from the start vertex. If you call "curve <id> reverse bias", this flips the progression so it is measured from the end. This function sets the output boolean to true if the bias progression begins at the start vertex, or false if it was reversed.

.. code-block:: python
import cubit
# 1) Create curve and set bias (starts from start by default).
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 2 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 1.2" )
# 2) Query from_start (should be True).
print("Bias from start?" , from_start) # True
# 3) Reverse bias, then query again (should be False).
cubit.cmd ("curve 1 reverse bias" )
print("Bias from start?" , from_start) # False
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
type of value: boolean, out
value Set to true if bias is from the start vertex; false if reversed or not set.
return type of : boolean
Returns
True if the curve exists (and output is written); false if curve_id is invalid.

◆ get_curve_bias_from_start_set()

def cubit.get_curve_bias_from_start_set (   curve_id )

Check if the "bias from start" flag has been explicitly set on a curve.

Returns true if the bias-from-start setting (or "reverse bias") has been defined for this curve. If the curve is unmeshed but you have never called "reverse bias", this may still report true (default).

.. code-block:: python
import cubit
# 1) Create curve and set bias (default from-start).
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 1 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 1.3" )
# 2) Query if from-start is explicitly set (True by default).
print("Bias-from-start explicitly set?" , is_set) # True
# 3) Reverse bias, then query again (still True).
cubit.cmd ("curve 1 reverse bias" )
print("Bias-from-start explicitly set?" , is_set) # True
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : boolean
Returns
True if bias-from-start (or reverse) has been defined; false if not or curve invalid.

◆ get_curve_bias_geometric_factor()

def cubit.get_curve_bias_geometric_factor (   curve_id )

Get the primary geometric progression factor used for biasing a curve.

Retrieves the ratio between successive edge lengths at the start of the curve. This "factor" defines the geometric progression for a biased mesh from the first vertex.


type of curve_id: int

Parameters
curve_id ID of the curve whose first bias factor is retrieved.
return type of : float
Returns
The first geometric bias factor (ratio > 0).
.. code-block:: python
import cubit
# Create geometry and set bias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 0 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 2.0" )
# Query the first bias factor.
print("Curve 1 first bias factor:" , factor1) # Should print 2.0

◆ get_curve_bias_geometric_factor2()

def cubit.get_curve_bias_geometric_factor2 (   curve_id )

Get the secondary geometric progression factor for a dual-bias curve.

Retrieves the same "factor" used from the end vertices toward the middle when using dualbias. For a dualbias, there is only one factor value (applied symmetrically from both ends).


type of curve_id: int

Parameters
curve_id ID of the curve whose dualbias factor is retrieved.
return type of : float
Returns
The geometric factor (ratio > 0) for a dualbias curve.
.. code-block:: python
import cubit
# Create geometry and set dualbias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 1 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme dualbias factor 1.5" )
# Query the dualbias factor.
print("Curve 1 dualbias factor:" , factor2) # Should print 1.5

◆ get_curve_bias_last_first_ratio1()

def cubit.get_curve_bias_last_first_ratio1 (   curve_id )

Retrieve the ratio of last-to-first interval at the start of a biased curve.

Returns the inverse of the first/last ratio at the curve's start vertex (i.e., last interval length / first interval length).

.. code-block:: python
import cubit
# Create geometry and set bias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 5 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 2.0" )
# Query the start last/first ratio.
print("Curve 1 start last/first ratio:" , inv_ratio1)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose start inverse ratio is retrieved.
return type of : float
Returns
Ratio (double > 0) of last interval length to first interval length at start.

◆ get_curve_bias_last_first_ratio2()

def cubit.get_curve_bias_last_first_ratio2 (   curve_id )

Retrieve the ratio of last-to-first interval at the end of a biased curve.

Returns the inverse of the first/last ratio at the curve's end vertex (i.e., last interval length / first interval length)

.. code-block:: python
import cubit
# Create geometry and set bias factor.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 5 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 scheme bias factor 2.0" )
# Query the end last/first ratio.
print("Curve 1 end last/first ratio:" , inv_ratio2)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose end inverse ratio is retrieved.
return type of : float
Returns
Ratio (double > 0) of last interval length to first interval length at end.

◆ get_curve_bias_start_vertex_id()

def cubit.get_curve_bias_start_vertex_id (   curve_id )

Retrieve the vertex ID designated as the start of bias on a curve.

Returns the ID of the vertex used as the bias "start" point when using curve-based vertex sizes. If no custom start vertex is defined, returns -1.

.. code-block:: python
import cubit
# 1) Create curve, set vertex sizes, then bias from vertex 1.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 0 4 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("vertex 1 size 0.5" )
cubit.cmd ("vertex 2 size 1.0" )
cubit.cmd ("curve 1 scheme bias factor 1.8 start vertex 1" )
# 2) Query the start vertex for bias.

if start_vertex >= 0: print("Start vertex for bias:", start_vertex) # Should print 1

  @n type of curve_id:  int
Parameters
curve_id ID of the curve whose start-vertex is queried.
return type of : int
Returns
Vertex ID for the bias start, or -1 if not defined or invalid.

◆ get_curve_bias_type()

def cubit.get_curve_bias_type (   curve_id )

Retrieve the bias scheme type applied to a curve.

Returns a string describing the bias scheme for the specified curve. Possible values include "Bias", "Dualbias", "Multi_bias", or "None".


type of curve_id: int

Parameters
curve_id ID of the curve whose bias type is queried.
return type of : string
Returns
String indicating the curve's bias type.
.. code-block:: python
import cubit
# 1) Create two vertices and a curve (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" ) # Vertex ID = 1
cubit.cmd ("create vertex 0 1 0" ) # Vertex ID = 2
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
# 2) Apply a bias scheme (factor = 1.5).
cubit.cmd ("curve 1 scheme bias factor 1.5" )
# 3) Query the bias type.
bias_type = cubit.get_curve_bias_type (1)
print("Curve 1 bias type:" , bias_type) # Should print "Bias"

◆ get_curve_center()

def cubit.get_curve_center (   curve_id )

Retrieve the center point of a specified curve.

Title Center computation

  • For circular and elliptical arcs, returns the exact geometric center.
  • For straight-line curves, returns the midpoint between endpoints.
  • For all other curve types or if the center cannot be determined, returns (0, 0, 0).
.. code-block:: python
cubit.cmd ("create vertex 0 0 0" ); cubit.cmd ("create vertex 1 0 0" )
cubit.cmd ("create curve vertex 1 2" )
c1 = cubit.get_curve_center (1); print(c1) # Output: (0.5, 0.0, 0.0)
cubit.cmd ("cylinder rad 3 height 1" )
c2 = cubit.get_curve_center (2); print(c2) # Output: (0.0, 0.0, 0.0)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : std:: array< double,3 >
Returns
Three-element array {x, y, z} representing the curve's center or midpoint; returns {0, 0, 0} if undefined.

◆ get_curve_count()

def cubit.get_curve_count ( )

Get the current number of curves in the model.

.. code-block:: python

# Create a 10x10x10 brick; this generates twelve curves (edges).
cubit.cmd ("brick x 10" )
curve_count = cubit.get_curve_count () # returns 12
print("Curve count:" , curve_count)
 @n return type of :  int
Returns
The number of curves currently defined in the model.

◆ get_curve_count_in_volumes()

def cubit.get_curve_count_in_volumes (   target_volume_ids )

Get the current number of curves in the specified volumes.

.. code-block:: python

# Create two bricks: volume 1 (10x10x10) and volume 2 (5x5x5).
cubit.cmd ("brick x 10" ) # volume 1, 12 curves
cubit.cmd ("brick x 5" ) # volume 2, 12 curves
# Count curves in volumes 1 and 2.
volumes = [1, 2]
curve_count = cubit.get_curve_count_in_volumes (volumes) # returns 24
print("Curve count in volumes 1 and 2:" , curve_count)
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to query.
return type of : int
Returns
The total number of curves contained in the specified volumes.

◆ get_curve_edges()

def cubit.get_curve_edges (   curve_id )

Get the list of edge element IDs on a curve.

This function returns the IDs of all edge elements that are on the specified curve.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the edges on curve 1
edge_ids = cubit.get_curve_edges (1)
print(f"Curve 1 contains {len(edge_ids)} edge(s)." )

for edge_id in edge_ids: print(f" Edge ID: {edge_id}")

  @n type of curve_id:  int
Parameters
curve_id ID of the curve to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of edge element IDs on the curve.

◆ get_curve_length()

def cubit.get_curve_length (   curve_id )

Get the 3D length of a specified curve.

This returns the physical length of the curve in model units. For closed curves (e.g., circles), it equals the circumference; for lines, the straight-line distance.

.. code-block:: python
# Create a cylinder of radius 1 (curves 1 and 2 are circular edges).
cubit.cmd ("create cylinder radius 1 height 2" )
# Curve 1 is a circle of radius 1: length = 2*PI.
length = cubit.get_curve_length (1)
print("Curve 1 length:" , length) # prints approximately 6.28319
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : float
Returns
The total 3D length of the curve in model units.

◆ get_curve_mesh_scheme_curvature()

def cubit.get_curve_mesh_scheme_curvature (   curve_id )

Retrieve the curvature mesh scheme adaptation value for a curve.

Returns the double parameter that controls how node spacing adapts to local curvature. A value of zero produces nearly equal intervals; positive values concentrate nodes in high-curvature regions.

.. code-block:: python
import cubit
# 1) Create three vertices and build a spline curve (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 0 0" )
cubit.cmd ("create vertex 1 1 0" )
cubit.cmd ("create curve vertex 1 2 3 spline delete" ) # Curve ID = 1
# 2) Set the curvature mesh scheme value to 0.5 on curve 1 and mesh it.
cubit.cmd ("curve 1 scheme curvature 0.5" )
cubit.cmd ("mesh curve 1" )
# 3) Query the curvature scheme value.
print("Curve 1 curvature scheme value:" , value) # Should print 0.5
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose curvature scheme value is retrieved.
return type of : float
Returns
Curvature adaptation value (double). Zero = uniform intervals.

◆ get_curve_mesh_scheme_pinpoint_locations()

def cubit.get_curve_mesh_scheme_pinpoint_locations (   curve_id )

Retrieve the pinpoint mesh scheme locations for a curve.

Returns a list of absolute positions along the curve (measured from the start vertex) where nodes have been placed by the pinpoint scheme.

.. code-block:: python
import cubit
# 1) Create two vertices and a linear curve between them (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" ) # Vertex ID = 1
cubit.cmd ("create vertex 2 0 0" ) # Vertex ID = 2
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
# 2) Apply a pinpoint scheme at positions 0.5 and 1.5.
cubit.cmd ("curve 1 scheme pinpoint location 0.5 1.5" )
# 3) Query the pinpoint locations.
print("Curve 1 pinpoint locations:" , locations) # Should print: [0.5, 1.5]
 @n type of curve_id:  int
Parameters
curve_id ID of the curve whose pinpoint locations are retrieved.
return type of : std::vector< double,std:: allocator< double > >
Returns
std::vector<double> of positions along the curve where nodes are placed.

◆ get_curve_nodes()

def cubit.get_curve_nodes (   curve_id )

Get the list of node IDs owned by a curve.

This function returns the IDs of nodes owned by the specified curve. Nodes on the bounding vertices of the curve are excluded.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the nodes on curve 1
curve_nodes = cubit.get_curve_nodes (1)
print(f"Curve 1 owns {len(curve_nodes)} node(s)." )

for node_id in curve_nodes: print(f" Node ID: {node_id}")

  @n type of curve_id:  int
Parameters
curve_id ID of the curve.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs owned by the curve (excluding nodes on bounding vertices).

◆ get_curve_radius()

def cubit.get_curve_radius (   curve_id )

Compute the radius of a specified curve.

Title Computation

  • For circular arcs, returns the constant radius.
  • For ellipses, parabolas, splines, helices, and hyperbolas, returns the radius of curvature at the midpoint (curvature evaluated and inverted; below numerical tolerance treated as infinite and returned as 0.0).
  • For straight lines or invalid/unsupported curve IDs, returns 0.0.
.. code-block:: python
# 1) Create a straight line
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 0 0" )
cubit.cmd ("create curve vertex 1 2" ) # curve 1
print("Curve 1 radius:" , r1) # Expected: 0.0
# 2) Create a cylinder of radius 2 and height 5
cubit.cmd ("cylinder rad 2 height 5" ) # curve 2 (end circle)
print("Curve 2 radius:" , r2) # Expected: 2.0
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : float
Returns
Constant radius for circular arcs; radius of curvature at midpoint for other curved types; 0.0 for straight lines or invalid/unsupported IDs.

◆ get_curve_type()

def cubit.get_curve_type (   curve_id )

Get the curve type for a specified curve.

Returns a descriptive string indicating the curve's geometry.

Title Available curve types

  • Arc curve
  • Ellipse curve
  • Parabola curve
  • Segmented/facet curve
  • Spline curve
  • Straight curve
  • Point curve
  • Helical curve
  • Undefined curve type
.. code-block:: python
# Assume curve ID 12 corresponds to a spline.
curve_type = cubit.get_curve_type (12)
print("Curve 12 is a:" , curve_type) # Output: Curve 12 is a: Spline curve
 @n type of curve_id:  int
Parameters
curve_id ID of the curve to query.
return type of : string
Returns
Descriptive string of the curve's geometry type.

◆ get_dbl_sculpt_default()

def cubit.get_dbl_sculpt_default (   variable )

Retrieve the default value of a named sculpt parameter.

Matches the given substring against known double-valued sculpt parameters and returns its default.

Title Available parameters

  • AUTO_SIZE
  • OPT_THRESHOLD
  • CURVE_OPT_THRESHOLD
  • GQ_THRESHOLD
  • DEFAULT_GEO_SMOOTH_MAX_DEVIATION
  • PCOL_THRESHOLD
  • DEG_THRESHOLD
  • HTET_THRESHOLD
  • ADAPT_THRESHOLD
  • CAPTURE_ANGLE
  • EXPAND_PERCENT
  • THICKEN_VOID
  • PILLOW_THRESHOLD
  • REMOVE_BAD
  • MIN_ELEM_THICKNESS
    * XTRANSLATE, YTRANSLATE, ZTRANSLATE
    * XSCALE, YSCALE, ZSCALE


type of variable: string

Parameters
variable Substring of the sculpt parameter name to look up.
return type of : float
Returns
The default double value for the matched parameter.

◆ get_default_auto_size()

def cubit.get_default_auto_size ( )

Compute Cubit's heuristic default automatic mesh size for the current model.

Returns the target edge length determined by Cubit's auto-sizing heuristics (model dimensions, curve lengths, etc.). This is equivalent to running:

.. code-block:: c++

cubit.cmd ("vol all size auto factor 5" )

and then querying:

.. code-block:: c++

get_mesh_size("volume" , 1)

.. code-block:: python

import cubit
print("Default auto mesh size:" , size)
 @n return type of :  float
Returns
Target edge length computed by Cubit's auto-sizing algorithm.

◆ get_default_element_type()

def cubit.get_default_element_type ( )

Retrieve the current default element type for meshing.

.. code-block:: python

default_type = cubit.get_default_element_type ()
print("Default element type:" , default_type)
 @n return type of :  string
Returns
A string indicating the default mesh type:
  • "tri" indicates a tri/tet mesh default
  • "hex" indicates a quad/hex mesh default
  • "none" indicates no default has been assigned

◆ get_default_geometry_engine()

def cubit.get_default_geometry_engine ( )

Get the name of the default modeler engine.

The default engine is the geometry kernel used for creating new geometry. ACIS is the default but can be changed to facet.

.. code-block:: python
cubit.cmd ("set geom engine facet" ) # set engine to facet
print("Default engine:" , engine) # prints facet
 @n return type of :  string
Returns
: The name of the default modeler engine ACIS, CATIA, OCC, or facet.

◆ get_displacement_combine_type()

def cubit.get_displacement_combine_type (   entity_id )

Get the combine method for a displacement BC.

Valid options include "Overwrite", "Average", "SmallestCombine", or "LargestCombine".
type of entity_id: int

Parameters
entity_id ID of the displacement BC.
return type of : string
Returns
Combine method as a string.

◆ get_distance_between()

def cubit.get_distance_between (   vertex_id_1,
  vertex_id_2 
)

Get the Euclidean distance between two vertices.

.. code-block:: python

# Create two standalone vertices at (0,0,0) and (1,1,1).
cubit.cmd ("create vertex 0 0 0" ) # vertex 1
cubit.cmd ("create vertex 1 1 1" ) # vertex 2
print("Distance between vertices 1 and 2:" , dist) # prints 1.73205
 @n type of vertex_id_1:  int
Parameters
vertex_id_1 ID of the first vertex.
type of vertex_id_2: int
vertex_id_2 ID of the second vertex.
return type of : float
Returns
The straight-line distance between the two vertices.

◆ get_distance_between_entities()

def cubit.get_distance_between_entities (   geom_type_1,
  entity_id_1,
  geom_type_2,
  entity_id_2 
)

Get the minimum distance between two geometry entities.

Computes the shortest straight-line distance between any point on the first entity and any point on the second entity. Supported entity types are "vertex", "curve", "surface", and "volume".

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; volume 1 occupies -5 to +5 in X.
cubit.cmd ("brick x 10" )
# Create a vertex at (10, 0, 0); this is vertex 9.
cubit.cmd ("create vertex 10 0 0" )
# Distance from vertex 9 to volume 1 is |10 - 5| = 5.
dist = cubit.get_distance_between_entities ("vertex" , 9, "volume" , 1)
print("Distance between vertex 9 and volume 1:" , dist) # prints 5
 @n type of geom_type_1:  string
Parameters
geom_type_1 Type of the first entity ("vertex", "curve", "surface", or "volume").
type of entity_id_1: int
entity_id_1 ID of the first entity.
type of geom_type_2: string
geom_type_2 Type of the second entity ("vertex", "curve", "surface", or "volume").
type of entity_id_2: int
entity_id_2 ID of the second entity.
return type of : float
Returns
The minimum straight-line distance between the two specified entities.

◆ get_distance_from_curve_start()

def cubit.get_distance_from_curve_start (   x_coordinate,
  y_coordinate,
  z_coordinate,
  curve_id 
)

Get the distance along a curve from its start to the closest point on the curve.

If the given xyz is not exactly on the curve, the closest point on the curve is used.

.. code-block:: python
# Create a cylinder of radius 1 and height 1; its circular edge is curve 1.
cubit.cmd ("cylinder rad 1 height 1" )
# Measure distance from the start of curve 1 to the closest point on curve 1 from (-1,0,0).
dist = cubit.get_distance_from_curve_start (-1.0, 0.0, 0.0, 1)
print("Distance along curve 1:" , dist) # prints approximately 3.14159
 @n type of x_coordinate:  float
Parameters
x_coordinate X coordinate of the query point.
type of y_coordinate: float
y_coordinate Y coordinate of the query point.
type of z_coordinate: float
z_coordinate Z coordinate of the query point.
type of curve_id: int
curve_id ID of the curve to measure along.
return type of : float
Returns
The arc distance from the curve's start to the closest point on the curve to the specified xyz.

◆ get_edge_count()

def cubit.get_edge_count ( )

Retrieve the count of edges between surface elements in the current model.

For a volume mesh, only edges on the surface-between surface elements-are counted.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("mesh vol 1" ) # mesh volume 1 (hex or tet)
edge_count = cubit.get_edge_count ()
print("Edge count:" , edge_count)
 @n return type of :  int
Returns
Number of edges between surface elements in the current model's mesh.

◆ get_edge_global_element_id()

def cubit.get_edge_global_element_id (   edge_id )

Get the Global Element ID for a specific edge element.

Cubit assigns a Global Element ID to each mesh element when it is placed into a block. This function returns the Global Element ID corresponding to the given local edge ID within its type-specific ID space.

.. code-block:: python
# Create geometry and mesh a curve with equal spacing
cubit.cmd ("brick x 10" )
cubit.cmd ("curve 1 scheme equal" )
cubit.cmd ("mesh curve 1" )
# Assign all edge elements on curve 1 to block 1
cubit.cmd ("block 1 edge in curve 1" )
# Query the Global Element ID of local edge 3
print("Global Element ID of edge 3:" , gid) # prints 3
 @n type of edge_id:  int
Parameters
edge_id Local edge element ID within its type-specific ID space.
return type of : int
Returns
Global Element ID for the specified edge, or 0 if not placed into a block.

◆ get_edges_to_swap()

def cubit.get_edges_to_swap (   curve_id )

Get edges on triangles at a knife-edge curve that are candidates for swapping.

Given a curve that defines a knife-edge between two triangle-meshed surfaces, this function returns the IDs of mesh edges on the triangles at the curve that are good candidates for edge swapping.

Swapping these edges can improve the local dihedral angles between adjacent triangles, resulting in larger available volumes for successful tet meshing.

This function is commonly used as a postprocessing step after tri or tet meshing to identify edges that may be swapped to improve mesh quality. The Cubit command: Swap Edge <ids> can then be used to perform the actual swapping.

.. code-block:: python
# Identify candidate edges to swap at curve 12
edge_ids = cubit.get_edges_to_swap (12)
print(f"Curve 12 has {len(edge_ids)} candidate edge(s) to swap." )

if edge_ids: swap_cmd = "Swap Edge" for edge_id in edge_ids: swap_cmd += f" {edge_id}"

print(f" Edge ID: {edge_id}" )
# Execute the Swap Edge command
cubit.cmd (swap_cmd)
 @n type of curve_id:  int
Parameters
curve_id ID of the curve defining the knife-edge.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of edge IDs that are good candidates for swapping.

◆ get_elem_quality_stats()

def cubit.get_elem_quality_stats (   entity_type,
  id_list,
  metric_name,
  single_threshold,
  use_low_threshold,
  low_threshold,
  high_threshold,
  make_group 
)

Python-friendly version of get_quality_stats without reference parameters.

Computes quality statistics and returns all results–including failing element IDs–in a single vector.

.. code-block:: python
# Python example
id_list = [223, 226, 256]
single_threshold = 0.2
use_low_threshold = False
low_threshold = 0.0
high_threshold = 0.0
make_group = True
quality_data = cubit.get_elem_quality_stats (
"hex" , id_list, "scaled jacobian" ,
single_threshold, use_low_threshold,
low_threshold, high_threshold,
make_group)
min_value = quality_data[0]
max_value = quality_data[1]
mean_value = quality_data[2]
std_value = quality_data[3]
min_element_id = int(quality_data[4])
max_element_id = int(quality_data[5])
element_type = int(quality_data[6]) # 0=edge,1=tri,2=quad,3=tet,4=hex
bad_group_id = int(quality_data[7])
num_failures = int(quality_data[8])
mesh_list = [int(x) for x in quality_data[9:9+num_failures]]
 @n type of entity_type:  string
Parameters
entity_type Geometry type ("edge", "tri", "quad", "tet", "hex").
type of id_list: std::vector< int,std::allocator< int > >
id_list List of element IDs to evaluate.
type of metric_name: string
metric_name Quality metric name (e.g., "scaled jacobian").
type of single_threshold: float
single_threshold Threshold when using a single bound.
type of use_low_threshold: boolean
use_low_threshold If true, apply [low_threshold, high_threshold]; otherwise use single_threshold.
type of low_threshold: float
low_threshold Lower bound for quality range.
type of high_threshold: float
high_threshold Upper bound for quality range.
type of make_group: boolean
make_group If true, create a group for failing elements and return its ID.
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector<double> containing: [0] min_value [1] max_value [2] mean_value [3] std_value [4] min_element_id [5] max_element_id [6] element_type (0=edge,1=tri,2=quad,3=tet,4=hex) [7] bad_group_id [8] mesh_list size (n) [9..] mesh_list element IDs

◆ get_element_block()

def cubit.get_element_block (   element_id )

Get the block ID containing a given global element.

In Cubit, elements receive a Global Element ID when placed into a block. This function returns the ID of the block that contains the specified global element. Returns 0 if the element is not assigned to any block. You can also use the interactive command list element <global_id> to see the block.

.. code-block:: python
# Create geometry and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign hex elements to block 1 and faces to block 2
cubit.cmd ("block 1 hex all" ) # global IDs start at 1
cubit.cmd ("block 2 face in surface 1" ) # global IDs follow block 1
# Query block for hex 1 (should be 1)
print(f"Element 1 is in block {block1}" ) # prints 1
# Query block for face 1 (global ID 1001 ? block 2)
block2 = cubit.get_element_block (1001)
print(f"Element 1001 is in block {block2}" ) # prints 2
 @n type of element_id:  int
Parameters
element_id Global Element ID to query.
return type of : int
Returns
ID of the block containing the element, or 0 if none.

◆ get_element_budget()

def cubit.get_element_budget (   element_type,
  entity_id_list,
  auto_factor 
)

Estimate the total element count for a set of volumes given size settings.

Calculates an approximate "element budget" (total number of elements) for the specified volumes, based on the current mesh size factor and element type. For hexahedral meshes, the target edge length (esize) is related to the model volume (Vmodel) and the hex count (Nhex) by:

.. code-block:: c++

esize = (Vmodel / Nhex)^(1/3)

Solving for Nhex gives:

.. code-block:: c++

Nhex = Vmodel / (esize^3)

For tetrahedral meshes, the element count is roughly seven times that of a hex mesh with the same edge length (i.e., Ntet ~ 7 * Nhex)

.. code-block:: python
import cubit
# Estimate hex element budget on volumes 1 and 2 with auto factor = 3
vols = [1, 2]
hex_budget = cubit.get_element_budget ("hex" , vols, 3)
print("Hex element budget:" , hex_budget)
# Estimate tet element budget on volumes 1 and 2 with auto factor = 3
tet_budget = cubit.get_element_budget ("tet" , vols, 3)
print("Tet element budget:" , tet_budget)
 @n type of element_type:  string
Parameters
element_type Element type: "hex" or "tet". Determines whether to estimate a hexahedral or tetrahedral budget.
type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_list Vector of volume IDs over which to compute the total model volume.
type of auto_factor: int
auto_factor The "auto size" factor n (as in size auto factor n). This factor scales the base size; a larger factor produces larger elements and fewer total elements.
return type of : int
Returns
Approximate number of elements that will be generated (integer).

◆ get_element_count()

def cubit.get_element_count ( )

Retrieve the count of exportable elements in the current model.

Exportable elements are those that have been assigned to a block. If no blocks are defined, all elements (nodes, edges, quad, hex, tet, tri, wedge, sphere, etc.) are considered exportable.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create first brick (Volume ID = 1)
cubit.cmd ("brick x 10" ) # create second brick (Volume ID = 2)
cubit.cmd ("vol 1 mov x 10" ) # move volume 1 to abut volume 2
cubit.cmd ("merge all" ) # merge all volumes into one model
cubit.cmd ("mesh vol all" ) # mesh every volume (hex meshes)
cubit.cmd ("block 1 vol 1" ) # assign volume 1 elements to block 1
# Only hex elements from volume 1 are now deemed exportable
elem_count = cubit.get_element_count () # count exportable elements
print("Element count:" , elem_count)
 @n return type of :  int
Returns
Number of exportable elements in the current model's mesh.

◆ get_element_exists()

def cubit.get_element_exists (   element_id )

Check whether a global mesh element ID exists in the model.

In Cubit, elements receive a Global Element ID when they are placed into a block. This function returns true if the specified global element ID has been established (i.e., the element was assigned to a block); otherwise it returns false .

.. code-block:: python
# Create geometry and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Before block assignment, no global IDs exist
exists_before = cubit.get_element_exists (10)
print(f"Element 10 exists before block? {'Yes' if exists_before else 'No'}" ) # No
# Assign all hex elements to block 1 (establishes global IDs)
cubit.cmd ("block 1 hex all" )
# After block assignment, global IDs exist
exists_after = cubit.get_element_exists (10)
print(f"Element 10 exists after block? {'Yes' if exists_after else 'No'}" ) # Yes
 @n type of element_id:  int
Parameters
element_id Global element ID to check (as established by block assignment).
return type of : boolean
Returns
true if the element has a Global Element ID, false otherwise.

◆ get_element_type()

def cubit.get_element_type (   element_id )

Get the specific mesh element type for a global element ID.

CUBIT supports a variety of element types, each with different node counts and accuracy orders. This function returns one of the specific type strings defined in CUBIT; for example, "HEX20", "TETRA4", "TRISHELL7", etc. Supported element types are detailed in the CUBIT documentation or the Exodus manual.

.. code-block:: python
# Create a brick and assign hex20 elements to block 1
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
cubit.cmd ("block 1 element type hex20" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("export mesh \"model.exo\"" )
# Query the type of the first element in block 1 (global ID 1)
elem_type = cubit.get_element_type (1)

print("Element 1 type:", elem_type) // should print HEX20

  @n type of element_id:  int
Parameters
element_id Global element ID (as assigned by Exodus/Genesis).
return type of : string
Returns
A string naming the specific element type (for example, HEX, HEX20, TETRA4, TRISHELL7, etc.).

◆ get_element_type_id()

def cubit.get_element_type_id (   element_id )

Map a Global Element ID back to its local mesh entity ID.

Cubit assigns each element a Global Element ID when it is placed into a block. This function returns the corresponding local mesh entity ID within that element's type-specific ID space (hex, tet, tri, etc.). Together with get_element_type, it lets you determine both the element's type and its local ID.

.. code-block:: python
# Create geometry and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign hex elements to block 1 (global IDs start at 1)
cubit.cmd ("block 1 hex all" )
# Assign face elements on surface 1 to block 2 (global IDs start after hexes)
cubit.cmd ("block 2 face in surface 1" )
# Query element 1001 (first face in block 2)
elem_type = cubit.get_element_type (1001)
local_id = cubit.get_element_type_id (1001)
print(f"Element 1001: type = {elem_type}, local ID = {local_id}" )
# Expected output: Element 1001: type = face, local ID = 1
 @n type of element_id:  int
Parameters
element_id Global Element ID (as assigned in the Exodus file).
return type of : int
Returns
Local mesh entity ID within its type-specific ID space.

◆ get_entities()

def cubit.get_entities (   entity_type )

Retrieve IDs of all current entities of a specified type (geometry and mesh).

Returns the IDs of every entity matching the given type, including both geometry entities (body, volume, surface, curve, vertex) and mesh entities (node, element).

Notes To restrict the results to geometry entities only, use get_current_ids() .

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("create cylinder radius 3 height 12" )
volume_ids = cubit.get_entities ("volume" ) # returns (1, 2, ...)
node_ids = cubit.get_entities ("node" ) # returns (101, 102, ...)
 @n type of entity_type:  string
Parameters
entity_type Type of entity to query: geometry types ("body", "volume", "surface", "curve", "vertex") or mesh types ("node", "element").
return type of : std::vector< int,std:: allocator< int > >
Returns
A vector<int> (or Python tuple) of IDs of all entities of the specified type.

◆ get_entity_color()

def cubit.get_entity_color (   entity_type,
  entity_id 
)

Get the color of a specified entity.

Returns the RGBA color as four doubles in [0, 1] for the given entity.

.. code-block:: python
# Assume curve 33 has been assigned a color earlier.
color = cubit.get_entity_color ("curve" , 33)
print(f"R: {color[0]} G: {color[1]} B: {color[2]} A: {color[3]}" )
 @n type of entity_type:  string
Parameters
entity_type Type of the entity ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity to query.
return type of : std:: array< double,4 >
Returns
A 4-element array [R, G, B, A], each component in [0, 1].

◆ get_entity_color_index()

def cubit.get_entity_color_index (   entity_type,
  entity_id 
)

Get the color index of a specified entity.

Cubit uses predefined color indices to represent common colors.

Title Available color indices

  • -1 default color
  • 0 black (0,0,0)
  • 1 grey (127,127,127)
  • 2 orange (255,165,0)
  • 3 red (255,0,0)
  • 4 green (0,255,0)
  • 5 yellow (255,255,0)
  • 6 magenta (255,0,255)
  • 7 cyan (0,255,255)
  • 8 blue (0,0,255)
  • 9 white (255,255,255)
  • 10 brown (165,42,42)
  • 11 gold (255,215,0)
  • 12 lightblue (173,216,230)
  • 13 lightgreen (0,204,0)
  • 14 salmon (250,128,114)
  • 15 coral (255,127,80)
  • 16 pink (255,192,203)
.. code-block:: python
# Set the color of curve 33 to red.
cubit.cmd ("color curve 33 red" )
idx = cubit.get_entity_color_index ("curve" , 33)
print("Color index:" , idx) # prints 3
 @n type of entity_type:  string
Parameters
entity_type Type of the entity ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity to query.
return type of : int
Returns
: The color index -1 (default) or 0-16 for predefined colors.

◆ get_entity_modeler_engine()

def cubit.get_entity_modeler_engine (   geometry_type,
  entity_id 
)

Get the modeler engine type for a specified entity.

Returns the engines associated with this entity. Valid return strings are: acis, facet, virtual.

.. code-block:: python
engine_list = cubit.get_entity_modeler_engine ("surface" , 47)
print(engine_list) # e.g., ('acis', 'facet')
Parameters
geom_type Specifies the geometry type ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
: A list of modeler engine names "acis", "facet", or "virtual".

◆ get_entity_name()

def cubit.get_entity_name (   entity_type,
  entity_id,
  no_default = False 
)

Get the name of a specified entity.

Returns either a user-defined name (stored in Cubit) or a default name generated at run-time. If no_default is true and the entity has only a default name, an empty string is returned.

.. code-block:: python
# Create and name a vertex.
cubit.cmd ("vertex 22 name 'point_load'" )
# Query the name of vertex 22.
name = cubit.get_entity_name ("vertex" , 22, True )
print("Entity name:" , name) # prints "point_load"
 @n type of entity_type:  string
Parameters
entity_type Type of the entity ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity.
type of no_default: boolean, optional
no_default If true, return an empty string when only a default name exists.
return type of : string
Returns
The entity's name, or an empty string if no_default is true and the name is default.

◆ get_entity_names()

def cubit.get_entity_names (   entity_type,
  entity_id,
  no_default = False,
  first_name_only = False 
)

Get all names associated with a specified entity.

Retrieves every name attribute set on the entity. By default, returns all names, but if first_name_only is true, only the first name is returned. Setting no_default to true excludes default names.

.. code-block:: python
# Create and assign two names to vertex 22.
cubit.cmd ("vertex 22 name 'point_load'" )
cubit.cmd ("vertex 22 name 'PSI'" )
# Retrieve all names.
names = cubit.get_entity_names ("vertex" , 22, True , False )
print(names) # prints ('point_load', 'PSI')
# Retrieve only the first name.
first_only = cubit.get_entity_names ("vertex" , 22, True , True )
print(first_only[0]) # prints "point_load"
 @n type of entity_type:  string
Parameters
entity_type Type of the entity ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity.
type of no_default: boolean, optional
no_default If true, excludes default names from the returned list.
type of first_name_only: boolean, optional
first_name_only If true, returns only the first name attribute.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
A vector of all name strings (or a single-element vector if first_name_only is true).

◆ get_entity_sense()

def cubit.get_entity_sense (   source_type,
  source_id,
  sideset_id 
)

Get the sense of an entity in a sideset.

This function returns the sense of the specified entity (face, quad, or tri) within the specified sideset. The sense indicates the orientation of the entity relative to the sideset.

.. code-block:: python
# Query the sense of face 332 in sideset 2
sense = cubit.get_entity_sense ("face" , 332, 2)
print(f"Sense of face 332 in sideset 2: {sense}" )
 @n type of source_type:  string
Parameters
source_type Item type: "face", "quad", or "tri".
type of source_id: int
source_id ID of the entity.
type of sideset_id: int
sideset_id ID of the sideset.
return type of : string
Returns
Sense of the specified entity in the sideset.

◆ get_error_count()

def cubit.get_error_count ( )

Retrieve the total number of errors in the current Cubit session.

Use this to check whether any errors have occurred since Cubit was started (or since the last manual reset).

Errors can be cleared by issuing the Cubit command reset error .

.. code-block:: python
import cubit
# Execute some commands...
errors = cubit.get_error_count ()
print("Number of errors:" , errors)
# Reset errors
cubit.cmd ("reset error" )
print("Number of errors after reset:" , cubit.get_error_count ())
 @n return type of :  int
Returns
Integer count of errors recorded in this Cubit session.

◆ get_exodus_element_count()

def cubit.get_exodus_element_count (   entity_id,
  entity_type 
)

Get the number of elements in a Exodus entity.

.. code-block:: python

element_count = cubit.get_exodus_element_count (2, "sideset" )
 @n type of entity_id:  int
Parameters
entity_id The id of the entity
type of entity_type: string
entity_type The type of the entity
return type of : int
Returns
Number of Elements

◆ get_exodus_entity_description()

def cubit.get_exodus_entity_description (   entity_type,
  entity_id 
)

Get the description of an Exodus entity.

Returns the description string associated with a block, sideset, or nodeset entity. If no description is assigned or the entity does not exist, an empty string is returned.

.. code-block:: python
# Issue Cubit commands to create a brick and assign a sideset with a description
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 1 surface 1" )
cubit.cmd ("sideset 1 description \"Pressure boundary for inlet\"" )
# Query the description of sideset 1
entity_description = cubit.get_exodus_entity_description ("sideset" , 1)
# Print the result
print("Entity description:" , entity_description)
# Expected output (example):
# Entity description: Pressure boundary for inlet
 @n type of entity_type:  string
Parameters
entity_type Type of the entity: "block", "sideset", or "nodeset".
type of entity_id: int
entity_id ID of the entity.
return type of : string
Returns
Description of the entity, or an empty string if none is assigned.

◆ get_exodus_entity_name()

def cubit.get_exodus_entity_name (   entity_type,
  entity_id 
)

Get the name of an Exodus entity.

Retrieves the user-defined name of an Exodus entity of the given type and ID.

.. code-block:: python
# Issue Cubit commands to create a brick and assign a sideset with a name
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 1 surface 1" )
cubit.cmd ("sideset name \"pressure_load\"" )
# Query the name of sideset 1
entity_name = cubit.get_exodus_entity_name ("sideset" , 1)
# Print the result
print("Entity name:" , entity_name)
# Expected output:
# Entity name: pressure_load
 @n type of entity_type:  string
Parameters
entity_type Type of the entity: "block", "sideset", or "nodeset".
type of entity_id: int
entity_id ID of the entity.
return type of : string
Returns
Name of the entity, or an empty string if none is assigned.

◆ get_exodus_entity_type()

def cubit.get_exodus_entity_type (   entity_type,
  entity_id 
)

Get the Exodus type of an entity.

Returns the Exodus type string associated with the mesh group of a block, sideset, or nodeset. If the entity does not exist, an empty string is returned.

.. code-block:: python
# Issue Cubit commands to create a brick and assign a sideset
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 1 surface 1" )
# Query the Exodus type of sideset 1
entity_type = cubit.get_exodus_entity_type ("sideset" , 1)
# Print the result
print("Entity type:" , entity_type)
# Expected output (example):
# Entity type: lite
 @n type of entity_type:  string
Parameters
entity_type Type of the entity: "block", "sideset", or "nodeset".
type of entity_id: int
entity_id ID of the entity.
return type of : string
Returns
Exodus type string of the entity (e.g., "lite"), or an empty string if the entity does not exist.

◆ get_exodus_id()

def cubit.get_exodus_id (   entity_type,
  entity_id 
)

Get the Global Element ID for a mesh entity.

In Cubit, each mesh element type (hex, tet, quad, tri, etc.) has a local ID unique only among its type. When elements are placed into a block, they receive a Global Element ID that is unique across all blocks and element types. Global Element IDs are exported to Exodus files for downstream applications to map back to the original Cubit elements.

Notes In an interactive session you can also use list <type> <local_id> (e.g. list hex 100 ) to display the Global Element ID.

.. code-block:: python
# Reset session and create a brick
cubit.cmd ("reset" )
cubit.cmd ("brick x 10" )
# Mesh all volumes
cubit.cmd ("mesh vol all" )
# Place all hex elements into block 1
cubit.cmd ("block 1 hex all" )
# Place all face elements on surface 1 into block 2
cubit.cmd ("block 2 face in surface 1" )
# Query the Global Element ID of local hex 1
hex_gid = cubit.get_exodus_id ("hex" , 1)
print("Global Element ID of hex 1: " , hex_gid) # prints 1
# Query the Global Element ID of local face 1
face_gid = cubit.get_exodus_id ("face" , 1)
print("Global Element ID of face 1:" , face_gid) # prints 1001 (block 2 follows block 1)
 @n type of entity_type:  string
Parameters
entity_type Mesh element type ("hex", "tet", "quad", "tri", "face", etc.).
type of entity_id: int
entity_id Local mesh entity ID within its type.
return type of : int
Returns
Global Element ID (unique across all blocks and types), or 0 if the mesh has not been exported.

◆ get_exodus_sizing_function_file_name()

def cubit.get_exodus_sizing_function_file_name ( )

Retrieve the Exodus sizing function file name.

Returns the path or file name of the Exodus II file from which the sizing function was imported. If no file has been imported, returns an empty string.

.. code-block:: python
import cubit
# After reading an Exodus field function:
# cubit.cmd("Import Sizing Function 'mesh.sfb' Block all Variable 'curvature' Time 0")
print("Exodus sizing file:" , file_name)
 @n return type of :  string
Returns
The file name of the imported Exodus II sizing function, or an empty string.

◆ get_exodus_sizing_function_variable_name()

def cubit.get_exodus_sizing_function_variable_name ( )

Retrieve the Exodus-based sizing function variable name.

Returns the name of the field variable currently used as the sizing function. This is the Exodus variable (node- or element-based) driving adaptive meshing.

.. code-block:: python
import cubit
# After reading an Exodus field function:
# cubit.cmd("Import Sizing Function 'strain.exo' Block 10 Variable 'plastic_strain' Last")
print("Current Exodus sizing variable:" , var_name)
 @n return type of :  string
Returns
The name of the Exodus variable used for sizing.

◆ get_exodus_variable_count()

def cubit.get_exodus_variable_count (   container_type,
  container_id 
)

Get the number of Exodus variables in a nodeset, sideset, or block.

Parameters
entity_type : nodeset, sideset, or block
type of container_id: int
container_id The block id
return type of : int
Returns
Number of Exodus variables

◆ get_exodus_variable_names()

def cubit.get_exodus_variable_names (   container_type,
  container_id 
)

Get the names of Exodus variables in a nodeset, sideset, or block.

Parameters
entity_type : nodeset, sideset, or block
type of container_id: int
container_id The block id
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Names of Exodus variables

◆ get_exodus_version()

def cubit.get_exodus_version ( )

Retrieve the Exodus mesh library version.

Returns the version string of the Exodus library used for mesh I/O.

.. code-block:: python
import cubit
exodus_version = cubit.get_exodus_version ()
print("Exodus version:" , exodus_version)
 @n return type of :  string
Returns
A string containing the Exodus library version.

◆ get_expanded_connectivity()

def cubit.get_expanded_connectivity (   entity_type,
  entity_id 
)

Get the list of node IDs for a mesh element, including interior nodes.

This function returns the IDs of all nodes associated with the specified mesh element, including both corner (boundary) and interior nodes. The ordering follows the Exodus convention; see the Exodus documentation for element-specific node ordering.

.. code-block:: python
# Create a brick and assign volume 1 to block 1
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )
# Specify a 20-node hexahedral element type for block 1
cubit.cmd ("block 1 element type hex20" )
# Mesh volume 1, producing hex20 elements
cubit.cmd ("mesh vol 1" )
# Query expanded connectivity of the first hex20 element (ID 1)
node_id_list = cubit.get_expanded_connectivity ("hex20" , 1)
print(f"Hex20 element 1 has {len(node_id_list)} nodes (expected 20):" , node_id_list)
 @n type of entity_type:  string
Parameters
entity_type Mesh element type (e.g., "hex", "tet", "tri", "quad", "hex20").
type of entity_id: int
entity_id ID of the mesh element.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs associated with the element, including interior nodes.

◆ get_force_direction_vector()

def cubit.get_force_direction_vector (   entity_id )

Get the direction vector of a force BC.


type of entity_id: int

Parameters
entity_id ID of the force BC.
return type of : std:: array< double,3 >
Returns
Direction vector as [x, y, z].

◆ get_force_magnitude()

def cubit.get_force_magnitude (   entity_id )

Get the force magnitude of a force BC.


type of entity_id: int

Parameters
entity_id ID of the force BC.
return type of : float
Returns
Force magnitude.

◆ get_force_moment_vector()

def cubit.get_force_moment_vector (   entity_id )

Get the moment vector of a force BC.


type of entity_id: int

Parameters
entity_id ID of the force BC.
return type of : std:: array< double,3 >
Returns
Moment vector as [x, y, z].

◆ get_gaps_between_volumes()

def cubit.get_gaps_between_volumes (   target_volume_ids,
  maximum_gap_tolerance,
  maximum_gap_angle,
  cache_overlaps = 0 
)

Identify gaps between surfaces in a list of volumes.

This is a Python-friendly version of get_volume_gaps .

For each pair of volumes that have surface gaps, a VolumeGap object is returned. Each VolumeGap contains:

  • the pair of volume IDs,
  • a list of surface ID pairs ( surfPairs),
  • corresponding distances ( gaps),
  • corresponding overlap areas ( overlapAreas).

Caching can be used to avoid redundant distance calculations when this function is called together with get_overlapping_surfaces_in_volumes . Both functions require the same underlying distance computations between surfaces in the specified volumes. If caching is enabled, the results of these distance calculations will be saved and reused when the second function is called. If you are calling only this function by itself, caching provides no performance benefit.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10.01' ) # Move volume 2 slightly away to create a small gap
target_volumes = [1, 2]
gaps = cubit.get_gaps_between_volumes (target_volumes, 0.02, 5.0, 0)
print("Volume gaps:" )

for gap in gaps: print(f"Volumes: ({gap.volume1}, {gap.volume2})") for surf_pair, dist, area in zip(gap.surfPairs, gap.gaps, gap.overlapAreas): print(f" Surfaces: ({surf_pair[0]}, {surf_pair[1]}), " f {dist:.6f}, Overlap area: {area}")

# Expected output:
# Volumes: (1, 2)
# Surfaces: (6, 10), Distance: 0.010000, Overlap area: 100.0
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to examine.
type of maximum_gap_tolerance: float
maximum_gap_tolerance Maximum distance between surfaces to be considered a gap.
type of maximum_gap_angle: float
maximum_gap_angle Maximum angle between surfaces to be considered a gap.
type of cache_overlaps: int, optional
cache_overlaps Caching mode: 0 = no caching, 1 = clear cache first, 2 = use and add to existing cache.
return type of : std::vector< VolumeGap,std:: allocator< VolumeGap > >
Returns
A list of VolumeGap objects, one per volume pair with detected gaps. Each VolumeGap contains:
  • volume1, volume2: the volume IDs
  • surfPairs: list of surface ID pairs
  • gaps: list of distances between surfaces
  • overlapAreas: list of overlap areas between surfaces.

◆ get_geometric_owner()

def cubit.get_geometric_owner (   mesh_entity_type,
  mesh_entity_list 
)

Get geometric owners for a set of mesh entities.

Returns the geometric owners of the specified mesh entities (e.g. "surface 3", "curve 5").

Title Supported mesh entity types

  • quad
  • face
  • tri
  • hex
  • tet
  • edge
  • node
.. code-block:: python
# Get owners of quads 1-8
owners = cubit.get_geometric_owner ("quad" , "1 to 8" )
print("Geometric owners of quads 1 to 8:" , owners)
# Example output: ['surface 1', 'curve 2', 'curve 3', 'surface 4', ...]
 @n type of mesh_entity_type:  string
Parameters
mesh_entity_type Mesh entity type: "quad", "face", "tri", "hex", "tet", "edge", or "node".
type of mesh_entity_list: string
mesh_entity_list Space-delimited mesh entity IDs (e.g. "all", "1 to 8", "1 2 3").
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of owner strings in the form "surface x", "curve y", etc.

◆ get_geometry_node_count()

def cubit.get_geometry_node_count (   entity_type,
  entity_id 
)

Get the number of mesh nodes on a geometric entity.

This function returns the count of mesh nodes associated with the specified geometric entity (surface, curve, etc.).

.. code-block:: python
# Create and mesh a brick
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query node count on surface 1
node_count = cubit.get_geometry_node_count ("surface" , 1)
print(f"Surface 1 has {node_count} node(s)." )
 @n type of entity_type:  string
Parameters
entity_type Type of the geometric entity ("surface", "curve", "volume", etc.).
type of entity_id: int
entity_id ID of the geometric entity.
return type of : int
Returns
Number of mesh nodes on the entity.

◆ get_geometry_owner()

def cubit.get_geometry_owner (   entity_type,
  entity_id 
)

Get the geometric owner of a mesh element.

This function returns the geometric entity that owns the specified mesh element. For example, it may return "surface 3", "volume 1", etc., indicating where the element lives.

.. code-block:: python
# Create geometry and mesh it
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the geometric owner of hex element 221
geom_owner = cubit.get_geometry_owner ("hex" , 221)
print(f"Geometric owner of hex 221: {geom_owner}" )
 @n type of entity_type:  string
Parameters
entity_type Mesh element type (e.g., "hex", "tet", "tri", "quad", etc.).
type of entity_id: int
entity_id ID of the mesh element.
return type of : string
Returns
Geometric owner of the element (e.g., "surface 3").

◆ get_geometry_type()

def cubit.get_geometry_type (   geom_type,
  ent_ids 
)

Return the analytic geometry type for a list of surfaces or curves.

This function behaves similar to get_surface_type and get_curve_type but accepts multiple IDs. Note also the difference in return types

.. code-block:: python
# Create a cylinder (curves 1 and 2 are circular edges).
cubit.cmd ("create cylinder radius 3 height 10" )
curve_ids = [1, 2]
curve_types = cubit.get_geometry_type ("curve" , curve_ids)
print(curve_types) # e.g., ['circle', 'circle']
 @n type of geom_type:  string
Parameters
geom_type Specifies the entity type: "curve" or "surface".
type of ent_ids: std::vector< int,std::allocator< int > >
ent_ids List of IDs for curves or surfaces to query.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
A vector of geometry-type strings in the same order as ent_ids. Valid curve types: "arc", "ellipse", "parabola", "segmented", "spline", "straight", "point", "helix", "hyperbola", "undefined", "unknown". Valid surface types: "cone", "plane", "sphere", "spline", "torus", "best_fit", "facet", "cylinder", "undefined", "unknown".

◆ get_global_element_id()

def cubit.get_global_element_id (   element_type,
  id 
)

Alias for get_exodus_id: get the Global Element ID for a local mesh entity.

This function is equivalent to get_exodus_id and returns the Global Element ID assigned to the specified local mesh entity within its type-specific ID space.

.. code-block:: python
# Create geometry, mesh it, and assign hex elements to block 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("block 1 hex all" )
# Query the Global Element ID of local hex 22
gid = cubit.get_global_element_id ("hex" , 22)
print("Global Element ID of hex 22:" , gid)
 @n type of element_type:  string
Parameters
element_type Type of the mesh entity ("hex", "tet", "wedge", "pyramid", "tri", "quad", "face", "edge", or "sphere").
type of id: int
id Local mesh entity ID within its type.
return type of : int
Returns
Global Element ID corresponding to the specified local entity.

◆ get_graphics_version()

def cubit.get_graphics_version ( )

Retrieve the VTK (Visualization Toolkit) version used by Cubit.

Returns the version string of the VTK graphics library integrated into Cubit.

.. code-block:: python
import cubit
vtk_version = cubit.get_graphics_version ()
print("VTK version:" , vtk_version)
 @n return type of :  string
Returns
A string containing the VTK version number.

◆ get_group_bodies()

def cubit.get_group_bodies (   group_id )

Return direct child body IDs for a specified group, if any.

.. code-block:: python

# Create geometry and copy the initial volume.
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
# Define group containing all bodies.
cubit.cmd ("group \"body_group\" add body all" )
# Query group ID by name.
body_group_id = cubit.get_id_from_name ("body_group" )
# Get direct child body IDs.
bodies = cubit.get_group_bodies (body_group_id)
# Print tuple-like output.
print(tuple(bodies)) # prints "(1,2)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of body IDs (empty if none).

◆ get_group_curves()

def cubit.get_group_curves (   group_id )

Return direct child curve IDs for a specified group, if any.

.. code-block:: python

# Create a brick and group all curves.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"curve_group\" add curve all" )
# Query group ID by name.
curve_group_id = cubit.get_id_from_name ("curve_group" )
# Get direct child curve IDs.
curves = cubit.get_group_curves (curve_group_id)
# Print tuple-like output.
print(tuple(curves)) # prints "(1,2,3,4,5,6,7,8,9,10,11,12)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of curve IDs (empty if none).

◆ get_group_edges()

def cubit.get_group_edges (   group_id )

Return direct child edge IDs for a specified group, if any.

.. code-block:: python

# Create geometry and mesh it.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume all" )
# Group all mesh edges on surface 1.
cubit.cmd ("group \"edge_group\" add edge in surf 1" )
# Query group ID by name.
edge_group_id = cubit.get_id_from_name ("edge_group" )
# Get direct child edge IDs.
edges = cubit.get_group_edges (edge_group_id)
# Print tuple-like output.
print(tuple(edges)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of edge IDs (empty if none).

◆ get_group_groups()

def cubit.get_group_groups (   group_id )

Retrieve direct child group IDs for a specified parent group, if any.

.. code-block:: python

# Create geometry and define groups.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"vert_group\" add vert in vol 1" )
cubit.cmd ("group 'curve_group' add curve in vol 1" )
cubit.cmd ("group \"parent_group\" add vert_group curve_group" )
# Query group IDs.
vert_group_id = cubit.get_id_from_name ("vert_group" )
curve_group_id = cubit.get_id_from_name ("curve_group" )
parent_group_id = cubit.get_id_from_name ("parent_group" )
# Get direct child group IDs.
child_groups = cubit.get_group_groups (parent_group_id)
# Print tuple-like output.
print(tuple(child_groups)) # prints "(2,3)"
 @n type of group_id:  int
Parameters
group_id ID of the parent group.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of child group IDs (empty if none).

◆ get_group_hexes()

def cubit.get_group_hexes (   group_id )

Return direct child hexahedral element IDs for a specified group, if any.

Hexahedral elements are generated on volumes using the default map scheme and meshed via: mesh volume all

.. code-block:: python
# Create and mesh geometry with hex elements.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume all" )
# Group all hex elements in volume 1.
cubit.cmd ("group \"hex_group\" add hex in vol 1" )
# Query group ID by name.
hex_group_id = cubit.get_id_from_name ("hex_group" )
# Get direct child hex IDs.
hexes = cubit.get_group_hexes (hex_group_id)
# Print tuple-like output.
print(tuple(hexes)) # prints "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of hex IDs (empty if none).

◆ get_group_nodes()

def cubit.get_group_nodes (   group_id )

Return direct child node IDs for a specified group, if any.

.. code-block:: python

# Create geometry, mesh it, and group all nodes.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume all" )
cubit.cmd ("group \"node_group\" add node in vol 1" )
# Query group ID by name.
node_group_id = cubit.get_id_from_name ("node_group" )
# Get direct child node IDs.
nodes = cubit.get_group_nodes (node_group_id)
# Print tuple-like output.
print(tuple(nodes)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of node IDs (empty if none).

◆ get_group_pyramids()

def cubit.get_group_pyramids (   group_id )

Return direct child pyramid element IDs for a specified group, if any.

.. code-block:: python

# Create geometry, duplicate volume 1 to create vol 2;
# mesh volume 1 with default hex scheme and vol 2 with tet elements,
# auto-generating pyramids at their interface.
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
cubit.cmd ("mesh volume 1" )
cubit.cmd ("vol 2 scheme tetmesh" )
cubit.cmd ("mesh volume 2" )
# Group all pyramid elements in vol 2.
cubit.cmd ("group \"pyramid_group\" add pyramid in vol 2" )
# Query group ID by name.
pyramid_group_id = cubit.get_id_from_name ("pyramid_group" )
# Get direct child pyramid IDs.
pyramids = cubit.get_group_pyramids (pyramid_group_id)
# Print tuple-like output.
print(tuple(pyramids)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of pyramid IDs (empty if none).

◆ get_group_quads()

def cubit.get_group_quads (   group_id )

Return direct child quad IDs for a specified group, if any.

.. code-block:: python

# Create and mesh geometry.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume all" )
# Group all quadrilateral faces on surface 1.
cubit.cmd ("group \"quad_group\" add face in surf 1" )
# Query group ID by name.
quad_group_id = cubit.get_id_from_name ("quad_group" )
# Get direct child quad IDs.
quads = cubit.get_group_quads (quad_group_id)
# Print tuple-like output.
print(tuple(quads)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of quad IDs (empty if none).

◆ get_group_spheres()

def cubit.get_group_spheres (   group_id )

Return direct child sphere element IDs for a specified group, if any.

Sphere elements are generated by inserting nodes or vertices into a block using: Block <id> {node|vertex} <id_range>

Once created, spheres can be located and grouped for querying.

.. code-block:: python
# Create volumes, set mesh size, and mesh all volumes.
cubit.cmd ("brick x 10" )
cubit.cmd ("vol all size 5" )
cubit.cmd ("mesh volume all" )
# Create a vertex to seed sphere and mesh to generate node.
cubit.cmd ("create vertex 0 0 10" )
sph_vtx_id = cubit.get_id_from_name ("vertex" )
cubit.cmd (f"mesh vertex {sph_vtx_id}" )
sph_nd = cubit.get_id_from_name ("node" )
# Generate sphere elements via block and spider commands on surface 1.
cubit.cmd ("block 1 volume 1" )
cubit.cmd (f"block 2 vertex {sph_vtx_id}" )
cubit.cmd (f"block 3 joint node {sph_nd} spider surf 1" )
cubit.cmd ("locate sphere all" )
cubit.cmd ("group \"sphere_group\" add sphere all" )
# Query and print sphere group elements.
sphere_group_id = cubit.get_id_from_name ("sphere_group" )
spheres = cubit.get_group_spheres (sphere_group_id)
print(tuple(spheres)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of sphere IDs (empty if none).

◆ get_group_surfaces()

def cubit.get_group_surfaces (   group_id )

Return direct child surface IDs for a specified group, if any.

.. code-block:: python

# Create geometry (brick produces six surfaces).
cubit.cmd ("brick x 10" )
# Define group containing all surfaces.
cubit.cmd ("group \"surf_group\" add surface all" )
# Query group ID by name.
surf_group_id = cubit.get_id_from_name ("surf_group" )
# Get direct child surface IDs.
surfaces = cubit.get_group_surfaces (surf_group_id)
# Print tuple-like output.
print(tuple(surfaces)) # prints "(1,2,3,4,5,6)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of surface IDs (empty if none).

◆ get_group_tets()

def cubit.get_group_tets (   group_id )

Return direct child tetrahedron IDs for a specified group, if any.

.. code-block:: python

# Create geometry, set meshing scheme, and mesh.
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh volume all" )
# Group all tetrahedral elements in volume 1.
cubit.cmd ("group \"tet_group\" add tet in vol 1" )
# Query group ID by name.
tet_group_id = cubit.get_id_from_name ("tet_group" )
# Get direct child tetrahedron IDs.
tets = cubit.get_group_tets (tet_group_id)
# Print tuple-like output.
print(tuple(tets)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of tetrahedron IDs (empty if none).

◆ get_group_tris()

def cubit.get_group_tris (   group_id )

Return direct child triangle IDs for a specified group, if any.

.. code-block:: python

# Create and mesh geometry.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume all" )
# Group all triangular faces on surface 1.
cubit.cmd ("group \"tri_group\" add tri in surf 1" )
# Query group ID by name.
tri_group_id = cubit.get_id_from_name ("tri_group" )
# Get direct child triangle IDs.
tris = cubit.get_group_tris (tri_group_id)
# Print tuple-like output.
print(tuple(tris)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of triangle IDs (empty if none).

◆ get_group_vertices()

def cubit.get_group_vertices (   group_id )

Return direct child vertex IDs for a specified group, if any.

.. code-block:: python

# Create geometry (brick creates vertices).
cubit.cmd ("brick x 10" )
# Define group containing all vertices.
cubit.cmd ("group \"vert_group\" add vertex all" )
# Query group ID by name.
vert_group_id = cubit.get_id_from_name ("vert_group" )
# Get direct child vertex IDs.
vertices = cubit.get_group_vertices (vert_group_id)
# Print tuple-like output.
print(tuple(vertices)) # prints "(1,2,3,4,5,6,7,8)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of vertex IDs (empty if none).

◆ get_group_volumes()

def cubit.get_group_volumes (   group_id )

Return direct child volume IDs for a specified group, if any.

.. code-block:: python

# Create geometry and copy volume.
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
# Define group containing all volumes.
cubit.cmd ("group \"vol_group\" add vol all" )
# Query group ID by name.
vol_group_id = cubit.get_id_from_name ("vol_group" )
# Get direct child volume IDs.
volumes = cubit.get_group_volumes (vol_group_id)
# Print tuple-like output.
print(tuple(volumes)) # prints "(1,2)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of volume IDs (empty if none).

◆ get_group_wedges()

def cubit.get_group_wedges (   group_id )

Return direct child wedge element IDs for a specified group, if any.

.. code-block:: python

# Create geometry, set surface meshing scheme to tris and sweep to create wedges.
cubit.cmd ("brick x 10" )
cubit.cmd ("surf 1 scheme trimesh" )
cubit.cmd ("mesh surf 1" )
cubit.cmd ("mesh volume all" )
# Group all wedge elements in volume 1.
cubit.cmd ("group \"wedge_group\" add wedge in vol 1" )
# Query group ID by name.
wedge_group_id = cubit.get_id_from_name ("wedge_group" )
# Get direct child wedge IDs.
wedges = cubit.get_group_wedges (wedge_group_id)
# Print tuple-like output.
print(tuple(wedges)) # prints something like "(1,2,3,...,n)"
 @n type of group_id:  int
Parameters
group_id ID of the group to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of wedge IDs (empty if none).

◆ get_heatflux_on_area()

def cubit.get_heatflux_on_area (   bc_area_enum,
  entity_id 
)

Get the heatflux value on a specified area.


type of bc_area_enum: int

Parameters
bc_area_enum CI_BCEntityTypes: 4 (solid), 7 (shell top), 8 (shell bottom).
type of entity_id: int
entity_id ID of the heatflux BC.
return type of : float
Returns
Heatflux value.

◆ get_hex_count()

def cubit.get_hex_count ( )

Retrieve the count of hexahedral elements in the current model.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("mesh vol 1" ) # mesh as hexes
hex_count = cubit.get_hex_count ()
print("Hex count:" , hex_count)
 @n return type of :  int
Returns
Number of hexahedral elements in the current model's mesh.

◆ get_hex_global_element_id()

def cubit.get_hex_global_element_id (   hex_id )

Get the Global Element ID for a specific hexahedral element.

This function returns the Global Element ID assigned to the given local hex ID when the element was placed into a block.

.. code-block:: python
# Create geometry, mesh it, and assign all hexes to block 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("block 1 hex all" )
# Query the Global Element ID of local hex 22
print("Global Element ID of hex 22:" , gid)
 @n type of hex_id:  int
Parameters
hex_id Local hexahedral element ID.
return type of : int
Returns
Global Element ID for the specified hex.

◆ get_hex_sheet()

def cubit.get_hex_sheet (   node_id_1,
  node_id_2 
)

Retrieve the IDs of all hexahedral elements forming a hex sheet through two nodes.

A hex sheet is a layer of contiguous hexes. The two node IDs define an edge perpendicular to that layer.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("mesh vol 1" ) # mesh volume 1 with hexes
# Assume nodes 5 and 6 form an edge perpendicular to a hex layer
hex_ids = cubit.get_hex_sheet (5, 6)
print("Hex sheet IDs:" , hex_ids)
 @n type of node_id_1:  int
Parameters
node_id_1 First node ID defining the edge perpendicular to the hex layer.
type of node_id_2: int
node_id_2 Second node ID defining the edge perpendicular to the hex layer.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector<int> or Python tuple) of hex IDs forming the contiguous sheet.

◆ get_hole_surfaces()

def cubit.get_hole_surfaces (   surface_id )

Return the surfaces in the hole adjacent to the specified surface.

The function returns a list of surface IDs that belong to the same hole as the given surface. The input surface_id must already be part of a hole. The result includes surface_id itself.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 1 height 10" )
cubit.cmd ("vol 2 move z 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
surf_id = 10
hole_surfs = cubit.get_hole_surfaces (surf_id)
print("Hole surfaces:" , tuple(hole_surfs))
# Expected output:
# Hole surfaces: (10, 11)
 @n type of surface_id:  int
Parameters
surface_id Surface ID that is part of a hole.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of surface IDs belonging to the hole (includes surface_id itself).

◆ get_hydraulic_radius_surface_area()

def cubit.get_hydraulic_radius_surface_area (   surface_id )

Compute the hydraulic radius of a specified surface.

Title Computation

  • hydraulic_radius = 4 * (surface_area / total_edge_length), where surface_area is the face area and total_edge_length is the sum of all edge lengths bounding the face
  • If total_edge_length is zero, returns 0.0
.. code-block:: python
cubit.cmd ("brick x 10" )
print("Cube face hydraulic radius:" , hr1) # Output: 10.0
cubit.cmd ("brick x 10 y 1 z 10" )
print("Skinny face hydraulic radius:" , hr2) # Output: 1.81818
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : float
Returns
Hydraulic radius of the specified surface (4 * area / total_edge_length), or 0.0 if no edges.

◆ get_hydraulic_radius_volume_area()

def cubit.get_hydraulic_radius_volume_area (   volume_id )

Compute the hydraulic radius of a specified volume.

Title Computation

  • hydraulic_radius = 6 * (enclosed_volume / total_surface_area)
  • enclosed_volume: measured volume of the body
  • total_surface_area: sum of areas of all faces
  • Returns 0.0 if total_surface_area is zero
.. code-block:: python
# Cube: volume = 1000, total face area = 600
cubit.cmd ("brick x 10" )
print("Cube hydraulic radius:" , hr_cube) # Output: 10.0
# Skinny brick: volume = 100, total face area = 240
cubit.cmd ("brick x 10 y 1 z 10" )
print("Skinny brick hydraulic radius:" , hr_skinny) # Output: 2.5
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : float
Returns
Hydraulic radius = 6 * (enclosed_volume / total_surface_area); 0.0 if total_surface_area is zero.

◆ get_id_from_name()

def cubit.get_id_from_name (   name )

Retrieve the integer ID of an entity by its name.

.. code-block:: python

# Create and name a vertex.
cubit.cmd ("vertex 22 name 'point_load'" )
# Query the ID using the name.
entity_id = cubit.get_id_from_name ("point_load" )
print("Entity ID:" , entity_id) # prints "22"
 @n type of name:  string
Parameters
name Name of the entity whose ID is requested.
return type of : int
Returns
Integer ID of the named entity.

◆ get_id_string()

def cubit.get_id_string (   entity_ids,
  sort = True 
)

Convert a list of integers into a compact Cubit-style ID range string.

Collapses consecutive IDs into "start to end" ranges and separates entries with commas. Unlike string_from_id_list() , this variant does not insert any newline characters.

.. code-block:: python
import cubit
ids = [3, 1, 2, 5, 6, 8]
# Default: sort then collapse
# s == "1 to 3, 5 to 6, 8"
# Without sorting:
s = cubit.get_id_string (ids, False )
# s == "3, 1 to 2, 5 to 6, 8"
 @n type of entity_ids:  std::vector< int,std::allocator< int > >
Parameters
entity_ids Vector of integer IDs to format.
type of sort: boolean, optional
sort If true (default), sort IDs ascending before collapsing ranges; if false, preserve the original order.
return type of : string
Returns
A single-line string representing the ID ranges (no line breaks).

◆ get_idless_signature()

def cubit.get_idless_signature (   entity_type,
  entity_id 
)

Get the idless signature of a geometric or mesh entity.

This function returns the idless signature of the specified entity. The idless signature is a position-based and ordinal-based reference to the entity, independent of its current ID.

Idless signatures are used to create version-independent journal files . Because entity IDs can change between different Cubit versions or after model operations (e.g., webcuts), using the idless signature ensures that journal files will still refer to the correct entity by position and ordinal rather than ID.

Example format of an idless signature: "volume at 3.42 5.66 6.32 ordinal 2" or "curve at (1 1 0 ordinal 2)"

Common usage scenario:

  • Enable journal idless on
  • Journal commands will record using idless references (rather than entity IDs)
  • Use get_idless_signature to retrieve the current idless reference for an entity programmatically
.. code-block:: python
# Create a brick
cubit.cmd ("brick x 10" )
# Retrieve the idless signature of surface 1
signature = cubit.get_idless_signature ("surface" , 1)
print(f"Idless signature of surface 1: {signature}" )
 @n type of entity_type:  string
Parameters
entity_type Type of the entity (e.g. "curve", "surface", "vertex", "volume", "face", etc.).
type of entity_id: int
entity_id ID of the requested entity.
return type of : string
Returns
Idless signature of the entity (e.g. "volume at x y z ordinal n").

Notes: For full context, see the Cubit command: journal idless {on | off | reverse} .

◆ get_idless_signatures()

def cubit.get_idless_signatures (   entity_type,
  entity_id_list 
)

Get the idless signatures of a range of geometric or mesh entities.

This function returns the idless signatures of the specified entities as a single string. The idless signature is a position-based and ordinal-based reference to each entity, independent of its current ID.

Idless signatures are used to create version-independent journal files . Since entity IDs can change between different Cubit versions or after model operations (e.g., webcuts), using idless signatures ensures that journal files remain valid by referring to entities by position and ordinal instead of ID.

The return string will contain one idless signature per entity, space-separated. Title Example:

  • "curve at (1 1 0 ordinal 2) curve at (0 0 1 ordinal 1) ..."
.. code-block:: python
# Create a brick and mesh it
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Prepare a list of surface IDs
surface_ids = [1, 2, 3]
# Get idless signatures of surfaces 1, 2, 3
signatures = cubit.get_idless_signatures ("surface" , surface_ids)
print(f"Idless signatures of surfaces 1-3: {signatures}" )
 @n type of entity_type:  string
Parameters
entity_type Type of the entities (e.g. "curve", "surface", "vertex", "volume", "face", etc.).
type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_list List of entity IDs.
return type of : string
Returns
A single string containing the idless signatures of the entities, space-separated.

Notes: For full context, see the Cubit command: journal idless {on | off | reverse} .

◆ get_int_sculpt_default()

def cubit.get_int_sculpt_default (   variable )

Retrieve default integer-valued sculpt parameter.

Matches the input variable name substring to known sculpt parameters and returns its default value.

Title Available integer parameters

  • NUM_PROC
  • DEBUG
  • NUM_LAPLACE
  • MAX_OPT_SMOOTH
  • MAX_PCOL
  • MAX_GQ_ITERS
  • DEG_ITERS
  • STAIR
  • CSMOOTH
  • SMOOTH
    * VOID_MAT, VOID
  • SIDESETS
    * HTET_METHOD, HTET
  • TRI_MESH
  • PILLOW_LAYERS
    * ADAPT_TYPE, ADAPT_LEVELS, ADAPT_LOAD_BALANCE, ADAPT_MEMORY_STATS
  • ALIGN
    * CAPTURE_SIDE, CAPTURE
    * DEFEATURE_MIN_VOL_CELLS, DEFEATURE_ITERS, DEFEATURE
    * MICRO_EXPAND, MICRO_SHAVE
  • QUIET
    * WRITE_GEOM, WRITE_MBG
  • MESHING_SCHEME
  • PRINT_ONLY
  • THREADS
  • BBOX_EXPAND
  • WEAR_METHOD
  • MIN_NUM_LAYERS
  • INPUT_MESH_MATERIAL


type of variable: string

Parameters
variable Name of the sculpt parameter substring.
return type of : int
Returns
Default integer value for the specified parameter.

◆ get_interface()

def cubit.get_interface (   interface_name )

Retrieve a Cubit interface by name.

Returns a pointer to the requested CubitBaseInterface instance, or nullptr if no matching interface is registered.

.. code-block:: python
import cubit
iface = cubit.get_interface ("MeshInterface" )

if iface is not None:

use iface ...

cubit.release_interface(iface)

  @n type of interface_name:  string
Parameters
interface_name Name of the interface to retrieve.
return type of : CubitBaseInterface
Returns
Pointer to the CubitBaseInterface, or nullptr if not found.

◆ get_label_type()

def cubit.get_label_type (   entity_type )

Gets the current label display type for a given entity type.

Queries the label display type currently associated with the specified entity type.

Valid entity_type values:

"RefVolume" , "RefFace" , "RefEdge" , "RefVertex" ,
"CubitHex" , "CubitTet" , "CubitFace" , "CubitTri" ,
"CubitEdge" , "CubitNode" , "CubitSphere"

Returned value corresponds to SVUtil::LabelType : 0=CUBIT_LABEL_NONE, 1=CUBIT_LABEL_ID, 2=CUBIT_LABEL_ELEMENT_ID, 3=CUBIT_LABEL_NAME, 4=CUBIT_LABEL_INTERVAL, 5=CUBIT_LABEL_SIZE, 6=CUBIT_LABEL_MERGE, 7=CUBIT_LABEL_IS_MERGED, 8=CUBIT_LABEL_FIRMNESS, 9=CUBIT_LABEL_SCHEME, 10=CUBIT_LABEL_NAME_ID, 11=CUBIT_LABEL_NAME_ONLY, 12=CUBIT_LABEL_SPHERE_ID

.. code-block:: python
label_type = cubit.get_label_type ("RefFace" )
print("Label type for RefFace:" , label_type)
 @n type of entity_type:  string
Parameters
entity_type Entity type to query.
return type of : int
Returns
Label display type (see list above).

◆ get_last_id()

def cubit.get_last_id (   entity_type )

Get the ID of the last created entity of the given type.

This function returns the ID of the most recently created entity of the specified type.

Supported entity types include: "vertex", "curve", "surface", "volume", "body", etc.

.. code-block:: python
# Create a brick
cubit.cmd ("brick x 10" )
# Query the last created surface ID
last_id = cubit.get_last_id ("surface" )
print(f"Last created surface ID: {last_id}" )
 @n type of entity_type:  string
Parameters
entity_type Type of the entity being queried (e.g. "surface", "curve", "volume").
return type of : int
Returns
Integer ID of the last created entity of the specified type.

◆ get_list_of_free_ref_entities()

def cubit.get_list_of_free_ref_entities (   geometry_type )

Get all free (unattached) entities of a given geometry type.

.. code-block:: python

cubit.cmd ("brick x 10" )
cubit.cmd ("create vertex 0 0 0" )
free_vertices = cubit.get_list_of_free_ref_entities ("vertex" )
print(free_vertices) # prints (9,)
 @n type of geometry_type:  string
Parameters
geometry_type Specifies the geometry type ("vertex", "curve", "surface", etc.).
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector or Python tuple) of IDs of detached entities of the specified type.

◆ get_material_name()

def cubit.get_material_name (   material_id )

Get the name of a material or CFD media by ID.


type of material_id: int

Parameters
material_id ID of the material or media.
return type of : string
Returns
Material or media name.

◆ get_material_name_list()

def cubit.get_material_name_list ( )

Get list of all material names.


return type of : std::vector< std::string,std::allocator< std:: string > >

Returns
List of material names.

◆ get_material_property()

def cubit.get_material_property (   material_property_enum,
  entity_id 
)

Get the value of a material property.


type of material_property_enum: int

Parameters
material_property_enum Property type (e.g., 0 = Elastic Modulus, 1 = Shear Modulus, etc.).
type of entity_id: int
entity_id ID of the material.
return type of : float
Returns
Value of the specified material property.

◆ get_media_name_list()

def cubit.get_media_name_list ( )

Get list of all CFD media names.


return type of : std::vector< std::string,std::allocator< std:: string > >

Returns
List of media names.

◆ get_media_property()

def cubit.get_media_property (   entity_id )

Get the media classification of a material.


type of entity_id: int

Parameters
entity_id ID of the media.
return type of : int
Returns
: Media type 0 = FLUID, 1 = POROUS, 2 = SOLID.

◆ get_merge_setting()

def cubit.get_merge_setting (   geometry_type,
  entity_id 
)

Get merge mode ("on", "off", or "auto") for a given entity.

By disabling merge on an entity, adjacent geometry remains separate-preserving material boundaries, distinct mesh regions, and contact interfaces.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create first brick (vol 1, surfaces 1-6)
cubit.cmd ("brick x 10" ) # create second brick (vol 2, surfaces 7-12)
cubit.cmd ("vol 2 move x 10" ) # move second brick so surfaces 6 and 10 touch
cubit.cmd ("surface 6 merge off" ) # prevent merging on surface 6
cubit.cmd ("merge all" ) # attempt to merge; volumes remain separate
mode = cubit.get_merge_setting ("surface" , 6) # returns "off"
print("Merge setting:" , mode) # prints "off"
Parameters
geom_type Geometry type ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity.
return type of : string
Returns
: The merge setting "on", "off", or "auto".

◆ get_merge_tolerance()

def cubit.get_merge_tolerance ( )

Return the current merge tolerance value.

The merge tolerance is an absolute distance value used to determine geometric correspondence when merging entities. Vertices, curves, and surfaces are compared using spatial checks within this tolerance. Entities closer than the merge tolerance are considered equivalent and may be merged, even if their parameterizations differ.

The default merge tolerance in Cubit is 5.0e-4. The lower limit is 1.0e-6. There is no defined upper limit.

.. code-block:: python
# Set the merge tolerance using a Cubit command:
cubit.cmd ("merge tolerance 0.005" )
# Get the current merge tolerance:
print("Current merge tolerance:" , tol)
# Expected output (example):
# Current merge tolerance: 0.005
 @n return type of :  float
Returns
The current merge tolerance value.

◆ get_mergeable_curves()

def cubit.get_mergeable_curves (   target_volume_ids )

Get the list of mergeable curves from a list of volumes or bodies.

Given a list of volume IDs, this function returns a list of lists of potentially mergeable curves. Each inner list contains the curve IDs of one set of curves that can be merged. Each set may contain more than two curves.

Curves are considered mergeable if they are within the current merge tolerance. If not explicitly set, the default merge tolerance is 1e-6.

In Python, the lists will be returned as Python tuples.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Volume 1
cubit.cmd ('brick x 10' ) # Volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 exactly adjacent to volume 1
target_volumes = [1, 2]
mergeable_curves = cubit.get_mergeable_curves (target_volumes)
print("Mergeable curves:" )

for group in mergeable_curves: print(group)

# Expected output:
# (1, 15)
# (5, 19)
# (10, 21)
# (12, 23)
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to examine.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
List of lists of mergeable curve IDs (potentially more than a pair). In Python, each inner list is returned as a tuple.

◆ get_mergeable_surfaces()

def cubit.get_mergeable_surfaces (   target_volume_ids )

Get the list of mergeable surfaces from a list of volumes or bodies.

Given a list of volume IDs, this function returns a list of lists of potentially mergeable surfaces. Each inner list contains the surface IDs of one set of surfaces that can be merged. Each set may contain more than two surfaces.

Surfaces are considered mergeable if they are within the current merge tolerance. If not explicitly set, the default merge tolerance is 1e-6.

In Python, the lists will be returned as Python tuples.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Volume 1
cubit.cmd ('brick x 10' ) # Volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 exactly adjacent to volume 1
target_volumes = [1, 2]
mergeable_surfaces = cubit.get_mergeable_surfaces (target_volumes)
print("Mergeable surfaces:" )

for group in mergeable_surfaces: print(group)

# Expected output:
# (6, 10)
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to examine.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
List of lists of mergeable surface IDs (potentially more than a pair). In Python, each inner list is returned as a tuple.

◆ get_mergeable_vertices()

def cubit.get_mergeable_vertices (   target_volume_ids )

Get the list of mergeable vertices from a list of volumes or bodies.

Given a list of volume IDs, this function returns a list of lists of potentially mergeable vertices. Each inner list contains the vertex IDs of one set of vertices that can be merged. Each set may contain more than two vertices.

Vertices are considered mergeable if they are within the current merge tolerance. If not explicitly set, the default merge tolerance is 1e-6.

In Python, the lists will be returned as Python tuples.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Volume 1
cubit.cmd ('brick x 10' ) # Volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 exactly adjacent to volume 1
target_volumes = [1, 2]
mergeable_vertices = cubit.get_mergeable_vertices (target_volumes)
print("Mergeable vertices:" )

for group in mergeable_vertices: print(group)

# Expected output:
# (1, 12)
# (2, 11)
# (5, 16)
# (6, 15)
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to examine.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
List of lists of mergeable vertex IDs (potentially more than a pair). In Python, each inner list is returned as a tuple.

◆ get_mesh_edge_length()

def cubit.get_mesh_edge_length (   edge_id )

Compute the length of a specified mesh edge.

Returns the geometric length, in model units, of the mesh edge with the given ID.

.. code-block:: python
import cubit
# Get the length of edge 10
print("Edge 10 length:" , length)
 @n type of edge_id:  int
Parameters
edge_id ID of the mesh edge whose length is requested.
return type of : float
Returns
The length of the specified mesh edge.

◆ get_mesh_element_type()

def cubit.get_mesh_element_type (   entity_type,
  entity_id 
)

Get the mesh element type applied to a geometric entity.

Returns the type of elements used to mesh the specified geometry. Possible return values: "hex", "tet", "pyramid", "wedge", "face" (quad), "tri", "edge", or "node". Returns an empty string if the entity has not been meshed.

.. code-block:: python
# Create a block and mesh volume 1 with tets
cubit.cmd ("brick x 10" )
cubit.cmd ("vol all scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Query the mesh type on surface 1
mesh_type = cubit.get_mesh_element_type ("surface" , 1)
print(f"Mesh element type on surface 1: {mesh_type}" ) # prints "tri"
 @n type of entity_type:  string
Parameters
entity_type Type of the geometry ("surface", "curve", "volume", etc.).
type of entity_id: int
entity_id ID of the geometry entity.
return type of : string
Returns
Name of the mesh element type on that entity, or empty if none.

◆ get_mesh_error_count()

def cubit.get_mesh_error_count ( )

◆ get_mesh_error_solutions()

def cubit.get_mesh_error_solutions (   error_code )

Retrieve recommended solutions and context cues for a mesh error.

Given a mesh error code, returns a triplet of strings: 1) Solution text describing how to correct the error. 2) Help context cue for detailed guidance. 3) Command-panel cue suggesting the UI panel or command to use.

.. code-block:: python
import cubit
# Lookup mesh error solutions for code 102
print("Solution: " , cues[0])
print("Help context: " , cues[1])
print("Command panel: " , cues[2])
 @n type of error_code:  int
Parameters
error_code Integer mesh error code for which to retrieve guidance.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of three strings: [0] solution text, [1] help context cue, [2] command-panel cue.

◆ get_mesh_errors()

def cubit.get_mesh_errors ( )

◆ get_mesh_geometry_approximation_angle()

def cubit.get_mesh_geometry_approximation_angle (   geometry_type,
  entity_id 
)

Get the geometry approximation angle for TriMesh/TetMesh on a given entity.

Returns the maximum deviation angle (in degrees) used to approximate curved CAD surfaces when meshing. A smaller angle yields more finely triangulated surfaces. The value may be explicitly set on a curve, surface, or volume, or computed from adjacent geometry if not user-set.

.. code-block:: python
# 1) Set geometry approximation angle to 10 degrees on volume 5.
cubit.cmd ("volume 5 scheme tetmesh geom approximation angle 10" )
# 2) Query the geometry approximation angle for volume 5.
print(f"Volume 5 geometry approximation angle: {angle} degrees" ) # Expected: 10
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity whose approximation angle is queried.
return type of : float
Returns
Geometry approximation angle in degrees (double); default is 15 if not set.

◆ get_mesh_group_parent_ids()

def cubit.get_mesh_group_parent_ids (   element_type,
  element_id 
)

Retrieve parent group IDs for a specific mesh element.

Returns IDs of all groups containing the given mesh element (excluding pick group).

.. code-block:: python
# Fetch groups that contain triangle element 332.
parent_id_list = cubit.get_mesh_group_parent_ids ("tri" , 332)
print("Parent groups for tri 332:" , parent_id_list)
 @n type of element_type:  string
Parameters
element_type Mesh element type (e.g., "node", "edge", "face"/"tri"/"quad", "volume"/"tet"/"hex").
type of element_id: int
element_id ID of the mesh element.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of group IDs containing this element.

◆ get_mesh_interval_firmness()

def cubit.get_mesh_interval_firmness (   geometry_type,
  entity_id 
)

Retrieve the interval firmness for a specified geometry entity.

Interval firmness determines whether a curve's interval count or size can be modified by other commands. Title Possible return values:

  • "HARD" - interval is locked (user-set directly via hard command).
  • "SOFT" - interval is a goal (may be adjusted by matching or other commands).
  • "LIMP" - no interval was explicitly set (default state).
.. code-block:: python
# 1) Create two vertices and a linear curve between them (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" ) # Vertex ID = 1
cubit.cmd ("create vertex 1 0 0" ) # Vertex ID = 2
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
# 2) By default, interval firmness is LIMP.
firmness = cubit.get_mesh_interval_firmness ("curve" , 1)
print("Curve 1 interval firmness:" , firmness) # Expected: "LIMP"
# 3) Set a "soft" interval count (upgrades firmness to SOFT).
cubit.cmd ("curve 1 interval count 10" )
firmness = cubit.get_mesh_interval_firmness ("curve" , 1)
print("Curve 1 interval firmness:" , firmness) # Expected: "SOFT"
# 4) Lock the interval with a "hard" command.
cubit.cmd ("curve 1 interval hard" )
firmness = cubit.get_mesh_interval_firmness ("curve" , 1)
print("Curve 1 interval firmness:" , firmness) # Expected: "HARD"
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type of the entity ("curve", "surface", or "volume").
Note
interval firmness applies to curves; "surface" and "volume" queries return combined firmness of contained curves.
type of entity_id: int
Parameters
entity_id ID of the entity whose interval firmness is queried.
return type of : string
Returns
: The current interval firmness "HARD", "SOFT", or "LIMP".

◆ get_mesh_intervals()

def cubit.get_mesh_intervals (   geometry_type,
  entity_id 
)

Get the mesh interval count for a specified entity.

Title Retrieves the number of mesh intervals (curve subdivisions) defined on a geometry entity.

  • For curves, this is the number of mesh edges along that curve.
  • For surfaces or volumes, it is the default interval count that their boundary curves inherit if no curve-level setting exists.
  • Curve-level interval settings always override surface- or volume-level settings.
.. code-block:: python
import cubit
curve_int = cubit.get_mesh_intervals ("curve" , 5)
surf_int = cubit.get_mesh_intervals ("surface" , 12)
 @n type of geometry_type:  string
Parameters
geometry_type Entity type: "curve", "surface", or "volume".
type of entity_id: int
entity_id ID of the geometry entity.
return type of : int
Returns
Mesh interval count on the curve, or inherited count for surface or volume (overridden by any curve-level setting).

◆ get_mesh_scheme()

def cubit.get_mesh_scheme (   geometry_type,
  entity_id 
)

Retrieve the meshing scheme applied to a geometric entity.

Returns the name of the scheme currently set on the specified entity. This can be called at any time after a scheme has been assigned (e.g., via cubit.cmd("vol 1 scheme sweep") ) to confirm which scheme is in use.

.. code-block:: python
cubit.cmd ('surface 12 scheme pave' )
scheme = cubit.get_mesh_scheme ("surface" , 12)
print("Surface 12 uses scheme:" , scheme)
 @n type of geometry_type:  string
Parameters
geometry_type Type of geometry ("curve", "surface", "volume").
type of entity_id: int
entity_id ID of the entity whose scheme is queried.
return type of : string
Returns
The meshing scheme name currently applied (e.g., "sweep", "bias", "tetmesh").

◆ get_mesh_scheme_firmness()

def cubit.get_mesh_scheme_firmness (   geometry_type,
  entity_id 
)

Retrieve the meshing scheme firmness for a specified surface or volume.

Scheme firmness controls whether a user-assigned scheme can be overridden by automatic selection. Valid firmness values are "Default" (automatic selection allowed), "Soft" (automatic selection preferred), and "Hard" (scheme locked and not changed by automatic selection). Only "surface" and "volume" entities support scheme firmness.

.. code-block:: python
# Assume surface 12 already exists and has a meshing scheme assigned.
# 1) Lock the surface's scheme by setting firmness to "Hard":
cubit.cmd ("surface 12 scheme hard" )
# 2) Query the firmness for surface 12:
firmness = cubit.get_mesh_scheme_firmness ("surface" , 12)
print("Surface 12 firmness:" , firmness) # Expected: "Hard"
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("surface" or "volume").
type of entity_id: int
entity_id ID of the entity whose scheme firmness is queried.
return type of : string
Returns
The current scheme firmness ("Default", "Soft", or "Hard").

◆ get_mesh_size()

def cubit.get_mesh_size (   geometry_type,
  entity_id 
)

Retrieve the effective target edge length for meshing an entity.

Returns the mesh size (in model units) used when generating 2D or 3D elements.

  • If no size is set on the entity, it inherits the size from its parent.
  • If no size is set anywhere in the hierarchy, the default automatic size is used.
.. code-block:: python
import cubit
size = cubit.get_mesh_size ("curve" , 7)
print("Mesh size on curve 7:" , size)
 @n type of geometry_type:  string
Parameters
geometry_type Entity type: "curve", "surface", or "volume".
type of entity_id: int
entity_id ID of the entity to query.
return type of : float
Returns
Effective mesh edge length (inherited or default auto size).

◆ get_mesh_size_type()

def cubit.get_mesh_size_type (   geometry_type,
  entity_id 
)

Retrieve the mesh size setting type for a specified entity.

Unlike get_mesh_interval_firmness() , which returns the firmness of an interval count (number of edges), this function returns the status of a target edge length ("mesh size") setting. The returned value may reflect direct user input, automatic calculation from connected geometry, or lack of any setting.

Title Possible return values are:

  • "USER_SET" - The mesh size (edge length) was explicitly set by the user on this entity.
  • "CALCULATED" - The mesh size was inferred or computed based on adjacent geometry or default rules.
  • "NOT_SET" - No mesh size has been set, either by user or by calculation.
.. code-block:: python
# 1) Create two vertices and a linear curve between them (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" ) # Vertex ID = 1
cubit.cmd ("create vertex 1 0 0" ) # Vertex ID = 2
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
# 2) Initially, no mesh size is set, so status is NOT_SET.
size_type = cubit.get_mesh_size_type ("curve" , 1)
print("Curve 1 mesh size type:" , size_type) # Expected: "NOT_SET"
# 3) Explicitly set a mesh size (target edge length) of 0.1 on curve 1 and mesh it.
cubit.cmd ("curve 1 size 0.1" )
cubit.cmd ("mesh curve 1" )
size_type = cubit.get_mesh_size_type ("curve" , 1)
print("Curve 1 mesh size type:" , size_type) # Expected: "USER_SET"
# 4) If a parent surface or automatic process assigns a size, querying the curve may yield "CALCULATED".
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity whose mesh size type is queried.
return type of : string
Returns
: The entity's mesh size status "USER_SET", "CALCULATED", or "NOT_SET".

◆ get_meshed_volume_or_area()

def cubit.get_meshed_volume_or_area (   geometry_type,
  entity_ids 
)

Sum mesh volumes or surface areas for CAD entities or mesh elements.

  • If geometry_type is "volume" or "surface", sums the volumes or areas of all mesh elements attached to those entities.
  • If geometry_type is "hex", "tet", "tri", or "quad", sums volumes (hex,tet) or areas (tri,quad) of the specified mesh element IDs.
.. code-block:: python
import cubit
vol = cubit.get_meshed_volume_or_area ("volume" , [1])
area = cubit.get_meshed_volume_or_area ("tri" , [10, 11])
 @n type of geometry_type:  string
Parameters
geometry_type "volume","surface","hex","tet","tri", or "quad".
type of entity_ids: std::vector< int,std::allocator< int > >
entity_ids Vector of IDs for the specified type.
return type of : float
Returns
Total mesh volume (3D) or area (2D).

◆ get_meshgems_version()

def cubit.get_meshgems_version ( )

Retrieve the MeshGems library version.

Returns the version string of the MeshGems library used by Cubit.

.. code-block:: python
import cubit
meshgems_version = cubit.get_meshgems_version ()
print("MeshGems version:" , meshgems_version)
 @n return type of :  string
Returns
A string containing the MeshGems library version.

◆ get_ML_classification()

def cubit.get_ML_classification (   geom_type,
  ent_id 
)

Get the top classification label for a single volume or surface.

This function performs the full classification workflow, equivalent to calling get_ML_operation_features() followed by get_ML_predictions() . It uses the appropriate model ("volume_no_op" for volumes or "classify_surface" for surfaces) and returns the category with the highest predicted probability.


type of geom_type: string

Parameters
geom_type Geometry type indicator: "volume" or "surface".
type of ent_id: int
ent_id ID of the volume or surface entity to classify.
return type of : string
Returns
String label of the highest-confidence category.
   .. code-block:: python
classification = cubit.get_ML_classification ("surface" , 20)
print("Predicted classification:" , classification)

◆ get_ML_classification_categories()

def cubit.get_ML_classification_categories (   geom_type )

Retrieve all available classification categories for a geometry type.

This function queries the ML system for every label used to classify volumes or surfaces. It can also accept the specific ML model type, such as "volume_no_op" or "surface_classification".


type of geom_type: string

Parameters
geom_type Geometry type ("volume" or "surface"). Also supports the ML model type, e.g., "volume_no_op" or "surface_classification".
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of category names.
   .. code-block:: python
categories = cubit.get_ML_classification_categories ("surface" )
print("Classification categories for surface:" , categories)

◆ get_ML_classification_models()

def cubit.get_ML_classification_models ( )

Retrieve the list of supported classification ML model names.

Queries the ML subsystem for all available classification models used for labeling or categorization.


return type of : std::vector< std::string,std::allocator< std:: string > >

Returns
Vector of classification model names; empty if none are registered.
   .. code-block:: python
print("Available classification models:" , models)

◆ get_ML_classifications()

def cubit.get_ML_classifications (   geom_type,
  ent_ids 
)

Classify multiple volumes or surfaces in a single batch operation.

Perform classification on a collection of entities at once to improve efficiency over repeated individual calls.


type of geom_type: string

Parameters
geom_type Geometry type to classify ("volume" or "surface").
type of ent_ids: std::vector< size_t,std::allocator< size_t > >
ent_ids Vector of entity IDs (volumes or surfaces) to classify.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of predicted category labels, in the same order as ent_ids.

◆ get_ML_feature_distance()

def cubit.get_ML_feature_distance (   op_name,
  f1,
  f2 
)

Compute the weighted distance between two feature vectors.

Applies operation-specific importance weights derived from an ensemble of decision trees to each feature, then calculates the Euclidean distance between the weighted vectors. The distance indicates the geometric or topological similarity between the two entities, where a distance of zero signifies an exact match.


type of op_name: string

Parameters
op_name ML operation name (see get_ML_operation_features()).
type of f1: std::vector< double,std::allocator< double > >
f1 First feature vector; must match f2 in length.
type of f2: std::vector< double,std::allocator< double > >
f2 Second feature vector; must match f1 in length.
return type of : float
Returns
Weighted distance between the two feature vectors. A distance of zero indicates an exact match between the entities.
   .. code-block:: python
# Retrieve features for two entities
op_names = ['surface_no_op' ]
entity1_ids = [5, 10] # Two entities
entity2_ids = [0, 0] # None for surface_no_op
params = [[-1, -1, -1]]
mesh_size = 1.5
op_names, entity1_ids, entity2_ids, params, mesh_size)
# Compute the weighted distance between the features of the two entities
distance = cubit.get_ML_feature_distance ("surface_no_op" , features[0], features[1])
print("Weighted distance:" , distance)

◆ get_ML_feature_importances()

def cubit.get_ML_feature_importances (   op_name )

Retrieve feature importance scores for a given ML operation.

Queries the trained model to obtain the relative importance of each feature used in the specified operation.


type of op_name: string

Parameters
op_name ML operation identifier (e.g., "remove_cone").
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector of importance values for each feature, in the same order as get_ML_operation_features().
.. code-block:: python
feature_names = cubit.get_ML_operation_feature_names ("remove_cone" )
importances = cubit.get_ML_feature_importances ("remove_cone" )
print("Feature importances for remove_cone:" )

for i in range(len(feature_names)): print(f"{feature_names[i]}\t{importances[i]}")

◆ get_ML_features()

def cubit.get_ML_features (   ml_op_names,
  entity1_ids,
  entity2_ids,
  params,
  mesh_size,
  reduced_features = False 
)

Compute ML feature vectors for operations permitting multiple entities.

This is a batch variant of get_ML_operation_features() that accepts lists of IDs per operation, enabling feature extraction across multiple entities at once.


type of ml_op_names: std::vector< std::string,std::allocator< std::string > >

Parameters
ml_op_names Vector of ML operation/model names.
type of entity1_ids: std::vector< std::vector< size_t,std::allocator< size_t > >,std::allocator< std::vector< size_t,std::allocator< size_t > > > >
entity1_ids Vector of vectors of primary entity IDs per operation.
type of entity2_ids: std::vector< std::vector< size_t,std::allocator< size_t > >,std::allocator< std::vector< size_t,std::allocator< size_t > > > >
entity2_ids Vector of vectors of secondary entity IDs per operation.
type of params: std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >
params Vector of parameter lists for each operation.
type of mesh_size: float
mesh_size Target mesh size for feature calculations.
type of reduced_features: boolean, optional
reduced_features If true (where supported), compute a reduced feature set for faster performance.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
Outer vector size == ml_op_names.size(); each inner vector contains the feature values for that operation.
   .. code-block:: python
ml_op_names = ['surface_no_op' , 'surface_no_op' ]
entity1_ids = [[20, 25], [30, 35]]
entity2_ids = [[0, 0], [0, 0]]
params = [[-1, -1, -1], [-1, -1, -1]]
mesh_size = 1.5924
features = cubit.get_ML_features (
ml_op_names, entity1_ids, entity2_ids, params, mesh_size)

◆ get_ML_initialize_surviving_entities()

def cubit.get_ML_initialize_surviving_entities (   op_name,
  ent1,
  ent2 
)

Capture entities for survival tracking before a CAD operation.

This function sets a baseline for CAD operation models that measure mesh quality before and after the operation. It is used with get_ML_surviving_entities() to identify entities that replace or correspond to the originals after the operation.


type of op_name: string

Parameters
op_name ML operation name (e.g., "remove_cone").
type of ent1: std::vector< int,std::allocator< int > >
ent1 List of primary entity IDs involved in the operation.
type of ent2: std::vector< int,std::allocator< int > >
ent2 List of secondary entity IDs involved in the operation.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of entity IDs for survival tracking.
   .. code-block:: python
ent1 = [5]
ent2 = [0]
survivors = cubit.get_ML_initialize_surviving_entities ("remove_cone" , ent1, ent2)
print("Surviving entity ID:" , survivors[0])

◆ get_ML_model_ID()

def cubit.get_ML_model_ID (   model_name )

Retrieve the unique numeric ID for a given ML model or operation name.

Looks up the internal mapping from a model or operation name to its assigned ID.


type of model_name: string

Parameters
model_name Name of the ML model or operation to query.
return type of : int
Returns
Positive integer ID on success; 0 if not found or on error.
   .. code-block:: python
model_id = cubit.get_ML_model_ID ("surface_no_op" )
print("Model ID for surface_no_op:" , model_id)

◆ get_ML_model_name()

def cubit.get_ML_model_name (   model_ID )

Retrieve the name of an ML model based on its ID.

This function returns the name of the ML model corresponding to the provided model ID. The model name is used to identify a specific machine learning model that can be used for various operations such as classification or prediction.


type of model_ID: int

Parameters
model_ID The unique identifier for the ML model.
return type of : string
Returns
The name of the ML model corresponding to the provided ID.
   .. code-block:: python
model_ID = 1
model_name = cubit.get_ML_model_name (model_ID)
print("Model name for ID" , model_ID, ":" , model_name)

◆ get_ML_operation()

def cubit.get_ML_operation (   op_name,
  entity_id1,
  entity_id2,
  params,
  small_curve_size,
  mesh_size 
)

Generate the command, display label, and preview text for an ML operation.

Constructs three strings for the specified operation and entities:

  1. the Cubit command to execute the operation,
  2. a human-readable display label,
  3. a preview description.


type of op_name: string

Parameters
op_name Name of the ML operation (see get_ML_operation_features).
type of entity_id1: int
entity_id1 ID of the primary entity involved in the operation.
type of entity_id2: int
entity_id2 ID of the secondary entity involved in the operation.
type of params: std::vector< double,std::allocator< double > >
params Optional vector of parameter values for the operation.
type of small_curve_size: float
small_curve_size Threshold below which a curve is considered "small." Used for tailoring command generation.
type of mesh_size: float
mesh_size Target mesh size parameter for the operation.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
A vector of three strings:
  • [0] = execution command,
  • [1] = display label,
  • [2] = preview text.
   .. code-block:: python
operation = cubit.get_ML_operation (
"surface_no_op" , 5, 0, [-1, -1, -1], 0.1, 1.5)
print("Command:" , operation[0])
print("Label:" , operation[1])
print("Preview:" , operation[2])

◆ get_ML_operation_feature_names()

def cubit.get_ML_operation_feature_names (   ml_op_name,
  reduced_features = False 
)

Retrieve the list of feature names for a specified ML operation.

This function returns a vector of strings naming each feature in the operation's input vector.


type of ml_op_name: string

Parameters
ml_op_name Name of the ML operation or model (as defined by get_ML_operation_features()).
type of reduced_features: boolean, optional
reduced_features If true (currently only for "volume_no_op"), return the reduced set of feature names (9) instead of the full set (46) for faster inference.
@n return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of feature name strings, in the same order as the corresponding feature values.
.. code-block:: python
# print names of all features with their type and feature value for surface_no_op
feature_names = cubit.get_ML_operation_feature_names ("surface_no_op" )
feature_types = cubit.get_ML_operation_feature_types ("surface_no_op" )
features = cubit.get_ML_operation_features (['surface_no_op' ], [[20]], [[0]], [[-1, -1, -1]], 1.5)
# Print the feature details
print("Feature details for surface_no_op:" )

for i in range(len(feature_names)): print(f"{i}\t{feature_names[i]}\t{feature_types[i]}\t{features[0][i]}")

◆ get_ML_operation_feature_size()

def cubit.get_ML_operation_feature_size (   ml_op_name,
  reduced_features = False 
)

Retrieve the expected feature-vector length for a given ML operation.

For the specified operation (as described by get_ML_operation_features() ), this function returns the number of features that the model expects as input.


type of ml_op_name: string

Parameters
ml_op_name Name of the ML operation or model.
type of reduced_features: boolean, optional
reduced_features If true (currently only supported for "volume_no_op"), returns the reduced feature count (9) instead of the full feature set (46) for more efficient predictions.
return type of : int
Returns
Number of features expected by the operation.
   .. code-block:: python
feature_size = cubit.get_ML_operation_feature_size ("surface_no_op" )
print("Expected feature size for surface_no_op:" , feature_size)

◆ get_ML_operation_feature_types()

def cubit.get_ML_operation_feature_types (   ml_op_name,
  reduced_features = False 
)

Get the data-type descriptor for each feature of a specified ML operation.

This function returns a list of strings indicating the type of data expected for each feature in the operation's input vector. The types can be:

  • "boolean" (binary flags: 0 or 1)
  • "categorical" (integer codes representing discrete categories, e.g., surface type)
  • "continuous" (numeric values spanning a range, e.g., curve count or surface area)


type of ml_op_name: string

Parameters
ml_op_name Name of the ML model or operation (see get_ML_operation_features()).
type of reduced_features: boolean, optional
reduced_features If true (currently only for "volume_no_op"), returns types for the reduced feature set (9) instead of the full set (46).
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of data-type strings matching the order of the feature values.
   .. code-block:: python
feature_types = cubit.get_ML_operation_feature_types ("surface_no_op" )
print("Feature types for surface_no_op:" , feature_types)

◆ get_ML_operation_features()

def cubit.get_ML_operation_features (   ml_op_names,
  entity1_ids,
  entity2_ids,
  params,
  mesh_size,
  reduced_features = False 
)

Compute ML feature vectors for a list of Cubit operations.

This function computes machine learning feature vectors for a list of Cubit operations based on specified parameters, including entity IDs and target mesh size. It returns the computed feature vectors for each operation.

.. code-block:: python
ml_op_names = ['surface_no_op' , 'surface_no_op' ]
entity1_ids = [20, 25] # surface IDs
entity2_ids = [0, 0] # none for surface_no_op
params = [[-1, -1, -1], [-1, -1, -1]]
mesh_size = 1.5924
ml_op_names, entity1_ids, entity2_ids, params, mesh_size)

Supported operations:

.. code-block:: c++

      ID | Type | #Labels | Name                    | Entity1 | Entity2  | Params
      ---------------------------------------------------------------------------
      1 |  R   |   3     | vertex_no_op            | vertex  | none     |
      2 |  R   |   3     | curve_no_op             | curve   | none     |
      3 |  R   |   3     | surface_no_op           | surface | none     |
      4 |  C   |   1     | volume_no_op            | volume  | none     |
      5 |  R   |   3     | remove_surface          | surface | none     |
      6 |  R   |   3     | tweak_replace_surface   | surface | surface  |
      7 |  R   |   3     | composite_surfaces      | surface | surface  |
      8 |  R   |   3     | collapse_curve          | curve   | vertex   |
      9 |  R   |   3     | remove_topology_curve   | curve   | curve    |
     10 |  R   |   3     | virtual_collapse_curve  | curve   | vertex   |
     11 |  R   |   3     | remove_topology_surface | surface | surface  |
12 | R | 3 | blunt_tangency | vertex | none | remove_mat, angle, depth

13 | R | 3 | remove_cone | surface | none |

14 | R | 3 | collapse_angle | vertex | none | real_split, angle, comp_vertex

15 | R | 3 | remove_blend | surface | none | 16 | R | 3 | remove_cavity | surface | none |

17 | R | 3 | copy_surface | volume | surface | nsurfs, id0, loft0, thick0, ...
18 | R | 3 | midsurface | volume | surf0 | surf1, loft, thick

19 | C | 1 | classify_surface | surface | none |


type of ml_op_names: std::vector< std::string,std::allocator< std::string > >

Parameters
ml_op_names Vector of ML operation/model names.
type of entity1_ids: std::vector< size_t,std::allocator< size_t > >
entity1_ids Vector of primary entity IDs for each operation.
type of entity2_ids: std::vector< size_t,std::allocator< size_t > >
entity2_ids Vector of secondary entity IDs for each operation.
type of params: std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >
params Vector of parameter lists for each operation.
type of mesh_size: float
mesh_size Target mesh size for feature calculations.
type of reduced_features: boolean, optional
reduced_features If true (where supported), compute a reduced feature set for faster performance.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
Outer vector size == ml_op_names.size(); each inner vector contains the feature values for that operation.

◆ get_ML_operation_label_size()

def cubit.get_ML_operation_label_size (   ml_op_name )

Retrieve the expected label vector length for a given ML operation.

Returns the number of entries in the output label vector for the specified operation or model.


type of ml_op_name: string

Parameters
ml_op_name Name of the ML operation or model.
return type of : int
Returns
Number of labels in the operation's output vector.
   .. code-block:: python
label_size = cubit.get_ML_operation_label_size ("surface_no_op" )
print("Label size for surface_no_op:" , label_size)

◆ get_ML_predictions()

def cubit.get_ML_predictions (   ml_op_names,
  entity1_ids,
  entity2_ids,
  params,
  mesh_size,
  reduced_features = False 
)

Compute ML predictions for a list of operations on single-entity pairs.

This function loads the ML training data (if not already loaded), computes features for each specified operation and its associated entities, and then runs predictions using a scikit-learn ensemble of decision trees.


type of ml_op_names: std::vector< std::string,std::allocator< std::string > >

Parameters
ml_op_names Vector of ML operation or model names.
Classification "volume_no_op", "classify_surface" (returns confidence per category).
Regression various operation IDs (returns one or more quality metrics).
type of entity1_ids: std::vector< size_t,std::allocator< size_t > >
entity1_ids Vector of primary entity IDs for each operation.
type of entity2_ids: std::vector< size_t,std::allocator< size_t > >
entity2_ids Vector of secondary entity IDs for each operation.
type of params: std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >
params Vector of parameter lists for each operation.
type of mesh_size: float
mesh_size Target mesh size used in feature calculation.
type of reduced_features: boolean, optional
reduced_features If true (where supported), use the reduced feature set for faster inference.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
Outer vector matches ml_op_names length; each inner vector contains the predicted values for that operation:
  • Classification: confidences (0-1) per category.
  • Regression: one or more metrics as defined per model.
   .. code-block:: python
ml_op_names = ['volume_no_op' , 'classify_surface' ]
entity1_ids = [5, 10] # volume IDs
entity2_ids = [0, 0] # none for classification
params = [[-1, -1, -1], [-1, -1, -1]]
mesh_size = 1.5
predictions = cubit.get_ML_predictions (
ml_op_names, entity1_ids, entity2_ids, params, mesh_size)

◆ get_ML_regression_models()

def cubit.get_ML_regression_models ( )

Retrieve the list of supported regression ML model names.

Queries the ML subsystem for all available regression models used for prediction or analysis.


return type of : std::vector< std::string,std::allocator< std:: string > >

Returns
Vector of regression model names; empty if no models are registered.
   .. code-block:: python
print("Available regression models:" , models)

◆ get_ML_surviving_entities()

def cubit.get_ML_surviving_entities (   op_name,
  begin_ents 
)

Identify which entities survive after a CAD operation.

Uses the snapshot from get_ML_initialize_surviving_entities() to find entities that remain or correspond to the initial set after the operation is completed.


type of op_name: string

Parameters
op_name Name of the ML operation.
type of begin_ents: std::vector< int,std::allocator< int > >
begin_ents Entity ID list from get_ML_initialize_surviving_entities().
return type of : std::pair< std::string,std::vector< int,std:: allocator< int > > >
Returns
A pair:
  • first = entity type ("vertex", "curve", etc.),
  • second = list of surviving entity IDs.
 .. code-block:: python
# Step 1: Initialize the baseline entity IDs
ent1 = [5] # Primary entity (surface 5)
ent2 = [0] # No secondary entities for the operation
params = [[-1, -1, -1]]
mesh_size = 1.5
begin_ents = cubit.get_ML_initialize_surviving_entities ("remove_surface" , ent1, ent2)
# Step 2: Perform the operation (remove surface 5)
cubit.cmd ("remove surface 5" )
# Step 3: Retrieve the surviving entities
result = cubit.get_ML_surviving_entities ("remove_surface" , begin_ents)
# Print the surviving entity type and ID
print("Surviving entity type:" , result[0])

for id in result[1]: print("Surviving entity ID:", id)

◆ get_moment_magnitude()

def cubit.get_moment_magnitude (   entity_id )

Get the moment magnitude of a force BC.


type of entity_id: int

Parameters
entity_id ID of the force BC.
return type of : float
Returns
Moment magnitude.

◆ get_n_largest_distances_between_meshes()

def cubit.get_n_largest_distances_between_meshes (   n,
  entity_type1,
  ids1,
  entity_type2,
  ids2 
)

Finds the N largest node-to-element distances between two meshes.

For each node on the entities in ids1 , computes its distance to nearby elements on ids2 .

  * Only triangle and quad elements are supported. For a distance to be included:

      * The node and element must be sufficiently facing each other (dot product of normals < -0.65).
      * The distance must be smaller than the element's bounding box size.



  * The function returns the N largest such distances found. For each, the following are returned:

      * Distance between the node and element.
      * Node ID.
      * Element ID.



  * The result is a flat vector of 3 * N doubles, ordered by decreasing distance.

  * This function is useful for:

      * Checking mesh alignment between surfaces.
      * Identifying large mesh gaps.
      * Identifying overlapping regions where contact conditions are expected.



  * Overlapping meshes in such cases can cause problems in FEA analyses if not corrected.






.. code-block:: python
# Surface IDs for first mesh (source nodes)
ids1 = [1, 2]
# Surface IDs for second mesh (target elements)
ids2 = [3, 4]
distances = cubit.get_n_largest_distances_between_meshes (5, "surface" , ids1, "surface" , ids2)

for i in range(0, len(distances), 3): print("Distance:", distances[i], "Node ID:", int(distances[i+1]), "Element ID:", int(distances[i+2]))

  @n type of n:  int
Parameters
n Number of largest distances to return.
type of entity_type1: string
entity_type1 Entity type for first mesh (e.g., "surface").
type of ids1: std::vector< int,std::allocator< int > >
ids1 IDs of entities to use for nodes.
type of entity_type2: string
entity_type2 Entity type for second mesh (e.g., "surface").
type of ids2: std::vector< int,std::allocator< int > >
ids2 IDs of entities to use for elements.
  @n return type of : std::vector< double,std:: allocator< double > >
Returns
Flat vector of (distance, node ID, element ID) triplets, size = 3 * N.

◆ get_narrow_regions()

def cubit.get_narrow_regions (   target_ids,
  narrow_size 
)

Find faces containing narrow regions within specified volumes.

Collects all unique faces of volumes in target_ids. For each face:

  • If the face has a single boundary loop, looks for "split" locations between non-adjacent edges where edges come within narrow_size without a short vertex chain between them.
  • If the face has multiple loops, computes the minimum distance between loops; if any two loops come within narrow_size, the face is included. Faces meeting either criterion are returned.

This function differs from get_closed_narrow_surfaces by applying to all faces (not just closed two-loop faces), and from get_surfs_with_narrow_regions by using split-point and loop-to-loop proximity tests rather than purely edge-pair orientation checks.

.. code-block:: python
cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("modify curve 1 blend radius 0.5" )
cubit.cmd ("cylinder radius 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
narrow_thresh = 1.0
narrow_faces = cubit.get_narrow_regions ([1], narrow_thresh)
print(narrow_faces)
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_ids Vector of volume IDs to examine.
type of narrow_size: float
narrow_size Distance threshold for detecting narrow regions.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of surface IDs that contain narrow regions.

◆ get_narrow_surfaces()

def cubit.get_narrow_surfaces (   target_volume_ids,
  mesh_size 
)

Find surfaces with narrow regions in specified volumes.

For each face of volumes in target_volume_ids, checks if any two non-adjacent edges form a narrow region (distance <= mesh_size and orientation difference > 15deg). Returns all face IDs that meet this criterion.

.. code-block:: python
volume_ids = [1, 2]
mesh_size = 0.1 # Distance threshold.
narrow_surfaces = cubit.get_narrow_surfaces (volume_ids, mesh_size)

for sid in narrow_surfaces: print("Narrow surface ID:", sid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Distance threshold for detecting narrow regions.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of surfaces containing a narrow region.

◆ get_nearby_entities()

def cubit.get_nearby_entities (   gtype,
  ent_ids,
  compare_ents,
  distance 
)

Identify nearby entities of type curve, surface, or volume for a given list of the same type.

Returns a list of entities of type gtype that are within the specified distance of the entities in ent_ids . If compare_ents is empty, all entities of type gtype in the model will be used for comparison.

If distance is set to -1, a default tolerance will be computed internally.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10.5' ) # Move volume 2 slightly away from volume 1
gtype = "volume"
ent_ids = [1]
compare_ents = [] # Empty list = check against all volumes
distance = 1.0
nearby_ents = cubit.get_nearby_entities (gtype, ent_ids, compare_ents, distance)
print("Nearby volumes to volume 1:" )

for id in nearby_ents: print(id)

# Expected output:
# 2
 @n type of gtype:  string
Parameters
gtype Entity type to query: "curve", "surface", or "volume".
type of ent_ids: std::vector< int,std::allocator< int > >
ent_ids Entities of type gtype to check.
type of compare_ents: std::vector< int,std::allocator< int > >
compare_ents Entities of type gtype to check against. If empty, checks against all entities of type gtype in the model.
type of distance: float
distance Maximum distance between entities. If -1, a default tolerance will be computed.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of entity IDs of type gtype that are within distance of the entities in ent_ids.

◆ get_nearby_volumes_at_volume()

def cubit.get_nearby_volumes_at_volume (   volume_id,
  compare_volumes,
  distances,
  progress = None 
)

Identify nearby volumes in the model for a list of target volumes.

For each volume in volume_id , returns a list of volumes from compare_volumes (or all volumes in the model if compare_volumes is empty) that are within the specified distance.

The distances vector specifies the maximum distance to use for each corresponding volume in volume_id . If a value is set to -1, a default tolerance will be computed for that volume.

The result is a vector of vectors: one list of nearby volumes per input volume in volume_id .

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10.5' ) # Move volume 2 slightly away from volume 1
volume_ids = [1]
compare_volumes = [] # Empty list = check against all volumes
distances = [1.0] # Per-volume distance
nearby_volumes = cubit.get_nearby_volumes_at_volume (volume_ids, compare_volumes, distances)
print("Nearby volumes:" )

for i, near_list in enumerate(nearby_volumes): print(f"Volume {volume_ids[i]} nearby volumes:", " ".join(str(v) for v in near_list))

# Expected output:
# Volume 1 nearby volumes: 2
 @n type of volume_id:  std::vector< int,std::allocator< int > >
Parameters
volume_id List of volume IDs to check.
type of compare_volumes: std::vector< int,std::allocator< int > >
compare_volumes List of volumes to check against. If empty, checks against all volumes in the model.
type of distances: std::vector< double,std::allocator< double > >
distances Maximum distance to use per volume in volume_id. If a value is -1, a default tolerance will be computed.
type of progress: :py:class: CubitProgressHandler, optional
progress Optional progress handler.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A vector of vectors. For each volume in volume_id, returns a list of nearby volume IDs from compare_volumes.

◆ get_next_block_id()

def cubit.get_next_block_id ( )

Get the next available block ID.

.. code-block:: python

cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 2 mov x 10" )
# Create blocks and assign volumes
cubit.cmd ("block 10 vol 1" )
cubit.cmd ("block 20 vol 2" )
print("Next available block ID:" , next_id)
# Expected output:
# Next available block ID: 21
 @n return type of :  int
Returns
Next available block ID.

◆ get_next_boundary_layer_id()

def cubit.get_next_boundary_layer_id ( )

Get the next available boundary layer ID.

This ID can be used to define a new boundary layer entity.
return type of : int

Returns
Next available unique boundary layer ID.

◆ get_next_command_from_history()

def cubit.get_next_command_from_history ( )

Get the next command from the history buffer.

Advances an internal history pointer and returns the next command.

.. code-block:: python
import cubit
print(next_cmd)
 @n return type of :  string
Returns
The next command in the history sequence.

◆ get_next_group_id()

def cubit.get_next_group_id ( )

Return the next available group ID from Cubit.

.. code-block:: python

# Initialize geometry.
cubit.cmd ("brick x 10" )
# Retrieve the next free group ID (should be 2).
print("Next group ID:" , next_id) # prints "Next group ID: 2"
# Create a new group; it will use the next available ID.
cubit.cmd ("group \"vert_group\" add vert in vol 1" )
# Verify assignment by fetching the ID from the group name.
vert_group_id = cubit.get_id_from_name ("vert_group" )
print("vert_group ID:" , vert_group_id) # prints "vert_group ID: 2"
 @n return type of :  int
Returns
Next unused integer ID for a new group.

◆ get_next_nodeset_id()

def cubit.get_next_nodeset_id ( )

Get the next available nodeset ID.

.. code-block:: python

cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 30 vertex 1 2" )
cubit.cmd ("nodeset 31 vertex 3 4" )
print("Next available nodeset ID:" , next_id)
# Expected output:
# Next available nodeset ID: 32
 @n return type of :  int
Returns
Next available nodeset ID.

◆ get_next_sideset_id()

def cubit.get_next_sideset_id ( )

Get the next available sideset ID.

.. code-block:: python

cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 20 surface 1" )
cubit.cmd ("sideset 21 surface 2" )
print("Next available sideset ID:" , next_id)
# Expected output:
# Next available sideset ID: 22
 @n return type of :  int
Returns
Next available sideset ID.

◆ get_nodal_coordinates()

def cubit.get_nodal_coordinates (   node_id )

Get the coordinates of a mesh node.

This function returns the (x, y, z) coordinates of the specified node ID. In C++, the coordinates are returned as a std::array<double,3>. In Python, the coordinates are returned as a tuple of three floats.

.. code-block:: python
# Create a brick and mesh its volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Get coordinates of node 1
print(f"Node 1 at ({coords[0]}, {coords[1]}, {coords[2]})" )
 @n type of node_id:  int
Parameters
node_id ID of the node.
return type of : std:: array< double,3 >
Returns
: Array (or tuple) of three doubles the x, y, and z coordinates of the node.

◆ get_node_constraint()

def cubit.get_node_constraint ( )

Query whether node constraint is enabled (move mid-nodes to geometry).

Node constraints control how higher-order mid-nodes snap to curved geometry:

  • off : mid-nodes retain their original positions.
  • on : mid-nodes are projected to the geometry.
  • smart : mid-nodes only snap if doing so does not degrade element quality.
.. code-block:: python
# Enable node constraint (mid-nodes snap).
cubit.cmd ("set Node Constraint on" )
enabled = cubit.get_node_constraint () # returns True
print("Node constraint enabled:" , enabled)
# Disable node constraint.
cubit.cmd ("set Node Constraint off" )
enabled = cubit.get_node_constraint () # returns False
print("Node constraint enabled:" , enabled)
 @n return type of :  boolean
Returns
True if node constraint is "on" or "smart"; otherwise false.

◆ get_node_constraint_smart_metric()

def cubit.get_node_constraint_smart_metric ( )

Query the current quality metric for smart node constraint.

When node constraint is in "smart" mode for tets or tris, this returns either "distortion" or "normalized inradius", indicating which metric controls snapping.

.. code-block:: python
# Set smart mode with normalized inradius metric.
cubit.cmd ("set Node Constraint SMART tet quality normalized inradius threshold 0.2" )
metric = cubit.get_node_constraint_smart_metric () # returns "normalized inradius"
print("Smart metric:" , metric)
 @n return type of :  string
Returns
The quality metric name for smart mode ("distortion" or "normalized inradius").

◆ get_node_constraint_smart_threshold()

def cubit.get_node_constraint_smart_threshold ( )

Query the current quality threshold for smart node constraint.

When node constraint is in "smart" mode, mid-nodes are only projected if element quality remains above this threshold.

.. code-block:: python
# Set smart mode with threshold 0.25.
cubit.cmd ("set Node Constraint SMART tet quality normalized inradius threshold 0.25" )
print("Smart threshold:" , thr)
 @n return type of :  float
Returns
The quality threshold used for smart mode (double).

◆ get_node_constraint_value()

def cubit.get_node_constraint_value ( )

Query the numeric value of the node constraint setting.

Returns 0 for off, 1 for on, or 2 for smart. This corresponds to the "set Node Constraint" options.

.. code-block:: python
# Set to on.
cubit.cmd ("set Node Constraint on" )
mode = cubit.get_node_constraint_value () # returns 1
print("Node constraint mode:" , mode)
 @n return type of :  int
Returns
0 if off, 1 if on, or 2 if smart.

◆ get_node_count()

def cubit.get_node_count ( )

Retrieve the count of nodes in the current model.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("mesh vol 1" ) # mesh volume 1
node_count = cubit.get_node_count ()
print("Node count:" , node_count)
 @n return type of :  int
Returns
Number of nodes in the current model's mesh.

◆ get_node_edges()

def cubit.get_node_edges (   node_id )

Get the IDs of all edge elements adjacent to a node.

Edge elements are created on meshed curves and throughout meshed surfaces, but not within the interior volume mesh. Nodes not on any meshed curve or surface will have no adjacent edges.

.. code-block:: python
# Create a brick and mesh a curve with equal spacing
cubit.cmd ("brick x 10" )
cubit.cmd ("curve 1 scheme equal" )
cubit.cmd ("mesh curve 1" )
# Query edge elements adjacent to node 1
edges = cubit.get_node_edges (1)
print(f"Node 1 is adjacent to {len(edges)} edge(s):" , edges)
 @n type of node_id:  int
Parameters
node_id ID of the node.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of edge element IDs adjacent to the node (empty if none).

◆ get_node_exists()

def cubit.get_node_exists (   node_id )

Check whether a node exists in the model.

This function returns true if the specified node ID exists in the current model; otherwise it returns false .

.. code-block:: python
# Create geometry and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Check if node 1 exists
exists = cubit.get_node_exists (1)
print(f"Node 1 exists? {'Yes' if exists else 'No'}" )
 @n type of node_id:  int
Parameters
node_id ID of the node to check.
return type of : boolean
Returns
true if the node exists, false otherwise.

◆ get_node_faces()

def cubit.get_node_faces (   node_id )

Get the IDs of all quadrilateral elements (faces) adjacent to a node.

In Cubit, "faces" are represented as quad elements on surfaces. Nodes in the interior of volumes will have no adjacent faces returned.

.. code-block:: python
# Create and mesh a brick volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query quad faces adjacent to an interior node
quads = cubit.get_node_faces (1)
print(f"Node 1 is adjacent to {len(quads)} quad(s)." ) # likely 0
# Mesh the surface and query again
cubit.cmd ("surface 1 mesh" )
quads = cubit.get_node_faces (1)
print(f"After surface mesh, Node 1 is adjacent to {len(quads)} quad(s):" , quads)
 @n type of node_id:  int
Parameters
node_id ID of the node.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of quad element IDs (faces) adjacent to the node (empty if none).

◆ get_node_global_id()

def cubit.get_node_global_id (   node_id )

Get the global node ID assigned in the Exodus file for a mesh node.

In Cubit, each node has a local ID unique within the session. Upon exporting the mesh to an Exodus file, nodes are renumbered into a global ID space from 1 to N. This function returns the Exodus global node ID for the given local node ID, or 0 if the mesh has not been exported.

.. code-block:: python
# Create and mesh a brick volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Before export, no global node IDs exist
print(f"Global node ID of node 1 before export: {gid}" ) # prints 0
# Export mesh to assign global node IDs
cubit.cmd ("export mesh \"model.exo\"" )
# After export, global and local node IDs match
print(f"Global node ID of node 1 after export: {gid}" ) # prints 1
 @n type of node_id:  int
Parameters
node_id Local Cubit node ID.
return type of : int
Returns
Global node ID assigned in the Exodus file, or 0 if not yet exported.

◆ get_node_position_fixed()

def cubit.get_node_position_fixed (   node_id )

Query whether a mesh node is fixed (constrained against smoothing).

A fixed node will not be moved by mesh smoothing or optimization operations.

.. code-block:: python
# Create a brick and set up tetmeshing on volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Fix all nodes on surface 1
cubit.cmd ("node in surface 1 position fixed" )
# Attempt to smooth all surfaces
cubit.cmd ("smooth surface all" )
# Get the center point of surface 1
center = cubit.get_center_point ("surface" , 1)
# Find the node closest to that center and check its fixed state
node_id = cubit.get_closest_node (*center)
is_fixed = cubit.get_node_position_fixed (node_id)
print(f"Node {node_id} fixed? {is_fixed}" ) # Expected: True
 @n type of node_id:  int
Parameters
node_id ID of the node to query.
return type of : boolean
Returns
true if the node is fixed (constrained), false if it is not.

◆ get_node_tris()

def cubit.get_node_tris (   node_id )

Get the IDs of all triangular elements adjacent to a node.

In Cubit, triangular "faces" are represented as tris on surfaces. Nodes in the interior of volumes will have no adjacent tris returned.

.. code-block:: python
# Create a brick and mesh its surfaces with triangles
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 scheme trimesh" )
cubit.cmd ("mesh surface 1" )
# Query triangular faces (tris) adjacent to node 1
tris = cubit.get_node_tris (1)
print(f"Node 1 is adjacent to {len(tris)} tri(s):" , tris)
 @n type of node_id:  int
Parameters
node_id ID of the node.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of triangular element IDs (tris) adjacent to the node (empty if none).

◆ get_nodeset_count()

def cubit.get_nodeset_count ( )

Get the current number of nodesets in the model.

In Cubit, a nodeset groups mesh nodes for applying boundary conditions or loads. Nodesets can be defined by assigning vertices, curves, surfaces, volumes, or individual nodes to a given ID.

.. code-block:: python
# Create and mesh a brick; nodes are generated on volume 1.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
# Define nodeset 201 to include nodes on surface 1.
cubit.cmd ("Nodeset 201 add surface 1" )
# get_nodeset_count() returns 1.
print("Nodeset count:" , count) # prints 1
 @n return type of :  int
Returns
The number of nodesets currently defined in the model.

◆ get_nodeset_curves()

def cubit.get_nodeset_curves (   nodeset_id )

Get the list of curve IDs associated with a nodeset.

This function returns the IDs of all curves that are associated with the specified nodeset.

.. code-block:: python
# Create a brick and assign curves in volume 1 to nodeset 30
cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 30 curve in vol 1" )
# Query the curves in nodeset 30
curve_ids = cubit.get_nodeset_curves (30)
print(f"Nodeset 30 contains {len(curve_ids)} curve(s)." )

for curve_id in curve_ids: print(f" Curve ID: {curve_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of curve IDs contained in the nodeset.

◆ get_nodeset_id_list()

def cubit.get_nodeset_id_list ( )

Get a list of all active nodeset IDs.

Returns a vector of all currently active nodeset IDs in the model.

.. code-block:: python
# Create geometry
cubit.cmd ("brick x 10" )
# Create nodesets on vertices
cubit.cmd ("nodeset 30 vertex 1 2" )
cubit.cmd ("nodeset 31 vertex 3 4" )
# Query all active nodeset IDs
nodeset_ids = cubit.get_nodeset_id_list ()
# Print the nodeset IDs
print("Active nodeset IDs:" )

for nodeset_id in nodeset_ids: print(" Nodeset ID:", nodeset_id)

# Expected output (example):
# Active nodeset IDs:
# Nodeset ID: 30
# Nodeset ID: 31


return type of : std::vector< int,std:: allocator< int > >

Returns
Vector (Python tuple) of all active nodeset IDs.

◆ get_nodeset_id_list_for_bc()

def cubit.get_nodeset_id_list_for_bc (   bc_type_enum,
  bc_id 
)

Get list of nodeset IDs associated with a boundary condition.

Returns nodesets to which the BC is applied.


type of bc_type_enum: int

Parameters
bc_type_enum BC type enum (CI_BCTypes).
type of bc_id: int
bc_id ID of the boundary condition.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of associated nodeset IDs.

◆ get_nodeset_node_count()

def cubit.get_nodeset_node_count (   nodeset_id )

Get the number of nodes in a nodeset.


type of nodeset_id: int

Parameters
nodeset_id The nodeset id
return type of : int
Returns
Number of nodes in the nodeset

◆ get_nodeset_nodes()

def cubit.get_nodeset_nodes (   nodeset_id )

Get the list of node IDs explicitly assigned to a nodeset.

This function returns the IDs of nodes that were specifically assigned to the nodeset.

If the nodeset was created on geometry (e.g. a surface or volume), this function will not return the nodes on that geometry unless they were explicitly assigned. To include nodes on geometry, use 'get_nodeset_nodes_inclusive' instead.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign nodes from surface 1 to nodeset 50
cubit.cmd ("nodeset 50 node in surface 1" )
# Query the nodes in nodeset 50
node_ids = cubit.get_nodeset_nodes (50)
print(f"Nodeset 50 contains {len(node_ids)} node(s)." )

for node_id in node_ids: print(f" Node ID: {node_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs explicitly assigned to the nodeset.

◆ get_nodeset_nodes_inclusive()

def cubit.get_nodeset_nodes_inclusive (   nodeset_id )

Get the list of node IDs associated with a nodeset (inclusive).

This function returns the IDs of all nodes associated with the specified nodeset. It includes:

  • Nodes explicitly assigned to the nodeset.
  • Nodes associated with any geometry used to define the nodeset (e.g. surfaces or volumes).

Use this function when the nodeset was created using geometry and you want all associated nodes . For only explicitly assigned nodes, see 'get_nodeset_nodes'.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Create nodeset 50: assign nodes from surface 1
cubit.cmd ("nodeset 50 node in surface 1" )
# Add surface 6 to nodeset 50 (nodes on surface 6 will also be included)
cubit.cmd ("nodeset 50 add surface 6" )
# Query the nodes in nodeset 50 (inclusive)
print(f"Nodeset 50 (inclusive) contains {len(node_ids)} node(s)." )

for node_id in node_ids: print(f" Node ID: {node_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs contained in the nodeset, including nodes on associated geometry.

◆ get_nodeset_surfaces()

def cubit.get_nodeset_surfaces (   nodeset_id )

Get the list of surface IDs associated with a nodeset.

This function returns the IDs of all surfaces that are associated with the specified nodeset.

.. code-block:: python
# Create a brick and assign surfaces 1 to 6 to nodeset 20
cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 20 surface 1 to 6" )
# Query the surfaces in nodeset 20
surface_ids = cubit.get_nodeset_surfaces (20)
print(f"Nodeset 20 contains {len(surface_ids)} surface(s)." )

for surf_id in surface_ids: print(f" Surface ID: {surf_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs contained in the nodeset.

◆ get_nodeset_vertices()

def cubit.get_nodeset_vertices (   nodeset_id )

Get the list of vertex IDs associated with a nodeset.

This function returns the IDs of all vertices that are associated with the specified nodeset.

.. code-block:: python
# Create a brick and assign vertices in volume 1 to nodeset 40
cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 40 vertex in vol 1" )
# Query the vertices in nodeset 40
vertex_ids = cubit.get_nodeset_vertices (40)
print(f"Nodeset 40 contains {len(vertex_ids)} vertex(s)." )

for vertex_id in vertex_ids: print(f" Vertex ID: {vertex_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of vertex IDs contained in the nodeset.

◆ get_nodeset_volumes()

def cubit.get_nodeset_volumes (   nodeset_id )

Get the list of volume IDs associated with a nodeset.

This function returns the IDs of all volumes that are associated with the specified nodeset.

.. code-block:: python
# Create a brick and assign volume 1 to nodeset 1
cubit.cmd ("brick x 10" )
cubit.cmd ("nodeset 1 vol 1" )
# Query the volumes in nodeset 1
volume_ids = cubit.get_nodeset_volumes (1)
print(f"Nodeset 1 contains {len(volume_ids)} volume(s)." )

for vol_id in volume_ids: print(f" Volume ID: {vol_id}")

  @n type of nodeset_id:  int
Parameters
nodeset_id ID of the nodeset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of volume IDs contained in the nodeset.

◆ get_num_volume_shells()

def cubit.get_num_volume_shells (   volume_id )

Get the number of shells in a volume.

A "shell" is a closed set of faces bounding a region within the volume. For a simple solid with no internal cavities, this returns 1. If the volume contains voids or nested regions, each closed boundary counts as a separate shell.

.. code-block:: python
# Create two bricks: volume 1 (10x10x10) and volume 2 (5x5x5).
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
# Subtract the smaller brick from the larger one, creating a cavity inside volume 1.
cubit.cmd ("subtract vol 2 from vol 1" )
# Now volume 1 has 2 shells: the outer boundary and the inner cavity.
shells = cubit.get_num_volume_shells (1) # returns 2
print("Volume 1 shells:" , shells)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : int
Returns
Number of shells (closed face loops) in the specified volume.

◆ get_overconstrained_tets_in_volumes()

def cubit.get_overconstrained_tets_in_volumes (   volumes )

Retrieve IDs of overconstrained tetrahedra within specified volumes.

Overconstrained tetrahedra are those that have two triangular faces on the same surface and all four corner nodes lying on surfaces, curves, or vertices. Such tets cannot be smoothed and are typically removed to improve mesh quality.


type of volumes: std::vector< int,std::allocator< int > >

Parameters
volumes Vector of volume IDs to search for overconstrained tets.
return type of : std::vector< int,std:: allocator< int > >
Returns
std::vector<int> containing the IDs of all overconstrained tets found.
.. code-block:: python
import cubit
# 1) Create and mesh a spherical volume (Volume ID = 1).
cubit.cmd ("create sphere rad 1" ) # Create a sphere of radius 1 (volume ID = 1)
cubit.cmd ("volume 1 scheme tetmesh" ) # Apply TetMesh scheme to volume 1
cubit.cmd ("mesh volume 1" ) # Generate tetrahedral mesh
# 2) Identify overconstrained tets in volume 1.
vols = [1]

if over_tets:

3) Convert the integer list to a space-separated string.

ids_str = cubit.string_from_id_list(over_tets)

# 4) Remove all overconstrained tets.
cubit.cmd (f"remove overconstrained tet {ids_str}" )
print(f"Removed overconstrained tets: {ids_str}" )

else:

print("No overconstrained tets found in volume 1." )

◆ get_overlap_max_angle()

def cubit.get_overlap_max_angle ( )

Get the current maximum angle tolerance used for calculating surface overlaps.

Returns the maximum angle (in degrees) allowed between normals of adjacent surfaces when determining overlaps. This setting controls how much angular deviation is tolerated before surfaces are considered non-overlapping.

.. code-block:: python
# Retrieve the default max angle setting.
print("Current overlap max angle:" , max_angle)
 @n return type of :  float
Returns
The current maximum angle tolerance (in degrees) used for surface overlap calculations.

◆ get_overlap_max_gap()

def cubit.get_overlap_max_gap ( )

Get the current maximum gap tolerance used for calculating surface overlaps.

Returns the maximum allowable gap between adjacent surfaces when determining overlaps. This setting controls how large a gap is tolerated before surfaces are considered non-overlapping.

.. code-block:: python
# Retrieve the default max gap setting.
print("Current overlap max gap:" , max_gap)
 @n return type of :  float
Returns
The current maximum gap tolerance (in model units) used for surface overlap calculations.

◆ get_overlap_min_gap()

def cubit.get_overlap_min_gap ( )

Get the current minimum gap tolerance used for calculating surface overlaps.

Returns the minimum allowable gap between adjacent surfaces when determining overlaps. This setting can be used to ignore negligible gaps that should be treated as overlapping.

.. code-block:: python
# Retrieve the default min gap setting.
print("Current overlap min gap:" , min_gap)
 @n return type of :  float
Returns
The current minimum gap tolerance (in model units) used for surface overlap calculations.

◆ get_overlapping_surfaces_at_surface()

def cubit.get_overlapping_surfaces_at_surface (   surface_id,
  compare_volumes,
  cache_overlaps = 0 
)

Identify surfaces in the model that overlap a single target surface.

Returns a list of surfaces that overlap the specified surface_id . If compare_volumes is empty, all volumes in the model will be used for comparison.

Caching can be used to avoid redundant distance calculations when this function is called together with get_overlapping_surfaces_in_volumes . Both functions require the same underlying distance computations between surfaces in the specified volumes. If caching is enabled, the results of these distance calculations will be saved and reused when the second function is called. If you are calling only this function by itself, caching provides no performance benefit.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 exactly next to volume 1
surface_id = 6 # Example surface on volume 1
compare_volumes = [] # Empty list = check against all volumes
overlapping_surfaces = cubit.get_overlapping_surfaces_at_surface (surface_id, compare_volumes, 0)
print(f"Surfaces overlapping surface {surface_id}:" )

for s_id in overlapping_surfaces: print(s_id)

# Expected output:
# 10
 @n type of surface_id:  int
Parameters
surface_id Surface ID to check.
type of compare_volumes: std::vector< int,std::allocator< int > >
compare_volumes List of volumes to check against. If empty, checks against all volumes in the model.
type of cache_overlaps: int, optional
cache_overlaps Caching mode: 0 = no caching, 1 = clear cache first, 2 = use and add to existing cache.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs that overlap the specified surface_id.

◆ get_overlapping_surfaces_in_bodies()

def cubit.get_overlapping_surfaces_in_bodies (   body_ids,
  filter_slivers = False 
)

Identify overlapping surfaces between different volumes in a set of bodies.

Overlaps are only reported between surfaces from different volumes . The result is a vector of vectors. The first surface ID in each vector overlaps with all subsequent surfaces in that vector.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 10' ) # Move volume 2 to overlap with volume 1
body_ids = [1, 2]
print("Overlapping surfaces:" )

for surfaces in overlaps: print("Surfaces:", tuple(int(sid) for sid in surfaces))

# Expected output:
# Surfaces: (6, 10)
# Surfaces: (10, 6)


type of body_ids: std::vector< int,std::allocator< int > >

Parameters
body_ids List of body IDs to search for surface overlaps.
type of filter_slivers: boolean, optional
filter_slivers Optional flag to filter out overlaps where surfaces share a merged curve.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A list of surface overlap results. Each entry is a vector of surface IDs where the first ID overlaps with all subsequent IDs in that vector. Overlaps are only reported between surfaces from different volumes.

◆ get_overlapping_volumes()

def cubit.get_overlapping_volumes (   target_volume_ids )

Identify overlapping volumes in a list of volumes.

For each pair of overlapping volumes, two volume IDs are returned in the output list. The first volume ID overlaps with the second, the third overlaps with the fourth, and so on. The list should always contain an even number of volume IDs (modulus 2 = 0).

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 9.5' ) # Move volume 2 to overlap with volume 1
target_volumes = [1, 2]
overlapping_volumes = cubit.get_overlapping_volumes (target_volumes)
print("Overlapping volumes:" )

for i in range(0, len(overlapping_volumes), 2): print(f"Volumes: ({overlapping_volumes[i]}, {overlapping_volumes[i+1]})")

# Expected output:
# Volumes: (1, 2)
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of overlapping volume IDs. The first ID overlaps with the second, the third with the fourth, and so on.

◆ get_overlapping_volumes_at_volume()

def cubit.get_overlapping_volumes_at_volume (   volume_id,
  compare_volumes 
)

Identify volumes in the model that overlap a single target volume.

Returns a list of volumes that overlap the specified volume_id . If compare_volumes is empty, all volumes in the model will be used for comparison.

.. code-block:: python
cubit.cmd ('brick x 10' ) # Create volume 1
cubit.cmd ('brick x 10' ) # Create volume 2
cubit.cmd ('vol 2 mov x 9.5' ) # Move volume 2 to overlap with volume 1
volume_id = 1
compare_volumes = [] # Empty list = check against all volumes
overlapping_volumes = cubit.get_overlapping_volumes_at_volume (volume_id, compare_volumes)
print(f"Volumes overlapping volume {volume_id}:" )

for v_id in overlapping_volumes: print(v_id)

# Expected output:
# 2
 @n type of volume_id:  int
Parameters
volume_id Volume ID to check.
type of compare_volumes: std::vector< int,std::allocator< int > >
compare_volumes List of volumes to check against. If empty, checks against all volumes in the model.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of volume IDs that overlap the specified volume_id.

◆ get_owning_body()

def cubit.get_owning_body (   geometry_type,
  entity_id 
)

Get the owning body for a specified entity.

Returns the ID of the body that contains (owns) the given entity.

.. code-block:: python
# Create a 10x10x10 brick (body 1).
cubit.cmd ("brick x 10" )
# Query the owning body for curve 12.
body_id = cubit.get_owning_body ("curve" , 12) # returns 1
print("Owning body of curve 12:" , body_id)
 @n type of geometry_type:  string
Parameters
geometry_type Specifies the entity type ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity whose owning body is requested.
return type of : int
Returns
ID of the body that owns the specified entity (or 0 if none).

◆ get_owning_volume()

def cubit.get_owning_volume (   geometry_type,
  entity_id 
)

Get the owning volume for a specified entity.

Returns the ID of the volume that contains (owns) the given entity.

.. code-block:: python
# Create a 10x10x10 brick (volume 1).
cubit.cmd ("brick x 10" )
# Query the owning volume for curve 12.
volume_id = cubit.get_owning_volume ("curve" , 12) # returns 1
print("Owning volume of curve 12:" , volume_id)
 @n type of geometry_type:  string
Parameters
geometry_type Specifies the entity type ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity whose owning volume is requested.
return type of : int
Returns
ID of the volume that owns the specified entity (or 0 if none).

◆ get_owning_volume_by_name()

def cubit.get_owning_volume_by_name (   entity_name )

Get the owning volume for an entity by its name.

.. code-block:: python

# Create a brick and name one surface.
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 name 'TipSurface'" )
volume_id = cubit.get_owning_volume_by_name ("TipSurface" )
print("Owning volume:" , volume_id) # prints 1
 @n type of entity_name:  string
Parameters
entity_name The name of the entity as defined in Cubit.
return type of : int
Returns
ID of the volume that owns the named entity, or 0 if the name is not found.

◆ get_parent_assembly_instance()

def cubit.get_parent_assembly_instance (   assembly_id )

Get the instance number of the parent of an assembly node.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : int
Returns
Parent instance number.

◆ get_parent_assembly_path()

def cubit.get_parent_assembly_path (   assembly_id )

Get the path of an assembly node's parent.


type of assembly_id: int

Parameters
assembly_id ID of the assembly node.
return type of : string
Returns
Parent path string.

◆ get_pick_filters()

def cubit.get_pick_filters ( )

Retrieve the list of entity types currently allowed for picking.

Returns all types in the active pick filter. Only entities of these types can be selected in the graphics window.

.. code-block:: python
import cubit
filters = cubit.get_pick_filters ()

for t in filters: print("Pick filter:", t)

  @n return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of strings naming the current pick filter types.

◆ get_pick_type()

def cubit.get_pick_type ( )

Get the current pick mode for entity selection.

Returns the pick type that the graphics system is using for selection. This corresponds to the GUI icons and can be one of: "vertex", "curve", "surface", "volume", "node", "edge", "face", etc.

.. code-block:: python
import cubit
print("Current pick mode:" , mode)
# Retrieve selected entities of that type

for id in ids: print(f"Selected {mode}: {id}")

  @n return type of :  string
Returns
Null-terminated string naming the current pick type.

◆ get_pressure_function()

def cubit.get_pressure_function (   entity_id )

Get the function expression associated with a pressure BC.


type of entity_id: int

Parameters
entity_id ID of the pressure BC.
return type of : string
Returns
Pressure function as a string.

◆ get_pressure_value()

def cubit.get_pressure_value (   entity_id )

Get the magnitude value of a pressure BC.


type of entity_id: int

Parameters
entity_id ID of the pressure BC.
return type of : float
Returns
Pressure magnitude.

◆ get_previous_command_from_history()

def cubit.get_previous_command_from_history ( )

Get the previous command from the history buffer.

Moves the internal history pointer backwards and returns that command.

.. code-block:: python
import cubit
print(prev_cmd)
 @n return type of :  string
Returns
The previous command in the history sequence.

◆ get_pyramid_count()

def cubit.get_pyramid_count ( )

Retrieve the count of pyramid elements in the current model.

.. code-block:: python

cubit.cmd ("brick x 10" ) # Volume ID = 1
cubit.cmd ("brick x 10" ) # Volume ID = 2
cubit.cmd ("vol 1 mov x 10" ) # move volume 1 to abut volume 2
cubit.cmd ("merge all" ) # merge volumes
cubit.cmd ("vol 1 scheme map" ) # hex mesh for volume 1
cubit.cmd ("mesh vol 1" )
cubit.cmd ("vol 2 scheme tetmesh" ) # tet mesh for volume 2
cubit.cmd ("mesh vol 2" )
# pyramids are generated at the interface to join hex and tet elements
pyramid_count = cubit.get_pyramid_count ()
print("Pyramid count:" , pyramid_count)
 @n return type of :  int
Returns
Number of pyramid elements in the current model's mesh.

◆ get_pyramid_global_element_id()

def cubit.get_pyramid_global_element_id (   pyramid_id )

Get the Global Element ID for a specific pyramid element.

This function returns the Global Element ID assigned to the given local pyramid ID when the element is placed into a block.

.. code-block:: python
# Create two volumes and generate pyramids at their interface
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
cubit.cmd ("merge all" )
# Mesh volume 1 with mapped hexes
cubit.cmd ("vol 1 scheme map" )
cubit.cmd ("mesh vol 1" )
# Mesh the other side with tetmeshing to create pyramids
cubit.cmd ("vol 2 scheme tetmesh" )
cubit.cmd ("mesh vol 2" )
# Assign all pyramid elements to block 1
cubit.cmd ("block 1 pyramid all" )
# Query the Global Element ID of local pyramid 22
print("Global Element ID of pyramid 22:" , gid)
 @n type of pyramid_id:  int
Parameters
pyramid_id Local pyramid element ID within its type.
return type of : int
Returns
Global Element ID for the specified pyramid, or 0 if not placed into a block.

◆ get_python_version()

def cubit.get_python_version ( )

Retrieve the Python interpreter version used by Cubit.

Returns the version string of the embedded Python interpreter in Cubit.

.. code-block:: python
import cubit
python_version = cubit.get_python_version ()
print("Python version:" , python_version)
 @n return type of :  string
Returns
A string containing the Python version number.

◆ get_quad_count()

def cubit.get_quad_count ( )

Retrieve the count of quadrilateral elements in the current model.

For a hexahedral volume mesh, this returns the number of quad faces on the surface.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("vol 1 scheme map" ) # set hex scheme
cubit.cmd ("mesh vol 1" ) # mesh as hexes (surface faces are quads)
quad_count = cubit.get_quad_count ()
print("Quad count:" , quad_count)
 @n return type of :  int
Returns
Number of quadrilateral elements (surface faces of a hex mesh).

◆ get_quad_global_element_id()

def cubit.get_quad_global_element_id (   quad_id )

Get the Global Element ID for a specific quadrilateral element.

Cubit assigns a Global Element ID to each element when it is placed into a block. This function returns the Global Element ID corresponding to the given local quad ID within its type-specific ID space.

.. code-block:: python
# Create a brick and mesh its volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("block 1 quad in surface 1" ) # assign all quads on surface 1 to block 1
# Query the Global Element ID of local quad 22
print("Global Element ID of quad 22:" , gid)
 @n type of quad_id:  int
Parameters
quad_id Local quadrilateral element ID within its type.
return type of : int
Returns
Global Element ID for the specified quad, or 0 if not placed into a block.

◆ get_quality_stats_at_geometry()

def cubit.get_quality_stats_at_geometry (   geom_type,
  mesh_type,
  geom_id_list,
  expand_levels,
  metric_name,
  single_threshold,
  use_low_threshold,
  low_threshold,
  high_threshold,
  make_group 
)

Python-friendly version of get_quality_stats operating on geometry entities.

Computes quality statistics over all mesh elements attached to the specified geometry entities (curves, surfaces, or volumes) up to a given adjacency level, using the specified metric and threshold criteria. Results are packed into a single std::vector<double> as follows:

  • [0] min_value
  • [1] max_value
  • [2] mean_value
  • [3] std_value
  • [4] min_element_id
  • [5] max_element_id
  • [6] element_type (0=edge, 1=tri, 2=quad, 3=tet, 4=hex)
  • [7] bad_group_id
  • [8] number of failing elements (n)
  • [9]...[9+n-1] IDs of failing elements

Unlike get_elem_quality_stats() , which operates on a flat list of mesh-element IDs, this function first gathers all mesh elements of mesh_type attached to the given geometry_type entities (expanding connectivity up to expand_levels) and then calls get_elem_quality_stats() internally.

.. code-block:: python
# 1) Create two vertices and a linear curve (Curve ID = 1), then mesh that curve.
cubit.cmd ("create vertex 0 0 0" )
cubit.cmd ("create vertex 1 0 0" )
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
cubit.cmd ("curve 1 size 0.1" )
cubit.cmd ("mesh curve 1" )
# 2) Compute quality stats for all "edge" elements attached to that curve.
# expand_levels = 0 means only directly connected edges.
curves = [1]
"curve" , # geom_type
"edge" , # mesh_type
curves, # geom_id_list
0, # expand_levels
"scaled jacobian" , # metric_name
0.2, # single_threshold
False , # use_low_threshold
0.0, # low_threshold
0.2, # high_threshold
True# make_group
)
min_value = quality_data[0]
max_value = quality_data[1]
mean_value = quality_data[2]
std_value = quality_data[3]
min_element_id = int(quality_data[4])
max_element_id = int(quality_data[5])
element_type = int(quality_data[6]) # 0=edge
bad_group_id = int(quality_data[7])
num_failures = int(quality_data[8])
mesh_list = [int(x) for x in quality_data[9:9+num_failures]]
 @n type of geom_type:  string
Parameters
geom_type Geometry type ("curve", "surface", or "volume").
type of mesh_type: string
mesh_type Mesh-element type to evaluate ("edge", "tri", "quad", "tet", "hex").
type of geom_id_list: std::vector< int,std::allocator< int > >
geom_id_list Vector of geometry IDs whose attached mesh elements are considered.
type of expand_levels: int
expand_levels Number of adjacency levels to include (0 = only directly attached elements).
type of metric_name: string
metric_name Name of the quality metric (e.g., "scaled jacobian", "skew").
type of single_threshold: float
single_threshold Threshold when using a single bound.
type of use_low_threshold: boolean
use_low_threshold If true, apply [low_threshold, high_threshold]; otherwise use single_threshold.
type of low_threshold: float
low_threshold Lower bound of the acceptable quality range.
type of high_threshold: float
high_threshold Upper bound of the acceptable quality range.
type of make_group: boolean
make_group If true, create a group containing failing elements; its ID appears in the output.
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector<double> containing quality summary and failing-element IDs.

◆ get_quality_value()

def cubit.get_quality_value (   mesh_type,
  mesh_id,
  metric_name 
)

Retrieve a specific quality metric value for a single mesh element.

Returns the requested quality metric for the given mesh entity.

.. code-block:: python
"hex" , # mesh_type
223, # mesh_id
"skew"# metric_name
)
 @n type of mesh_type:  string
Parameters
mesh_type Type of mesh element ("hex", "tet", "tri", "quad").
type of mesh_id: int
mesh_id Identifier of the mesh element.
type of metric_name: string
metric_name Name of the quality metric (e.g., "skew", "taper", "scaled jacobian").
return type of : float
Returns
The value of the specified quality metric.

◆ get_quality_values()

def cubit.get_quality_values (   mesh_type,
  mesh_ids,
  metric_name 
)

Retrieve quality metric values for multiple mesh elements.

Returns a vector of metric values for the specified list of element IDs. This differs from get_quality_value() , which only returns a single element's metric.

.. code-block:: python
mesh_ids = [223, 224, 225]
skew_vals = cubit.get_quality_values (
"hex" , # mesh_type
mesh_ids, # list of element IDs
"skew"# metric_name
)

for eid, val in zip(mesh_ids, skew_vals): print(f"Element {eid} skew: {val}")

  @n type of mesh_type:  string
Parameters
mesh_type Type of mesh element ("hex", "tet", "tri", "quad").
type of mesh_ids: std::vector< int,std::allocator< int > >
mesh_ids Vector of mesh element IDs to query.
type of metric_name: string
metric_name Name of the quality metric (e.g., "skew", "taper", "scaled jacobian").
return type of : std::vector< double,std:: allocator< double > >
Returns
std::vector<double> containing metric values corresponding to each mesh_id.

◆ get_reduce_bolt_core_default_dimensions()

def cubit.get_reduce_bolt_core_default_dimensions (   vol_id )

Computes default core dimensions for a bolt volume in reduce bolt core operation.

Used with reduce volume <id> bolt core to estimate the default values for c1, c2, and c3, which define the extent of the core geometry surrounding the bolt.

.. code-block:: python
print("c1:" , dims[0], "c2:" , dims[1], "c3:" , dims[2])
 @n type of vol_id:  int
Parameters
vol_id Volume ID representing bolt geometry.
return type of : std::vector< double,std:: allocator< double > >
Returns
Vector containing [c1, c2, c3] dimensions for the bolt core.

◆ get_relatives()

def cubit.get_relatives (   source_geometry_type,
  source_id,
  target_geom_type 
)

Get the relatives (parents or children) of a specified entity.

Use this to fetch either ancestor (parent) or descendant (child) entities of one type for a given source entity. For example, to list all curves bounding surface 12, call with source_geometry_type="surface", source_id=12, target_geom_type="curve".

.. code-block:: python
# Create a brick and extract curves for surface 1.
cubit.cmd ("brick x 10" )
curve_list = cubit.get_relatives ("surface" , 1, "curve" )
print(curve_list) # e.g., (1, 2, 3, 4)
 @n type of source_geometry_type:  string
Parameters
source_geometry_type The type of the source entity ("body", "volume", "surface", "curve", or "vertex").
type of source_id: int
source_id ID of the source entity.
type of target_geom_type: string
target_geom_type The target entity type to retrieve ("body", "volume", "surface", "curve", or "vertex").
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector or Python tuple) of IDs matching target_geom_type related to source_id.

◆ get_rendering_mode()

def cubit.get_rendering_mode ( )

Get the current graphics rendering mode.

Returns an integer code for the active rendering style:

  • 0 = wireframe only
  • 1 = wireframe with hidden-line removal
  • 2 = true hidden-line shading
  • 3 = smooth shaded surfaces
  • 4 = transparent surfaces
  • 5 = geometry facets only
.. code-block:: python
import cubit
# Set rendering mode to hidden-line removal and verify
cubit.cmd ("Graphics Mode HiddenLine" )
print("Rendering mode:" , mode) # should print 1
 @n return type of :  int
Returns
Integer code for the current rendering mode.

◆ get_requested_mesh_interval_firmness()

def cubit.get_requested_mesh_interval_firmness (   geometry_type,
  entity_id 
)

Retrieve the explicitly requested interval firmness for a specified entity.

Unlike get_mesh_interval_firmness() , which returns the effective firmness after considering influences from connected topology, this function returns only the firmness setting directly assigned by the user on the entity itself (no inheritance or propagation).

Title Possible return values are:

  • "HARD" - interval was explicitly locked by using a hard interval command on this entity.
  • "SOFT" - interval was explicitly set (or upgraded) to soft on this entity.
  • "LIMP" - no interval firmness was ever set directly on this entity.
.. code-block:: python
# Assume surface 12 already exists.
# 1) Explicitly set surface 12's interval firmness to SOFT:
cubit.cmd ("surface 12 interval soft" )
# 2) Query only the requested interval firmness for surface 12:
firmness = cubit.get_requested_mesh_interval_firmness ("surface" , 12)
print("Surface 12 requested interval firmness:" , firmness) # Expected: "SOFT"
# 3) Query again (still "SOFT", unaffected by connected geometry).
firmness = cubit.get_requested_mesh_interval_firmness ("surface" , 12)
print("Surface 12 requested interval firmness:" , firmness) # Expected: "SOFT"
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type of the entity ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity whose requested interval firmness is queried.
return type of : string
Returns
: The requested interval firmness on that entity "HARD", "SOFT", or "LIMP". "LIMP" indicates no firmness was explicitly set here.

◆ get_requested_mesh_intervals()

def cubit.get_requested_mesh_intervals (   geometry_type,
  entity_id 
)

Retrieve the mesh interval count explicitly set on a geometry entity.

Returns the number of subdivisions assigned directly to the specified geometry entity.

  • If no interval is set on the entity, it inherits the size from its parent.
  • If no interval is set anywhere in the hierarchy, the default automatic size is used.
.. code-block:: python
import cubit
size = cubit.get_requested_mesh_intervals ("curve" , 7)
print("Mesh size on curve 7:" , size)
 @n type of geometry_type:  string
Parameters
geometry_type Entity type: "curve", "surface", or "volume".
type of entity_id: int
entity_id ID of the geometry entity.
return type of : int
Returns
Interval count set on that entity.

◆ get_requested_mesh_size()

def cubit.get_requested_mesh_size (   geometry_type,
  id 
)

Retrieve the mesh size explicitly set on a geometry entity.

Returns the target edge length that was directly assigned to the entity, not inherited from parent entities. If no explicit size was set, returns -1.

.. code-block:: python
import cubit
# Get the requested mesh size on surface 4
requested_size = cubit.get_requested_mesh_size ("surface" , 4)
print("Requested mesh size:" , requested_size)
 @n type of geometry_type:  string
Parameters
geometry_type Entity type: "curve", "surface", or "volume".
type of id: int
id ID of the geometry entity.
return type of : float
Returns
Mesh size explicitly set on the entity, or -1 if none.

◆ get_requested_mesh_size_type()

def cubit.get_requested_mesh_size_type (   geometry_type,
  entity_id 
)

Retrieve the mesh size setting type explicitly requested on a specified entity.

Unlike get_mesh_size_type() , which may return "CALCULATED" if the size was inherited or computed, this function returns only the status of a mesh size setting directly applied by the user on this entity.

Title Possible return values are:

  • "USER_SET" - The mesh size (target edge length) was explicitly set on this entity.
  • "CALCULATED" - The mesh size was inferred or computed on this entity (but not directly by the user).
  • "NOT_SET" - No mesh size was explicitly set on this entity.
.. code-block:: python
# 1) Create two vertices and a linear curve between them (Curve ID = 1).
cubit.cmd ("create vertex 0 0 0" ) # Vertex ID = 1
cubit.cmd ("create vertex 1 0 0" ) # Vertex ID = 2
cubit.cmd ("create curve vertex 1 2" ) # Curve ID = 1
# 2) By default, no mesh size is set, so this returns "NOT_SET".
requested_type = cubit.get_requested_mesh_size_type ("curve" , 1)
print("Curve 1 requested mesh size type:" , requested_type) # Expected: "NOT_SET"
# 3) Explicitly set a mesh size (target edge length) of 0.1 on curve 1.
cubit.cmd ("curve 1 size 0.1" )
# 4) Now get_requested_mesh_size_type returns "USER_SET".
requested_type = cubit.get_requested_mesh_size_type ("curve" , 1)
print("Curve 1 requested mesh size type:" , requested_type) # Expected: "USER_SET"
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity whose requested mesh size status is queried.
return type of : string
Returns
: The requested mesh size status on that entity "USER_SET", "CALCULATED", or "NOT_SET".

◆ get_revision_date()

def cubit.get_revision_date ( )

Retrieve the Cubit revision date.

Returns the date of the last code revision applied to the Cubit engine.

.. code-block:: python
import cubit
rev_date = cubit.get_revision_date ()
print("Revision date:" , rev_date)
 @n return type of :  string
Returns
A string containing Cubit's last revision date.

◆ get_rubberband_shape()

def cubit.get_rubberband_shape ( )

Get the current rubberband selection shape.

Returns an integer code for the active selection shape in the graphics window:

  • 0 = box
  • 1 = polygon
  • 2 = circle
.. code-block:: python
import cubit
print("Rubberband shape:" , shape)
 @n return type of :  int
Returns
Integer code indicating the current rubberband selection shape.

◆ get_selected_id()

def cubit.get_selected_id (   index )

Get the selected entity ID by index.

Use together with get_selected_ids() and get_selected_type() to inspect selections.

.. code-block:: python
import cubit
# Select surfaces 3 and 4
cubit.cmd ("select surface 3 4" )
# Retrieve all selected IDs by index

for i in range(len(ids)): id = cubit.get_selected_id(i)

print("Selection" , i, ":" , type, id)
 @n type of index:  int
Parameters
index Zero-based index into the current selection list.
return type of : int
Returns
Entity ID at the given index.

◆ get_selected_ids()

def cubit.get_selected_ids ( )

Retrieve all currently selected entity IDs in pick order.

Returns a vector of IDs for entities selected via the graphics interface or programmatic pick commands. The order reflects the sequence in which entities were picked.

.. code-block:: python
import cubit
# Select surfaces 3 and 4, then iterate through the selection
cubit.cmd ("select surface 3 4" )

for i, id in enumerate(ids): t = cubit.get_selected_type(i)

print("Selected" , t, "with ID" , id)
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of selected entity IDs; empty if no entities are selected.

◆ get_selected_type()

def cubit.get_selected_type (   index )

Get the selected entity type by index.

Use together with get_selected_ids() and get_selected_id() to inspect selections.

.. code-block:: python
import cubit
# Select surfaces 3 and 4
cubit.cmd ("select surface 3 4" )
# If there is at least one selection, print its type and ID

if ids: id = cubit.get_selected_id(0)

print(f"First selection is a {t} with ID {id}" )
 @n type of index:  int
Parameters
index Zero-based index into the current selection list.
return type of : string
Returns
Entity type string ("vertex", "curve", "surface", "volume") at that index.

◆ get_sgm_version()

def cubit.get_sgm_version ( )

Retrieve the SGM (Solid Geometry Manager) version.

Returns the version string of the SGM engine integrated with Cubit.

.. code-block:: python
import cubit
sgm_version = cubit.get_sgm_version ()
print("SGM version:" , sgm_version)
 @n return type of :  string
Returns
A string containing the SGM version number.

◆ get_sharp_angle_vertices()

def cubit.get_sharp_angle_vertices (   target_volume_ids,
  upper_bound,
  lower_bound 
)

Identify vertices at sharp curve angles in a set of volumes.

This function computes the interior angles at curve intersections (sharp corners) on the surfaces of each of the specified volumes. Vertices are identified where the interior angle exceeds the specified upper_bound or falls below the lower_bound threshold.

.. code-block:: python
cubit.cmd ('brick x 10' )
cubit.cmd ('cylinder rad 5 height 10' )
cubit.cmd ('vol 2 mov z 10' )
cubit.cmd ('unite vol all' )
sharp_vertex_data = cubit.get_sharp_angle_vertices ([1], 350, 10)
vertex_ids = sharp_vertex_data[0]
angles = sharp_vertex_data[1]
print("Sharp vertices:" )

for vid, angle in zip(vertex_ids, angles): print(f"Vertex {int(vid)} angle {angle:.1f}")

# Expected output:
# Vertex 11 angle 0.0
# Vertex 12 angle 0.0
# Vertex 13 angle 0.0
# Vertex 14 angle 0.0
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids List of volume IDs to analyze.
type of upper_bound: float
upper_bound Upper threshold angle, in degrees.
type of lower_bound: float
lower_bound Lower threshold angle, in degrees.
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
: A 2D array [ vertex IDs[], corresponding angles[] ]. The first array contains the unique vertex IDs (as integers). The second array contains the corresponding angle at each vertex (as floating-point values).

◆ get_sideset_area()

def cubit.get_sideset_area (   sideset_id )

Get the total area of a sideset.

A sideset can contain triangle (tri) or quadrilateral (face) elements. This function returns the sum of the areas of those elements, if they exist. If no such elements are present in the sideset, the function returns zero.

.. code-block:: python
# Create a brick, mesh the volume, and assign faces on surface 1 to sideset 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("sideset 1 face in surface 1" )
# Query the area of sideset 1
print(f"Sideset 1 total area: {area}" )
 @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : float
Returns
Sum of the areas of all tris or faces in the sideset.

◆ get_sideset_count()

def cubit.get_sideset_count ( )

Get the current number of sidesets in the model.

In Cubit, a sideset groups element faces (or edges) for applying boundary conditions. Sidesets can be defined by assigning surfaces, curves, faces, or mesh entities to a given ID.

.. code-block:: python
# Create and mesh a brick; surfaces 1-6 become mesh faces.
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
# Define sideset 101 to include faces on surface 1.
cubit.cmd ("Sideset 101 add surface 1" )
# get_sideset_count() returns 1.
print("Sideset count:" , count) # prints 1
 @n return type of :  int
Returns
The number of sidesets currently defined in the model.

◆ get_sideset_curves()

def cubit.get_sideset_curves (   sideset_id )

Get the list of curve IDs associated with a sideset.

This function returns the IDs of all curves that are associated with the specified sideset.

.. code-block:: python
# Create a brick and assign curves in volume 1 to sideset 10
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 10 curve in vol 1" )
# Query the curves in sideset 10
curve_ids = cubit.get_sideset_curves (10)
print(f"Sideset 10 contains {len(curve_ids)} curve(s)." )

for curve_id in curve_ids: print(f" Curve ID: {curve_id}")

  @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of curve IDs contained in the sideset.

◆ get_sideset_edges()

def cubit.get_sideset_edges (   sideset_id )

Get the list of edge IDs contained in a sideset.

A sideset can contain edge elements. This function returns the IDs of those edge elements, if they exist. An empty list will be returned if there are no edges in the sideset.

.. code-block:: python
# Create a brick, mesh volume 1, and assign edges in volume 1 to sideset 20
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("sideset 20 edge in curve in vol 1" )
# Query the edges in sideset 20
edge_ids = cubit.get_sideset_edges (20)
print(f"Sideset 20 contains {len(edge_ids)} edge(s)." )

for edge_id in edge_ids: print(f" Edge ID: {edge_id}")

  @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of edge IDs contained in the sideset.

◆ get_sideset_element_type()

def cubit.get_sideset_element_type (   sideset_id )

Get the element type of a sideset.


type of sideset_id: int

Parameters
sideset_id The id of the sideset to be queried
return type of : string
Returns
Element type

◆ get_sideset_id_list()

def cubit.get_sideset_id_list ( )

Get a list of all active sideset IDs.

Returns a vector of all currently active sideset IDs in the model.

.. code-block:: python
# Create geometry
cubit.cmd ("brick x 10" )
# Create sidesets on surfaces
cubit.cmd ("sideset 20 surface 1" )
cubit.cmd ("sideset 21 surface 2" )
# Query all active sideset IDs
sideset_ids = cubit.get_sideset_id_list ()
# Print the sideset IDs
print("Active sideset IDs:" )

for sideset_id in sideset_ids: print(" Sideset ID:", sideset_id)

# Expected output (example):
# Active sideset IDs:
# Sideset ID: 20
# Sideset ID: 21
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
Vector (Python tuple) of all active sideset IDs.

◆ get_sideset_id_list_for_bc()

def cubit.get_sideset_id_list_for_bc (   bc_type_enum,
  bc_id 
)

Get list of sideset IDs associated with a boundary condition.

Returns sidesets to which the BC is applied.


type of bc_type_enum: int

Parameters
bc_type_enum BC type enum (CI_BCTypes).
type of bc_id: int
bc_id ID of the boundary condition.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of associated sideset IDs.

◆ get_sideset_quads()

def cubit.get_sideset_quads (   sideset_id )

Get the list of quadrilateral (quad) element IDs contained in a sideset.

A sideset can contain quadrilateral elements (faces). This function returns the IDs of those quad elements, if they exist. An empty list will be returned if there are no quads in the sideset.

.. code-block:: python
# Create a brick, mesh the volume, and assign faces on surface 1 to sideset 4
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol all" )
cubit.cmd ("sideset 4 face in surface 1" )
# Query the quads in sideset 4
quad_ids = cubit.get_sideset_quads (4)
print(f"Sideset 4 contains {len(quad_ids)} quad(s)." )

for quad_id in quad_ids: print(f" Quad ID: {quad_id}")

  @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of quadrilateral (quad) element IDs contained in the sideset.

◆ get_sideset_surfaces()

def cubit.get_sideset_surfaces (   sideset_id )

Get the list of surface IDs contained in a sideset.

A sideset can contain surfaces. This function returns the IDs of those surfaces, if they exist. An empty list will be returned if there are no surfaces in the sideset.

.. code-block:: python
# Create a brick and assign surface 3 to sideset 3
cubit.cmd ("brick x 10" )
cubit.cmd ("sideset 3 surface 3" )
# Query the surfaces in sideset 3
surface_ids = cubit.get_sideset_surfaces (3)
print(f"Sideset 3 contains {len(surface_ids)} surface(s)." )

for surf_id in surface_ids: print(f" Surface ID: {surf_id}")

  @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs contained in the sideset.

◆ get_sideset_tris()

def cubit.get_sideset_tris (   sideset_id )

Get the list of triangle (tri) element IDs contained in a sideset.

A sideset can contain triangle (tri) elements. This function returns the IDs of those tri elements, if they exist. An empty list will be returned if there are no tris in the sideset.

.. code-block:: python
# Create a brick, tetmesh volume 1, and assign tris on surface 6 to sideset 6
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("sideset 6 tri in surface 6" )
# Query the tris in sideset 6
tri_ids = cubit.get_sideset_tris (6)
print(f"Sideset 6 contains {len(tri_ids)} tri(s)." )

for tri_id in tri_ids: print(f" Tri ID: {tri_id}")

  @n type of sideset_id:  int
Parameters
sideset_id ID of the sideset to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of triangle (tri) element IDs contained in the sideset.

◆ get_similar_curves()

def cubit.get_similar_curves (   curve_ids,
  tol = 1e-3,
  use_percent_tol = True,
  on_similar_vols = True 
)

Find curves with lengths similar to a given curve.

This function compares the length of the curve in curve_ids against all other curves in the model. Curves whose lengths differ by no more than tol (interpreted as a fraction if use_percent_tol is true, or as an absolute length if false) are considered similar. If on_similar_vols is true, only curves on volumes with the same geometry as the volume owning curve_ids are compared.

.. code-block:: python
# Create a cylinder of radius 1 and height 2; its circular edges are curves 1 (back) and 2 (front)
cubit.cmd ("create cylinder radius 1 height 2" )
# Find curves similar to curve 1.
matches = cubit.get_similar_curves ([1])
print(matches) # prints (1, 2)
 @n type of curve_ids:  std::vector< int,std::allocator< int > >
Parameters
curve_ids List of curve IDs to compare against.
type of tol: float, optional
tol Tolerance for length comparison (fraction if use_percent_tol is true, otherwise absolute).
type of use_percent_tol: boolean, optional
use_percent_tol If true, interpret tol as a fraction of the curve length; otherwise interpret as an absolute length.
type of on_similar_vols: boolean, optional
on_similar_vols If true, restrict comparison to curves on volumes similar to the volume owning curve_ids.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of curve IDs whose lengths match within tolerance.

◆ get_similar_surfaces()

def cubit.get_similar_surfaces (   surface_ids,
  tol = 1e-3,
  use_percent_tol = True,
  on_similar_vols = True 
)

Find surfaces with similar area and curve count to given surfaces.

This function compares each surface in surface_ids against all other surfaces in the model. Surfaces whose areas differ by no more than tol (interpreted as a fraction if use_percent_tol is true, or as an absolute area if false) and that have the same number of bounding curves are considered similar. If on_similar_vols is true, only surfaces on volumes with the same geometry as the volumes owning surface_ids are compared.

.. code-block:: python
# Create a cylinder of radius 1 and height 2; its circular end faces are surfaces 2 and 3.
cubit.cmd ("create cylinder radius 1 height 2" )
# Find surfaces similar to surface 2.
matches = cubit.get_similar_surfaces ([2])
print(matches) # prints (2, 3)
 @n type of surface_ids:  std::vector< int,std::allocator< int > >
Parameters
surface_ids List of surface IDs to compare against.
type of tol: float, optional
tol Tolerance for area comparison (fraction if use_percent_tol is true, otherwise absolute).
type of use_percent_tol: boolean, optional
use_percent_tol If true, interpret tol as a fraction of the surface area; otherwise interpret as an absolute area.
type of on_similar_vols: boolean, optional
on_similar_vols If true, restrict comparison to surfaces on volumes similar to the volumes owning surface_ids.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list of surface IDs whose areas and curve counts match within tolerance.

◆ get_similar_volumes()

def cubit.get_similar_volumes (   volume_ids,
  tol = 1e-3,
  use_percent_tol = True 
)

Find volumes with similar size and face count to given volumes.

This function compares each volume in volume_ids against all other volumes in the model. Volumes whose volumes differ by no more than tol (interpreted as a fraction if use_percent_tol is true, or as an absolute volume if false) and that have the same number of faces are considered similar.

.. code-block:: python
# Create two identical bricks of size 10 (volumes 1 and 2).
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 2 move x 20" ) # separate the second brick
# Find volumes similar to volume 1.
matches = cubit.get_similar_volumes ([1])
print(matches) # prints (1, 2)
 @n type of volume_ids:  std::vector< int,std::allocator< int > >
Parameters
volume_ids List of volume IDs to compare against.
type of tol: float, optional
tol Tolerance for volume comparison (fraction if use_percent_tol is true, otherwise absolute).
type of use_percent_tol: boolean, optional
use_percent_tol If true, interpret tol as a fraction of the volume; otherwise interpret as an absolute volume.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector or Python tuple) of volume IDs whose volumes and face counts match within tolerance.

◆ get_sizing_function_name()

def cubit.get_sizing_function_name (   entity_type,
  entity_id 
)

Retrieve the meshing sizing function type for a surface or volume.

Returns the sizing function type assigned to the specified entity. Possible return values: "constant", "curvature", "interval", "inverse", "linear", "super", "test", "exodus", or "none".

.. code-block:: python
import cubit
# After setting a volume sizing function:
# cubit.cmd("Volume 2 Sizing Function Type Curvature");
fn = cubit.get_sizing_function_name ("volume" , 2)
print("Volume 2 sizing function:" , fn) # prints "curvature"
 @n type of entity_type:  string
Parameters
entity_type Either "surface" or "volume".
type of entity_id: int
entity_id ID of the surface or volume.
return type of : string
Returns
The sizing function name assigned to that entity.

◆ get_small_and_narrow_surfaces()

def cubit.get_small_and_narrow_surfaces (   target_ids,
  small_area,
  small_curve_size 
)

Find surfaces that are either small in area or contain narrow regions.

For each face of volumes in target_ids, measures its area and checks if area <= small_area. Also checks for narrow regions by evaluating pairs of non-adjacent edges: if their distance <= small_curve_size and orientation difference > 15deg, the face is narrow. Returns all face IDs meeting either criterion.

.. code-block:: python
volume_ids = [1, 2]
area_thresh = 0.25 # e.g., mesh_size * mesh_size.
narrow_thresh = 0.1 # Edge-distance threshold.
results = cubit.get_small_and_narrow_surfaces (volume_ids, area_thresh, narrow_thresh)

for sid in results: print("Surface ID:", sid)

  @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_ids Vector of volume IDs to examine.
type of small_area: float
small_area Area threshold; faces with area <= small_area qualify as "small."
type of small_curve_size: float
small_curve_size Distance threshold; faces with any two non-adjacent edges within small_curve_size and orientation difference > 15deg qualify as "narrow."
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of faces that are small or narrow.

◆ get_small_curves()

def cubit.get_small_curves (   target_volume_ids,
  mesh_size 
)

Find curves with edge length below a threshold within given volumes.

For each curve on faces of volumes in target_volume_ids, measures its edge length. Curves with length <= mesh_size are returned.

.. code-block:: python
volume_ids = [1, 2]
mesh_size = 0.5 # Edge-length threshold.
small_curves = cubit.get_small_curves (volume_ids, mesh_size)

for cid in small_curves: print("Small curve ID:", cid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Edge-length threshold for "small" curves.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of curves with length <= mesh_size.

◆ get_small_radius_blend_surfaces()

def cubit.get_small_radius_blend_surfaces (   target_volume_ids,
  max_radius 
)

Find blend surfaces with radius of curvature <= max_radius.

Iterates over all faces of volumes in target_volume_ids and returns those blend surfaces whose radius of curvature is <= max_radius. If max_radius = 0, all blend surfaces are returned.

.. code-block:: python
# Create a 10x10x10 brick and apply two blends: one with radius 0.5 and one with radius 2.
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 1 blend radius 0.5" ) # blend surface 7
cubit.cmd ("modify curve 2 blend radius 2.0" ) # blend surface 8
# Get only the small-radius blends (<= 1.0).
max_radius = 1.0
small_blends = cubit.get_small_radius_blend_surfaces ([1], max_radius)
print(small_blends) # expect [7]
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of max_radius: float
max_radius Maximum radius of curvature; if 0, return all blend surfaces.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of blend surface IDs with radius <= max_radius.

◆ get_small_surfaces()

def cubit.get_small_surfaces (   target_volume_ids,
  area_threshold 
)

Find surfaces with area below a given threshold.

Gathers all unique faces from the specified volumes, measures each face's area, and returns those with area <= area_threshold.

.. code-block:: python
volume_ids = [1, 2]
area_threshold = 0.25 # e.g., mesh_size * mesh_size.
small_surfaces = cubit.get_small_surfaces (volume_ids, area_threshold)

for sid in small_surfaces: print("Small surface ID:", sid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of area_threshold: float
area_threshold Area threshold; faces with area <= area_threshold are returned.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of surfaces with area <= area_threshold.

◆ get_small_surfaces_HR()

def cubit.get_small_surfaces_HR (   target_volume_ids,
  mesh_size 
)

Python-callable version: identify small hydraulic-radius surfaces.

Computes hydraulic radius = 4*(area/perimeter) for each face in target_volume_ids. Returns IDs of faces with hydraulic radius <= mesh_size.

.. code-block:: python
volume_ids = [1, 2]
mesh_size = 0.5 # Hydraulic radius threshold.
small_surfaces = cubit.get_small_surfaces_HR (volume_ids, mesh_size)

for sid in small_surfaces: print("Small surface ID:", sid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Hydraulic radius threshold (faces with 4*(area/perimeter) <= mesh_size are "small").
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of small hydraulic-radius surfaces.

◆ get_small_volumes()

def cubit.get_small_volumes (   target_volume_ids,
  mesh_size 
)

Find volumes whose size is below a threshold based on mesh size.

Volumes with actual volume < 10 * mesh_size^3 are considered "small".

.. code-block:: python
# Create two small and one larger brick.
cubit.cmd ("brick x 0.5 y 0.5 z 0.5" ) # Vol 1
cubit.cmd ("brick x 1 y 1 z 1" ) # Vol 2
cubit.cmd ("brick x 3 y 3 z 3" ) # Vol 3
mesh_size = 1.0 # 10 * 1^3 = 10.
small_vols = cubit.get_small_volumes ([1, 2, 3], mesh_size)
print(small_vols) # expect [1, 2]
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of mesh_size: float
mesh_size Threshold defining "small": volumes with volume < 10 * mesh_size^3.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of volumes that meet the "small" criterion.

◆ get_smallest_curves()

def cubit.get_smallest_curves (   target_volume_ids,
  number_to_return 
)

Return IDs of the smallest curves in the specified volumes.

Measures the length of each curve on faces of volumes in target_volume_ids and returns the number_to_return curves with the shortest lengths.

.. code-block:: python
volume_ids = [1, 2]
number_to_return = 5 # Get five shortest curves.
smallest_curves = cubit.get_smallest_curves (volume_ids, number_to_return)

for cid in smallest_curves: print("Curve ID:", cid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_ids Vector of volume IDs to examine.
type of number_to_return: int
number_to_return Number of smallest curves to return.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of IDs of the smallest curves.

◆ get_smooth_scheme()

def cubit.get_smooth_scheme (   geometry_type,
  entity_id 
)

Retrieve the smoothing scheme for a specified geometry entity.

This returns the name of the smoothing scheme applied to the given entity ("curve", "surface", or "volume") and ID. If none is set, returns an empty string.

.. code-block:: python
cubit.cmd ("surface 10 smooth scheme mean ratio" )
scheme = cubit.get_smooth_scheme ("surface" , 10)
print("Smooth scheme:" , scheme)
 @n type of geometry_type:  string
Parameters
geometry_type The geometry type: "curve", "surface", or "volume".
type of entity_id: int
entity_id The ID of the entity.
return type of : string
Returns
The smoothing scheme name, or an empty string if none is set.

◆ get_solutions_for_bad_geometry()

def cubit.get_solutions_for_bad_geometry (   geom_type,
  geom_id 
)

Provide remedy for bad geometry via ACIS healing (deprecated).

Bad geometry often results from imperfect CAD translations. This function invokes ACIS's built-in healing operation.

Note
ACIS healing support is deprecated and will be removed in a future release. Alternative solutions for bad geometry are pending.


type of geom_type: string

Parameters
geom_type Type of entity: "curve", "surface", "volume", or "body".
type of geom_id: int
geom_id ID of the geometry entity to query.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of three string vectors: [0] Display string, [1] Command string, [2] Preview string.

◆ get_solutions_for_blends()

def cubit.get_solutions_for_blends (   surface_id )

Provide possible blend removal solutions for a given surface (and its blend chain if applicable).

Given a surface ID, this function returns possible solutions for removing or adjusting blends on that surface. If the surface is part of a blend chain, the solutions will include operations for the entire blend chain as well.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("modify curve 12 2 8 11 blend radius 1" ) # Blend the four curves on surface 5
# Get blend removal solutions for surface 10:
surface_id = 10
solutions = cubit.get_solutions_for_blends (surface_id)

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output:
# Option: Remove Blend Chain at Surface 10
# Command: remove surface 10 blend_chain
# Preview: remove surface 10 blend_chain preview
# Shorthand: 15 10
 @n type of surface_id:  int
Parameters
surface_id The surface being queried. If part of a blend chain, solutions will include the full chain.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each recommended blend solution, [1] Cubit command strings to apply each blend solution, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and involved surface IDs).

◆ get_solutions_for_bolt()

def cubit.get_solutions_for_bolt (   bolt_id,
  insert_id,
  threaded_vol_id 
)

Suggests operations for a volume classified as a bolt using known subcomponent IDs.

This function provides modification options for a bolt volume using known insert and threaded subcomponent volumes. It is more efficient than get_solutions_for_classified_volume when those IDs are already available.

Set insert_id or threaded_vol_id to 0 if the corresponding volume is not present or not known. To classify bolt volumes in the model, use get_ML_classification() .

.. code-block:: python
cubit.cmd ("cylinder radius 1 height 10" ) # volume 1
cubit.cmd ("cylinder radius 2 height 2" ) # volume 2
cubit.cmd ("volume 2 move z 5" )
cubit.cmd ("unite volume all" ) # volume 1 becomes a bolt
solutions = cubit.get_solutions_for_bolt (1, 0, 0)

for i in range(3): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" ML Op:" , solutions[3][i])
# Expected output (first three results only):
# Option: Delete Bolt Volume 1
# Command: delete volume 1
# Preview: highlight volume 1
# ML Op: 40 1 0 0
# Option: Reduce Bolt 1 Simplify
# Command: reduce volume 1
# Preview: highlight volume 1
# ML Op: 42 1 0 0 1 1 0
# Option: Reduce Bolt 1 Tight Fit
# Command: reduce volume 1 bolt fit_volume tight_fit remove_key merge
# Preview: highlight volume 1
# ML Op: 42 1 0 0 1 1 1
 @n type of bolt_id:  int
Parameters
bolt_id ID of the volume classified as a bolt.
type of insert_id: int
insert_id Optional ID of the insert volume at the bolt interface. Use 0 if absent.
type of threaded_vol_id: int
threaded_vol_id Optional ID of the threaded (lower) volume. Use 0 if absent or unknown.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended operation, [1] Cubit commands to execute the operations, [2] Preview commands for visualization, [3] Operation strings formatted for machine learning tools. In Python, the result is a tuple of lists.

◆ get_solutions_for_bolt_hole()

def cubit.get_solutions_for_bolt_hole (   bearing_hole,
  threaded_holes 
)

Suggests repair or modification options for a set of concentric fastener pilot holes.

Given a bearing hole surface ID and a list of concentric threaded hole surface IDs, this function identifies potential repair or optimization operations.

.. code-block:: python
cubit.cmd ("brick x 10 y 10 z 2" )
cubit.cmd ("brick x 10 y 10 z 2" )
cubit.cmd ("volume 2 move z 2" )
cubit.cmd ("cylinder radius 1 height 10" )
cubit.cmd ("subtract volume 3 from volume 1 2" )
threaded_holes = [19]
solutions = cubit.get_solutions_for_bolt_hole (16, threaded_holes)

for i in range(3): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output (first three results only):
# Option: Delete Pilot Hole at Surfaces 16 19
# Command: remove surface 16 19 include hole
# Preview: highlight surface 16 19
# Shorthand: 57 16 19
# Option: Reduce Hole at Surfaces 16 19 Spider Wagon Wheel
# Command: reduce upper surface 16 lower surface 19 hole spider wagon wheel mesh
# Preview: highlight surface 16 19
# Shorthand: 58 16 19 3 1 0
# Option: Reduce Hole at Surfaces 16 19 Spider J2G
# Command: reduce upper surface 16 lower surface 19 hole spider j2g mesh
# Preview: highlight surface 16 19
# Shorthand: 58 16 19 3 2 0
 @n type of bearing_hole:  int
Parameters
bearing_hole ID of the surface on the bearing hole (one per hole).
type of threaded_holes: std::vector< int,std::allocator< int > >
threaded_holes List of surface IDs from concentric threaded holes (one per hole).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each proposed operation, [1] Cubit commands to execute them, [2] Preview commands for visualization, [3] Shorthand strings identifying operation and surface IDs. In Python, the result is a tuple of lists.

◆ get_solutions_for_cavity_surface()

def cubit.get_solutions_for_cavity_surface (   surface_id )

Provide possible cavity removal or adjustment solutions for a given surface (and its cavity if applicable).

Given a surface ID, this function returns possible solutions for removing or adjusting cavity geometry on that surface. If the surface is part of a cavity, the solutions will include operations for the entire cavity as well.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
cubit.cmd ("vol 5 move x 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
# Get cavity removal solutions for surface 17:
surface_id = 17
solutions = cubit.get_solutions_for_cavity_surface (surface_id)

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
# Expected output:
# Option: Remove Cavity at Surface 17
# Command: remove surface 17 cavity
# Preview: remove surface 17 cavity preview
 @n type of surface_id:  int
Parameters
surface_id The surface being queried. If part of a cavity, solutions will include the full cavity.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of three string vectors: [0] Display strings for each recommended cavity solution, [1] Cubit command strings to apply each cavity solution, [2] Cubit preview command strings.

◆ get_solutions_for_classified_surface()

def cubit.get_solutions_for_classified_surface (   classification,
  surf_id 
)

Suggests remedies or modifications for a classified surface.

.. code-block:: python

#Subtract a smaller cylinder from a larger one.
cubit.cmd ("cylinder rad 10 height 3" ) # volume 1
cubit.cmd ("cylinder rad 8 height 3" ) # volume 2
cubit.cmd ("subtract vol 2 from vol 1" ) # creates annulus surface 9
cubit.cmd ("classify surface 9 \"slot\"" ) # machine learning operation

for disp, cmd, prev, shrt in zip(solutions[0], solutions[1], solutions[2], solutions[3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
 @n type of classification:  string
Parameters
classification Type assigned to the surface (e.g., "slot", "hole", "fillet").
type of surf_id: int
surf_id ID of the classified surface.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings describing each remedy, [1] Cubit command strings to execute each remedy, [2] Preview commands for visualization, [3] Shorthand operation descriptors.

◆ get_solutions_for_classified_volume()

def cubit.get_solutions_for_classified_volume (   classification,
  vol_id 
)

Suggests geometry fixes or feature operations for a volume based on its classification.

Given a classification type and a volume ID, this function generates recommended modifications.

To obtain classifications from Cubit's ML system, use get_ML_classification() .

.. code-block:: python
cubit.cmd ("cylinder radius 1 height 10" ) # volume 1
cubit.cmd ("cylinder radius 2 height 2" ) # volume 2
cubit.cmd ("volume 2 move z 5" )
cubit.cmd ("unite volume all" ) # volume 1 becomes a bolt

for i in range(3): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" ML Op:" , solutions[3][i])
# Expected output (first three results only):
# Option: Delete Bolt Volume 1
# Command: delete volume 1
# Preview: highlight volume 1
# ML Op: 40 1 0
# Option: Reduce Bolt 1 Simplify
# Command: reduce volume 1
# Preview: highlight volume 1
# ML Op: 42 1 0
# Option: Reduce Bolt 1 Tight Fit
# Command: reduce volume 1 bolt fit_volume tight_fit remove_key merge
# Preview: highlight volume 1
# ML Op: 42 1 0 1 1 0
 @n type of classification:  string
Parameters
classification Classification type: one of "bolt", "nut", "washer", "spring", "ball", "race", "pin", "gear", "insert", or "other".
type of vol_id: int
vol_id ID of the volume to process.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each suggested operation, [1] Cubit command strings to apply the operations, [2] Preview command strings for visualization, [3] Machine-learning-formatted operation strings.

◆ get_solutions_for_close_loop()

def cubit.get_solutions_for_close_loop (   surface_id,
  mesh_size 
)

Retrieve recommended remedies for a close-loop surface to resolve narrow regions.

.. code-block:: python

cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("modify curve 2 blend radius 0.5" )
mesh_size = 1.0
solutions = cubit.get_solutions_for_close_loop (4, mesh_size)

for disp, cmd, prev, shrt in zip(solutions[0], solutions[1], solutions[2], solutions[3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Expected output:
# Option: Remove Surface 4
# Command: remove surface 4 extend
# Preview: remove surface 4 extend preview
# Shorthand: 5 4
# Option: Composite Surfaces 4 and 3
# Command: composite create surface 4 3 keep angle 180.0
# Preview: highlight surface 4 3
# Shorthand: 7 4 3
# Option: Composite Surfaces 4 and 1
# Command: composite create surface 4 1 keep angle 180.0
# Preview: highlight surface 4 1
# Shorthand: 7 4 1
 @n type of surface_id:  int
Parameters
surface_id ID of the close-loop surface being queried.
type of mesh_size: float
mesh_size Distance threshold that defines a narrow loop region.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and entity IDs) for reconstructing the operation.

◆ get_solutions_for_cone_surface()

def cubit.get_solutions_for_cone_surface (   surface_id )

Suggests remedies for a surface classified as a cone.

Returns recommended operations for a conical surface, including human-readable descriptions, Cubit command strings to apply them, preview commands for visualization, and shorthand strings for serialization or machine learning workflows.

.. code-block:: python
cubit.cmd ("create frustum height 2 radius 2 top 0" )
cubit.cmd ("cylinder rad 2 height 10" )
cubit.cmd ("vol 2 mov z -6" )
cubit.cmd ("unite vol all" )
cubit.cmd ("brick x 10" )
cubit.cmd ("subtract vol 1 from vol 3" ) # cone surface becomes surface 13

for disp, cmd, prev, shrt in zip(solutions[0], solutions[1], solutions[2], solutions[3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Output:
# Option: Remove Cone Surface 13
# Command: tweak surface 13 cone
# Preview: highlight surface 13
# Shorthand: 13 13
# Option: Composite Surfaces 13 and 12
# Command: composite create surface 13 12 keep angle 180.0
# Preview: highlight surface 13 12
# Shorthand: 7 13 12
 @n type of surface_id:  int
Parameters
surface_id ID of the conical surface.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each recommended operation, [1] Cubit command strings, [2] Preview command strings, [3] Shorthand operation descriptors.
Note
In Python, returned vectors will be tuples.

◆ get_solutions_for_decomposition()

def cubit.get_solutions_for_decomposition (   volume_list,
  exterior_angle,
  do_imprint_merge,
  tolerant_imprint 
)

Provide possible decomposition solutions for volumes based on exterior angle criteria.

Given a list of volumes and an exterior angle threshold, this function suggests possible decompositions. Optionally, imprinting and merging can be performed to support the decomposition process.

.. code-block:: python
cubit.cmd ("brick x 10 y 10 z 2" ) # Volume 1
cubit.cmd ("brick x 10 y 2 z 10" ) # Volume 2
cubit.cmd ("volume 2 move y -5" )
cubit.cmd ("unite volume all" )
volume_list = [1]
exterior_angle = 135.0
do_imprint_merge = False
tolerant_imprint = False
solutions = cubit.get_solutions_for_decomposition (volume_list, exterior_angle, do_imprint_merge, tolerant_imprint)

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
# Expected output (partial):
# Option: Webcut Volume 1 With Sheet Extended From Surface 17
# Command: webcut volume 1 with sheet extended from surface 17 imprint merge include_neighbors
# Preview: webcut volume 1 with sheet extended from surface 17 imprint merge include_neighbors preview
# Option: Webcut Volume 1 With Sheet Extended From Surface 16
# Command: webcut volume 1 with sheet extended from surface 16 imprint merge include_neighbors
# Preview: webcut volume 1 with sheet extended from surface 16 imprint merge include_neighbors preview
# ... additional options ...
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of exterior_angle: float
exterior_angle Threshold value for the exterior angle (in degrees) used to determine decomposition faces.
type of do_imprint_merge: boolean
do_imprint_merge If true, perform imprint and merge operations to support decomposition.
type of tolerant_imprint: boolean
tolerant_imprint If true, perform tolerant imprinting.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each recommended decomposition option, [1] Cubit command strings to apply each decomposition option, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and involved volume or surface IDs). This may be empty depending on the solution.

◆ get_solutions_for_imprint_merge()

def cubit.get_solutions_for_imprint_merge (   surface_id1,
  surface_id2 
)

Suggests remedies for imprint/merge when two overlapping surfaces are on different volumes.

Given two overlapping surface IDs from different volumes, this function provides suggested operations to resolve the overlap.

To detect overlapping surfaces beforehand, use get_overlapping_surfaces_at_surface (for a single surface) or get_overlapping_surfaces_in_volumes (for sets of volumes).

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("volume 2 move z 10" )

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
# Expected output (3 remedies):
# Option: Imprint with curves 13
# Command: imprint tolerant surface 1 with curve 13 merge
# Preview: draw surface 1 8 overlap;highlight curve 13
# Option: Auto Fix
# Command: merge surface 1 8 auto_imprint
# Preview:
# Option: Tolerant Imprint Owning Volumes
# Command: imprint tolerant volume 1 2 merge
# Preview:
 @n type of surface_id1:  int
Parameters
surface_id1 ID of the first overlapping surface (must be on a different volume than surface_id2).
type of surface_id2: int
surface_id2 ID of the second overlapping surface (must be on a different volume than surface_id1).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings for each remedy, [3] Shorthand descriptions (operation ID and surface/volume IDs; may be empty).

◆ get_solutions_for_near_coincident_vertex_and_curve()

def cubit.get_solutions_for_near_coincident_vertex_and_curve (   vertex_id,
  curve_id 
)

Suggests remedies when a vertex lies nearly on a curve from a different volume.

Given a vertex and a nearby curve from different volumes, this function identifies operations to resolve the near-coincidence without introducing geometry issues.

To detect such vertex-curve pairs, use get_close_vertex_curve_pairs.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("volume 2 move x 10 y 5 z 0.01" )

for i in range(3): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output (first three results only):
# Option: tweak surfaces in vertex 12 to curve 1
# Command: tweak surface in vertex 12 move vertex 12 location 5 0 5
# Preview: tweak surface in vertex 12 move vertex 12 location 5 0 5 preview
# Shorthand: 47 12 1 5 0 5
# Option: tweak surfaces in curve 1 to vertex 12
# Command: tweak surface in curve 1 move curve 1 location vertex 12
# Preview: tweak surface in curve 1 move curve 1 location vertex 12 preview
# Shorthand: 48 1 12 0 0 0
# Option: move volume 2 from vertex 12 to curve 1
# Command: move vertex 12 location 5 0 5 include_merged
# Preview: move vertex 12 location 5 0 5 include_merged preview
# Shorthand: 52 12 1 5 0 5
 @n type of vertex_id:  int
Parameters
vertex_id ID of the vertex that is nearly coincident with the curve (must be on a different volume).
type of curve_id: int
curve_id ID of the curve that lies near the vertex (must be on a different volume).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings for each remedy, [3] Shorthand descriptions (operation ID and vertex/curve IDs).

◆ get_solutions_for_near_coincident_vertex_and_surface()

def cubit.get_solutions_for_near_coincident_vertex_and_surface (   vertex_id,
  surface_id 
)

Suggests remedies when a vertex lies nearly on a surface from a different volume.

Given a vertex and a nearby surface from different volumes, this function identifies potential fixes such as tweaks or volume adjustments.

To identify near-coincident vertex-surface pairs, use get_close_vertex_surface_pairs.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("volume 2 move x 10.01 y 5 z 5" )

for i in range(3): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output (first three results only):
# Option: tweak surfaces in vertex 15 to surface 6
# Command: tweak surface in vertex 15 move vertex 15 location 5 0 0
# Preview: tweak surface in vertex 15 move vertex 15 location 5 0 0 preview
# Shorthand: 49 15 6 5 0 0
# Option: tweak surface 6 to vertex 15
# Command: tweak surface 6 move surface 6 location vertex 15
# Preview: tweak surface 6 move surface 6 location vertex 15 preview
# Shorthand: 50 6 15 0 0 0
# Option: move volume 2 from vertex 15 to surface 6
# Command: move vertex 15 location 5 0 0 include_merged
# Preview: move vertex 15 location 5 0 0 include_merged preview
# Shorthand: 54 15 6 5 0 0
 @n type of vertex_id:  int
Parameters
vertex_id ID of the vertex that is nearly coincident with the surface (must be on a different volume).
type of surface_id: int
surface_id ID of the surface that lies near the vertex (must be on a different volume).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings for each remedy, [3] Shorthand descriptions (operation ID and vertex/surface IDs).

◆ get_solutions_for_near_coincident_vertices()

def cubit.get_solutions_for_near_coincident_vertices (   vertex_id_1,
  vertex_id_2 
)

Provide remedies for two nearly coincident vertices on different volumes to resolve gaps or misalignments.

Vertices must belong to different volumes.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("volume 2 move x 10 y 0.01" )

for disp, cmd, prev, shrt in zip(solutions[0][:3], solutions[1][:3], solutions[2][:3], solutions[3][:3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
print("and more" )
# Expected output:
# Option: tweak surfaces in vertex 2 to vertex 11
# Command: tweak surface in vertex 2 move vertex 2 location vertex 11
# Preview: tweak surface in vertex 2 move vertex 2 location vertex 11 preview
# Shorthand: 46 2 11 0 0 0
# Option: move volume 1 from vertex 2 to vertex 11
# Command: move vertex 2 location vertex 11 include_merged
# Preview: move vertex 2 location vertex 11 include_merged preview
# Shorthand: 51 2 11 0 0 0
# Option: tweak surfaces in vertex 11 to vertex 2
# Command: tweak surface in vertex 11 move vertex 11 location vertex 2
# Preview: tweak surface in vertex 11 move vertex 11 location vertex 2 preview
# Shorthand: 46 11 2 0 0 0
# and more
 @n type of vertex_id_1:  int
Parameters
vertex_id_1 ID of the first vertex (on volume 1).
type of vertex_id_2: int
vertex_id_2 ID of the second vertex (on volume 2).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and vertex IDs).

◆ get_solutions_for_overlapping_surfaces()

def cubit.get_solutions_for_overlapping_surfaces (   surface_id_1,
  surface_id_2 
)

Suggests remedies for two overlapping surfaces on different volumes.

Given two overlapping surface IDs from different volumes that share the same spatial region, this function provides imprint and merge options for resolving the overlap.

To identify overlapping surfaces beforehand, use get_overlapping_surfaces_at_surface or get_overlapping_surfaces_in_volumes.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("volume 2 move x 10" )

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output:
# Option: Imprint Volumes 1 2
# Command: imprint volume 1 2
# Preview: highlight volume 1 2
# Shorthand: 45 1 2
# Option: Imprint & Merge Volumes 1 2
# Command: imprint volume 1 2;merge volume 1 2
# Preview: highlight volume 1 2
# Shorthand: 44 1 2
 @n type of surface_id_1:  int
Parameters
surface_id_1 ID of the first overlapping surface (must be on a different volume than surface_id_2).
type of surface_id_2: int
surface_id_2 ID of the second overlapping surface (must be on a different volume than surface_id_1).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings for each remedy, [3] Shorthand descriptions (operation ID and volume IDs).

◆ get_solutions_for_overlapping_volumes()

def cubit.get_solutions_for_overlapping_volumes (   volume_id_1,
  volume_id_2,
  maximum_gap_tolerance,
  maximum_gap_angle 
)

Provide remedies for two overlapping volumes based on gap and angular tolerances.

If two volume IDs represent overlapping solids and the overlap exceeds a given gap or angle tolerance, this function suggests operations to resolve the interference.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("volume 2 move x 9.9" )
solutions = cubit.get_solutions_for_overlapping_volumes (1, 2, 0.2, 5.0)

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output:
# Option: Remove Overlap from Smaller Volume (2)
# Command: remove overlap volume 1 2 modify smaller
# Preview: highlight volume 2
# Shorthand: 41 2 1
# Option: Remove Overlap from Larger Volume (1)
# Command: remove overlap volume 1 2 modify larger
# Preview: highlight volume 1
# Shorthand: 41 1 2
# Option: Replace Surface 1 with Surface 8
# Command: tweak surface 1 replace with surface 8
# Preview: tweak surface 1 replace with surface 8 preview
# Shorthand: 6 1 8
# Option: Replace Surface 8 with Surface 1
# Command: tweak surface 8 replace with surface 1
# Preview: tweak surface 8 replace with surface 1 preview
# Shorthand: 6 8 1
 @n type of volume_id_1:  int
Parameters
volume_id_1 ID of the first volume.
type of volume_id_2: int
volume_id_2 ID of the second volume.
type of maximum_gap_tolerance: float
maximum_gap_tolerance Maximum allowed gap before volumes are considered overlapping.
type of maximum_gap_angle: float
maximum_gap_angle Maximum allowed angular deviation at overlap regions.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and volume or surface IDs).

◆ get_solutions_for_sharp_angle_vertex()

def cubit.get_solutions_for_sharp_angle_vertex (   vertex_id,
  small_curve_size,
  mesh_size 
)

Retrieve recommended remedies for a sharp angle at a vertex.

.. code-block:: python

cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 5 height 10" )
cubit.cmd ("vol 2 mov z 10" )
cubit.cmd ("unite vol 1 2" )
small_curve_size = 0.25
mesh_size = 1.0
solutions = cubit.get_solutions_for_sharp_angle_vertex (12, small_curve_size, mesh_size)

for disp, cmd, prev, shrt in zip(solutions[0], solutions[1], solutions[2], solutions[3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Expected output (first 3 options shown, more options are returned):
# Option: Blunt Tangency at Vertex 12 Remove Material using Angle 15
# Command: blunt tangency vertex 12 remove_material angle 15
# Preview: blunt tangency vertex 12 remove_material angle 15 preview
# Shorthand: 12 12 0 1 15 -1
# Option: Blunt Tangency at Vertex 12 Add Material using Angle 15
# Command: blunt tangency vertex 12 angle 15
# Preview: blunt tangency vertex 12 angle 15 preview
# Shorthand: 12 12 0 0 15 -1
# Option: Blunt Tangency at Vertex 12 Remove Material using Angle 30
# Command: blunt tangency vertex 12 remove_material angle 30
# Preview: blunt tangency vertex 12 remove_material angle 30 preview
# Shorthand: 12 12 0 1 30 -1
# ...
# (Additional options omitted for brevity.)
 @n type of vertex_id:  int
Parameters
vertex_id ID of the vertex with the sharp angle being queried.
type of small_curve_size: float
small_curve_size Threshold that defines what is considered a "small" curve.
type of mesh_size: float
mesh_size Element size used for meshing, used to inform the solution.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display strings for each remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings, [3] Shorthand descriptions (operation ID and entity IDs) for reconstructing the operation.

◆ get_solutions_for_sheet_volume_connection()

def cubit.get_solutions_for_sheet_volume_connection (   args,
  kwargs 
)

Propose surface-tweak, imprint, and merge operations to bridge two sheet-volume sets.

Unlike get_solutions_for_sheet_volumes (single group), this function connects two distinct sheet-body sets by first merging within each set (if needed) and then suggesting tweaks, imprint, and merge steps between them. Sheets remain separate bodies to retain unique material assignments.

.. code-block:: python
import cubit
cubit.cmd ("reset" )
cubit.cmd ("brick x 10 y 1 z 10" )
cubit.cmd ("brick x 1 z 10 y 10" )
cubit.cmd ("vol 2 mov x 5.5" )
cubit.cmd ("reduce vol 1 thin copy surface 5 loft factor 0 thickness 1" )
cubit.cmd ("reduce vol 2 thin midsurface surface 10 12 loft factor 0.5 thickness 1" )
v1 = [3]; v2 = [4]
sols = cubit.get_solutions_for_sheet_volume_connection (v1, v2, 1.0, 1.0, "" , 0)
print("Option:" , sols[0][0])
print(" Command:" , sols[1][0])
print(" Preview:" , sols[2][0])
print(" Shorthand:" , sols[3][0])
# Expected output:
# Option: Tweak Curve 25 to Sheet 4 (Surface 14)
# Command: tweak curve 25 target surface 14;imprint volume 4 with curve 25;merge volume 4 3
# Preview: tweak curve 25 target surface 14 preview
# Shorthand: 38 25 14 0.5 0 0
 @n type of vol1_sheets:  std::vector< int,std::allocator< int > >
Parameters
vol1_sheets IDs of the first sheet-volume set (common parent).
type of vol2_sheets: std::vector< int,std::allocator< int > >
vol2_sheets IDs of the second sheet-volume set (common parent).
type of thickness1: float
thickness1 Thickness of sheets in vol1_sheets.
type of thickness2: float
thickness2 Thickness of sheets in vol2_sheets.
type of close_type: string, optional
close_type Optional entity type to focus near (e.g., "curve"). Default = "".
type of close_id: int, optional
close_id Optional ID of close_type entity. Default = 0.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display labels of each option, [1] Commands to execute each option, [2] Preview commands, [3] Shorthand strings for ML training.

◆ get_solutions_for_sheet_volumes()

def cubit.get_solutions_for_sheet_volumes (   vol_ids,
  thickness 
)

Propose surface-extension and imprint/merge operations to connect sheet bodies.

Analyze sheet-body volumes and suggest surface-tweak commands that extend surfaces to fill gaps between them, then propose imprint and merge operations. The sheets remain separate bodies to accommodate unique material assignments.

.. code-block:: python
cubit.cmd ("brick x 10 y 1 z 10" )
cubit.cmd ("brick x 1 z 10 y 10" )
cubit.cmd ("vol 2 mov x 5.5" )
cubit.cmd ("reduce vol 1 thin copy surface 5 loft factor 0 thickness 1" ) # -> sheet 3
cubit.cmd ("reduce vol 2 thin midsurface surface 10 12 loft factor 0.5 thickness 1" ) # -> sheet 4
vol_ids = [3, 4]
thickness = [1.0, 1.0]
solutions = cubit.get_solutions_for_sheet_volumes (vol_ids, thickness)

for disp, cmd, prev, shrt in zip(*solutions): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Expected output (only one option shown):
# Option: Tweak Curve 25 to Sheet 4 (Surface 14)
# Command: tweak curve 25 target surface 14;imprint volume 4 with curve 25;merge volume 4 3
# Preview: tweak curve 25 target surface 14 preview
# Shorthand: 38 25 14 0.5 0 0
 @n type of vol_ids:  std::vector< int,std::allocator< int > >
Parameters
vol_ids IDs of the sheet bodies to connect.
type of thickness: std::vector< double,std::allocator< double > >
thickness Corresponding thickness values for each sheet body.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display descriptions of each connection option, [1] Cubit commands to execute the extension, imprint and merge, [2] Cubit preview commands, [3] Shorthand strings (for ML training).

◆ get_solutions_for_small_curves()

def cubit.get_solutions_for_small_curves (   curve_id,
  small_curve_size,
  mesh_size 
)

Recommend remedial operations on a curve already flagged as small.

Operates on a curve marked small by small_curve_size and mesh_size, and suggests surface removals, surface-replacement tweaks, curve collapses to vertices, or topology rebuild operations.

.. code-block:: python
import cubit
cubit.cmd ("reset" )
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 0.1" )
cubit.cmd ("vol 2 mov x 5 y 5 z 5" )
cubit.cmd ("subtract vol 2 from vol 1" )
curve_id = 28
small_curve_size = 0.25
mesh_size = 1.0
curve_id, small_curve_size, mesh_size)

for disp, cmd, prev, shrt in zip(*solutions)[:3]: print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Expected output (first three of many):
# Option: Remove Surface 13
# Command: remove surface 13 extend
# Preview: remove surface 13 extend preview
# Shorthand: 5 13
# Option: Remove Surface 16
# Command: remove surface 16 extend
# Preview: remove surface 16 extend preview
# Shorthand: 5 16
# Option: Replace Surface 18 with Surface 14
# Command: tweak surface 18 replace with surface 14
# Preview: tweak surface 18 replace with surface 14 preview
# Shorthand: 6 18 14
# ...and more options
 @n type of curve_id:  int
Parameters
curve_id ID of the small curve.
type of small_curve_size: float
small_curve_size Curve-length threshold defining "small" features.
type of mesh_size: float
mesh_size Target mesh element size for context.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display labels, [1] Cubit commands, [2] Preview commands, [3] Shorthand strings for ML training.

◆ get_solutions_for_small_surfaces()

def cubit.get_solutions_for_small_surfaces (   surface_id,
  small_curve_size,
  mesh_size 
)

Recommend remedial operations on a surface already flagged as small.

Operates on a surface marked small by small_curve_size and mesh_size, and suggests composite merges, topology rebuilds, surface removals, or surface-replacement tweaks.

.. code-block:: python
import cubit
cubit.cmd ("reset" )
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 0.1" )
cubit.cmd ("vol 2 mov x 5 y 5 z 5" )
cubit.cmd ("subtract vol 2 from vol 1" )
surface_id = 13
surface_id, 0.25, 1.0)

for disp, cmd, prev, shrt in zip(*solutions)[:3]: print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# ...and more options
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to remediate.
type of small_curve_size: float
small_curve_size Threshold under which curves are deemed small.
type of mesh_size: float
mesh_size Target mesh element size for context.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
Vector of four string vectors: [0] Display labels, [1] Execution commands, [2] Preview commands, [3] Shorthand strings for ML training.

◆ get_solutions_for_surfaces_with_narrow_regions()

def cubit.get_solutions_for_surfaces_with_narrow_regions (   surface_id,
  small_curve_size,
  mesh_size 
)

Recommend operations to eliminate narrow regions on a surface identified as narrow.

Analyzes a surface with narrow regions and suggests operations.


type of surface_id: int

Parameters
surface_id ID of the surface to analyze.
type of small_curve_size: float
small_curve_size Length threshold defining narrow regions.
type of mesh_size: float
mesh_size Target mesh element size for context.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of three string vectors: [0] Display descriptions for each solution, [1] Cubit command strings to execute solutions, [2] Cubit preview command strings. (In Python, returned as a tuple of lists.)

◆ get_solutions_for_thin_volume()

def cubit.get_solutions_for_thin_volume (   vol_id,
  near_vols,
  include_weights = False,
  include_type = False 
)

Generate candidate operations to reduce a thin volume into a sheet body.

Suggest copying or midsurfacing operations (with optional weights/types) to reduce a volume to a shell.

.. code-block:: python
cubit.cmd ("brick x 10 y 1 z 10" )
cubit.cmd ("brick x 1 y 10 z 10" )
cubit.cmd ("move volume 2 by x 4.5 y 4.5" )
cubit.cmd ("unite volume all" )
vol_id = 1
near_vols = []
solutions = cubit.get_solutions_for_thin_volume (vol_id, near_vols)

for disp, cmd, prev, shrt in zip(*solutions[:3]): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
print("...and more options available" )
# Expected output for first three options:
# Option: Copy Surfaces 13 15
# Command: reduce volume 1 thin copy surface 13 15 loft factor 0 0 thickness 1 1
# Preview: reduce volume 1 thin copy surface 13 15 loft factor 0 0 thickness 1 1 preview
# Shorthand: 17 1 13 2 13 0 1 15 0 1
# Option: Copy Surfaces 6 17
# Command: reduce volume 1 thin copy surface 6 17 loft factor 0 0 thickness 1 1
# Preview: reduce volume 1 thin copy surface 6 17 loft factor 0 0 thickness 1 1 preview
# Shorthand: 17 1 6 2 6 0 1 17 0 1
# Option: Copy Surface 15
# Command: reduce volume 1 thin copy surface 15 loft factor 0 thickness 1
# Preview: reduce volume 1 thin copy surface 15 loft factor 0 thickness 1 preview
# Shorthand: 17 1 15 1 15 0 1
# ...and more options
 @n type of vol_id:  int
Parameters
vol_id ID of the thin volume to convert to a sheet.
type of near_vols: std::vector< int,std::allocator< int > >
near_vols List of neighboring volume IDs to limit influence; empty uses all.
type of include_weights: boolean, optional
include_weights If true, prepend each operation string with heuristic weight (1=best ... 0=worst).
type of include_type: boolean, optional
include_type If true, include connection type code (long_long=4, continuous=3, midsurface=2, copy=1).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display labels for each candidate operation, [1] Cubit commands to perform each operation, [2] Cubit preview commands, [3] Shorthand strings encoding type, vol, surfaces, factors, etc. (In Python this returns as a tuple of lists.)

◆ get_solutions_for_volumes()

def cubit.get_solutions_for_volumes (   vol_id,
  small_curve_size,
  mesh_size 
)

Recommend remediation operations for volumes with features below a size threshold.

Analyze a given volume to find curves smaller than a user-specified threshold and suggest operations to eliminate those features before meshing.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 0.1" )
vol = 2
small_curve_size = 0.25
mesh_size = 1.0
solutions = cubit.get_solutions_for_volumes (vol, small_curve_size, mesh_size)

for disp, cmd, prev, shrt in zip(*solutions): print("Option:", disp)

print(" Command:" , cmd)
print(" Preview:" , prev)
print(" Shorthand:" , shrt)
# Expected output:
# Option: Delete Volume 2
# Command: delete volume 2
# Preview: highlight volume 2
# Shorthand: 40 2 0
 @n type of vol_id:  int
Parameters
vol_id ID of the volume to inspect.
type of small_curve_size: float
small_curve_size Maximum curve length considered "small".
type of mesh_size: float
mesh_size Target mesh element size for the volume.
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four string vectors: [0] Display labels for each remedy option, [1] Cubit commands to execute each remedy, [2] Cubit preview commands, [3] Shorthand operation strings for ML training.

◆ get_source_surfaces()

def cubit.get_source_surfaces (   volume_id )

Retrieve the list of sweep source surfaces for a specified volume.

When a volume uses the Sweep scheme, source surfaces are the starting faces from which the hexahedral mesh is extruded. This function returns all surface IDs designated as sources. If no explicit source was set, returns an empty list.

.. code-block:: python
# 1) Create a brick (Volume ID = 1).
cubit.cmd ("brick x 10" ) # Volume ID = 1
# 2) Specify surface 2 as the source and surface 5 as the target for sweeping.
cubit.cmd ("vol 1 scheme sweep source surf 2 target surf 5" )
# 3) Query the source surfaces for volume 1.
# Expected output: (2,)
print("Source surfaces:" , sources)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector<int> or Python tuple) of surface IDs designated as sweep sources.

◆ get_sphere_count()

def cubit.get_sphere_count ( )

Retrieve the count of sphere elements in the current model.

Sphere elements are nodes whose element type has been set to "sphere".

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol all" )
cubit.cmd ("block 1 node all" )
cubit.cmd ("block 1 element type sphere" )
sphere_count = cubit.get_sphere_count ()
print("Sphere count:" , sphere_count)
 @n return type of :  int
Returns
Number of sphere elements (nodes flagged as "sphere") in the current model.

◆ get_sphere_global_element_id()

def cubit.get_sphere_global_element_id (   sphere_id )

Get the Global Element ID for a specific node (SPHERE element).

Cubit assigns a Global Element ID to each mesh entity when it is placed into a block. Nodes are represented as SPHERE elements in the mesh. This function returns the Global Element ID corresponding to the given local sphere (node) ID within its type-specific ID space.

.. code-block:: python
# Create and mesh a brick volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Assign all vertices (nodes) in volume 1 to block 1
cubit.cmd ("block 1 vertex in vol 1" )
# Query the Global Element ID of local node 1
print("Global ID of node 1:" , gid) # prints 1
 @n type of sphere_id:  int
Parameters
sphere_id Local node (SPHERE) ID within its type-specific ID space.
return type of : int
Returns
Global Element ID for the specified node, or 0 if not placed into a block.

◆ get_string_sculpt_default()

def cubit.get_string_sculpt_default (   variable )

Retrieve default string-valued sculpt parameter.

Matches the input variable name substring to known sculpt parameters and returns its default.

Title Available string parameters

  • ROOT_FILE
  • QUALITY_FILE
  • VOLFRAC_FILE


type of variable: string

Parameters
variable Name of the sculpt parameter substring.
return type of : string
Returns
Default string value for the specified parameter.

◆ get_sub_elements()

def cubit.get_sub_elements (   entity_type,
  entity_id,
  dimension 
)

Get the lower-dimensional entities of a higher-dimensional mesh element.

This function returns the IDs of all sub-entities of the specified dimension for a given mesh element. For example, to get all faces (dimension 2) of a hexahedron, or all edges (dimension 1) of a triangle.

Notes Faces and edges are only created on surfaces and curves, respectively. Interior faces or edges within volumes are not generated. In the example below, only three faces appear because they lie on the exterior surfaces of volume 1.

.. code-block:: python
# Create and mesh a brick volume
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
# Query the exterior faces (dimension 2) of hex element 1
faces = cubit.get_sub_elements ("hex" , 1, 2)
print("Hex 1 has faces:" , faces) # e.g. (391, 201, 91)
 @n type of entity_type:  string
Parameters
entity_type Mesh element type of the higher-dimensional entity (e.g., "hex", "tet", "tri", "quad").
type of entity_id: int
entity_id ID of the mesh element.
type of dimension: int
dimension Dimension of sub-entities to retrieve: 0 = vertices, 1 = edges, 2 = faces, 3 = volumes.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of IDs of the requested sub-entities (Python tuple in Python API).

◆ get_submap_corner_types()

def cubit.get_submap_corner_types (   surface_id )

Get a list of vertex IDs and their corner-type codes for a surface submap.

Vertex types classify each corner based on how many mesh elements meet there:

  • -1 unknown : not classified or not applicable
  • 1 end : interior angle ~ 90deg (one element)
  • 2 side : interior angle ~ 180deg (two elements)
  • 3 corner : interior angle ~ 270deg (three elements)
  • 4 reverse : interior angle ~ 360deg (four elements)
  • 5 triangle corner : corner of a triangular mesh element
  • 6 non-triangle : corner of a non-triangular mesh element


type of surface_id: int

Parameters
surface_id ID of the surface to query.
return type of : std::vector< std::pair< int,int >,std::allocator< std:: pair< int,int > > >
Returns
Vector of <vertex_id, corner_type> pairs for each corner.

◆ get_surface_area()

def cubit.get_surface_area (   surface_id )

Get the area of a specified surface.

.. code-block:: python

# Create a 10x10x10 brick centered at the origin; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
area = cubit.get_surface_area (1) # top face area = 100
print("Surface 1 area:" , area) # prints 100
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : float
Returns
The area of the specified surface.

◆ get_surface_cavity_collections()

def cubit.get_surface_cavity_collections (   volume_list,
  area_threshold = -1,
  angle_tolerance = -1,
  combine_cavities = True 
)

Return collections of surfaces that form cavities in the specified volumes.

A cavity is a collection of contiguous surfaces, bounded by curves where the exterior angle is greater than or equal to (180 - angle_tolerance). Cavities are filtered by their total surface area.

If combine_cavities is true, small adjacent cavities are merged after initial cavity detection.

If area_threshold < 0.0, all cavities are returned. If angle_tolerance < 0.0, a default of 0.01 degrees is used.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
cubit.cmd ("vol 5 move x 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
volume_ids = [1]
area_thresh = -1.0 # return all cavities
angle_tol_deg = 0.1
combine = False
cavity_collections = cubit.get_surface_cavity_collections (volume_ids, area_thresh, angle_tol_deg, combine)

for surfaces, area in cavity_collections: print("Cavity surfaces:", tuple(surfaces), "Area:", area)

# Expected output:
# Cavity surfaces: (17, 15, 16, 13, 14), Area: <value>
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of area_threshold: float, optional
area_threshold Return cavities whose total surface area is less than this value. If less than 0.0, return all cavities.
type of angle_tolerance: float, optional
angle_tolerance Bounding curves will have an exterior angle greater than or equal to (180 - angle_tolerance). If less than 0.0, default is 0.01 degrees.
type of combine_cavities: boolean, optional
combine_cavities If true, small adjacent cavities are combined after initial cavity detection.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
: Ordered list of pairs each pair contains (1) a list of contiguous surface IDs defining a cavity, and (2) the total surface area of that cavity (ordered from smallest to largest area).

◆ get_surface_centroid()

def cubit.get_surface_centroid (   surface_id )

Get the approximate centroid of a specified surface based on graphics faceting.

The centroid is computed from the faceted representation of the surface, so it is an approximation.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create a 10x10x10 brick centered at origin
print(centroid) # expected: (0.0, 0.0, 5.0)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : std:: array< double,3 >
Returns
A 3-element array [x, y, z] representing the approximate surface centroid.

◆ get_surface_cone_collections()

def cubit.get_surface_cone_collections (   volume_list,
  radius_threshold = 0.0 
)

Identify collections of surfaces that comprise cones in specified volumes.

Cones may be represented by a single surface or by two adjacent surfaces symmetrically split. Results can be filtered by a maximum cone radius.

.. code-block:: python
# Create a cylinder volume with a cone on top.
cubit.cmd ('cylinder rad 1 height 5' ) # Create cylinder
cubit.cmd ('create frustum height 1 radius 1 top 0' ) # Create cone (frustum with top radius 0)
cubit.cmd ('vol 2 mov z 3' ) # Move cone on top of cylinder
cubit.cmd ('unite vol all' ) # Unite volumes into one
cubit.cmd ('split period vol 1' ) # Split cylinder and cone surfaces
cone_collections = cubit.get_surface_cone_collections ([1], 0.0)
print("Cone collections:" )

for surfaces, radius in cone_collections: print(f"Radius: {radius}, Surfaces:", [int(sid) for sid in surfaces])

# Expected output:
# Radius: <value>, Surfaces: [surface ids of cone faces]
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of radius_threshold: float, optional
radius_threshold Optional maximum radius. Return cones with computed radius less than or equal to radius_threshold. If 0, all cone collections are returned.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
A list of (surface ID list, radius) pairs. Each pair corresponds to one cone collection. Surfaces are grouped per individual cone.

◆ get_surface_count()

def cubit.get_surface_count ( )

Get the current number of surfaces in the model.

.. code-block:: python

# Create a 10x10x10 brick; this generates six surfaces.
cubit.cmd ("brick x 10" )
surf_count = cubit.get_surface_count () # returns 6
print("Surface count:" , surf_count)
 @n return type of :  int
Returns
The number of surfaces currently defined in the model.

◆ get_surface_element_count()

def cubit.get_surface_element_count (   surface_id )

Retrieve the count of elements on a specified surface.

Returns the total number of quadrilateral and triangular elements present on the given surface, regardless of block assignments.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("mesh vol 1" ) # mesh volume 1 (surface faces become quads or tris)
print("Surface 1 elements:" , surf_count)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : int
Returns
Number of quadrilateral and triangular elements on that surface.

◆ get_surface_hole_collections()

def cubit.get_surface_hole_collections (   volume_list,
  radius_threshold 
)

Return collections of surfaces that form holes in the specified volumes.

A hole is a collection of contiguous surfaces that form a cylindrical or approximately cylindrical feature. Holes are filtered by their computed radius.

If radius_threshold is provided, only holes with radius less than or equal to this value are returned.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 1 height 10" )
cubit.cmd ("vol 2 move z 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
volume_ids = [1]
radius_thresh = 2.0
hole_collections = cubit.get_surface_hole_collections (volume_ids, radius_thresh)

for surfaces, radius in hole_collections: print("Hole surfaces:", tuple(surfaces), "Radius:", radius)

# Expected output:
# Hole surfaces: (10, 11), Radius: 1.0
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to query.
type of radius_threshold: float
radius_threshold Return holes with computed radius less than or equal to this value.
return type of : std::vector< std::pair< std::vector< int,std::allocator< int > >,double >,std::allocator< std::pair< std::vector< int,std:: allocator< int > >,double > > >
Returns
: A list of pairs each pair contains (1) a list of contiguous surface IDs defining a hole, and (2) the computed radius of the hole.

◆ get_surface_loop_nodes()

def cubit.get_surface_loop_nodes (   surface_id )

Get the ordered list of node IDs on the loops of a surface.

This function returns the ordered list of node IDs for each loop on the specified surface. The first loop in the list is the external loop. Each loop is returned as a separate list of node IDs.

Loops are ordered as follows:

  • First list: external loop (outer boundary)
  • Subsequent lists: internal loops (holes, if present)
.. code-block:: python
# Create a brick and subtract a cylinder to create an internal loop
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 3 height 10" )
cubit.cmd ("subtract vol 2 from vol 1" )
# Mesh the curves to ensure nodes exist on loops
cubit.cmd ("mesh curve in vol 1" )
# Query the nodes on the loops of surface 1
loop_nodes = cubit.get_surface_loop_nodes (1)
print(f"Surface 1 has {len(loop_nodes)} loop(s)." )

for i, loop in enumerate(loop_nodes): print(f" Loop {i+1} has {len(loop)} node(s):", " ".join(str(node_id) for node_id in loop))

  @n type of surface_id:  int
Parameters
surface_id ID of the surface.
return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
List of lists of node IDs, one list per loop (first list is the external loop).

◆ get_surface_nodes()

def cubit.get_surface_nodes (   surface_id )

Get the list of node IDs owned by a surface.

This function returns the IDs of nodes owned by the specified surface. Nodes on the bounding curves and vertices of the surface are excluded.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the nodes on surface 5
surface_nodes = cubit.get_surface_nodes (5)
print(f"Surface 5 owns {len(surface_nodes)} node(s)." )

for node_id in surface_nodes: print(f" Node ID: {node_id}")

  @n type of surface_id:  int
Parameters
surface_id ID of the surface.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs owned by the surface (excluding nodes on bounding curves and vertices).

◆ get_surface_normal()

def cubit.get_surface_normal (   surface_id )

Get the unit normal vector at the center of a specified surface.

.. code-block:: python

# Create a 10x10x10 brick; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
# Measure the normal for surface 1 (the top face).
print("Normal:" , normal) # Expected output: (0.0, 0.0, 1.0)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : std:: array< double,3 >
Returns
A 3-element array [nx, ny, nz] representing the unit normal at the surface center.

◆ get_surface_normal_at_coord()

def cubit.get_surface_normal_at_coord (   surface_id,
  coord 
)

Get the unit normal vector at a specified point on a surface.

.. code-block:: python

# Create a 10x10x10 brick centered at the origin; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
# Pick a point at the center of surface 1: (0, 0, 5).
coord = (0.0, 0.0, 5.0)
normal = cubit.get_surface_normal_at_coord (1, coord)
print("Normal:" , normal) # Expected output: (0.0, 0.0, 1.0)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
type of coord: std::array< double,3 >
coord A 3-element array {x, y, z} representing a point on the surface.
return type of : std:: array< double,3 >
Returns
A 3-element array [nx, ny, nz] representing the unit normal at coord.

◆ get_surface_num_loops()

def cubit.get_surface_num_loops (   surface_id )

Get the number of loops on a surface.

This function returns the number of loops on the specified surface. A loop is a closed boundary on the surface. Surfaces with holes or internal boundaries will have multiple loops.

.. code-block:: python
# Create a brick and subtract a cylinder to create an internal loop
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 3 height 12" )
cubit.cmd ("subtract vol 2 from vol 1" )
# Query the number of loops on surface 1
num_loops = cubit.get_surface_num_loops (1)
print(f"Surface 1 has {num_loops} loop(s)." )
 @n type of surface_id:  int
Parameters
surface_id ID of the surface.
return type of : int
Returns
Number of loops on the surface.

◆ get_surface_principal_curvatures()

def cubit.get_surface_principal_curvatures (   surface_id )

Get the principal curvatures of a surface at its midpoint.

Principal curvatures quantify how a surface bends in two orthogonal directions at a point. At the surface midpoint, this function returns two scalar values: k1 and k2. For a planar surface, both values are 0. For a sphere of radius R, both values equal 1/R.

.. code-block:: python
# Create a sphere of radius 2; surface 1 is the spherical face.
cubit.cmd ("sphere rad 2" )
print("Principal curvatures:" , curvatures) # prints (0.5, 0.5)
# Create a planar brick face; surface 1 is planar.
cubit.cmd ("brick x 10" )
print("Principal curvatures:" , curvatures) # prints (0.0, 0.0)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : std::vector< double,std:: allocator< double > >
Returns
: A vector of two doubles the first and second principal curvatures at the surface midpoint.

◆ get_surface_quads()

def cubit.get_surface_quads (   surface_id )

Get the list of quadrilateral (quad) element IDs on a surface.

This function returns the IDs of all quadrilateral (quad) elements on the specified surface.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the quads on surface 1
quad_ids = cubit.get_surface_quads (1)
print(f"Surface 1 contains {len(quad_ids)} quad(s)." )

for quad_id in quad_ids: print(f" Quad ID: {quad_id}")

  @n type of surface_id:  int
Parameters
surface_id ID of the surface.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of quadrilateral (quad) element IDs on the surface.

◆ get_surface_sense()

def cubit.get_surface_sense (   surface_id )

Get the orientation ("sense") of a specified surface.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create a 10x10x10 brick
sense = cubit.get_surface_sense (1) # e.g., "Forward"
print("Surface 1 sense:" , sense)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : string
Returns
: The surface sense "Reversed", "Forward", or "Both".

◆ get_surface_tris()

def cubit.get_surface_tris (   surface_id )

Get the list of triangle (tri) element IDs on a surface.

This function returns the IDs of all triangle (tri) elements on the specified surface.

.. code-block:: python
# Create a brick, apply tetmesh scheme, and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Query the tris on surface 1
tri_ids = cubit.get_surface_tris (1)
print(f"Surface 1 contains {len(tri_ids)} tri(s)." )

for tri_id in tri_ids: print(f" Tri ID: {tri_id}")

  @n type of surface_id:  int
Parameters
surface_id ID of the surface.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of triangle (tri) element IDs on the surface.

◆ get_surface_type()

def cubit.get_surface_type (   surface_id )

Get the surface type for a specified surface.

Title Available surface types

  • cone surface
  • plane surface
  • sphere surface
  • spline surface
  • torus surface
  • best fit surface
  • facet surface
  • undefined surface type
.. code-block:: python
# Assume surface ID 5 corresponds to a plane.
surf_type = cubit.get_surface_type (5)
print("Surface 5 is a:" , surf_type) # Output: Surface 5 is a: plane surface
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : string
Returns
Descriptive string indicating the surface's geometry type.

◆ get_surfs_with_narrow_regions()

def cubit.get_surfs_with_narrow_regions (   target_ids,
  narrow_size 
)

Find surfaces with narrow regions based on edge-pair orientation and proximity.

For each face of volumes in target_ids, iterates over every pair of non-adjacent edges. For each pair:

  • Computes the shortest distance between edges.
  • If distance <= narrow_size, computes local edge tangents and surface normals to form cross-product vectors.
  • If the dot product of those cross-product vectors is < -cos(15deg), the face is included. Returns IDs of faces where any such qualifying edge pair exists.

This function differs from get_closed_narrow_surfaces by checking all faces (not only closed two-loop faces), and from get_narrow_regions by requiring an oriented edge-pair test rather than loop-split or loop-proximity tests.

.. code-block:: python
cubit.cmd ("cylinder radius 3 height 10" )
cubit.cmd ("modify curve 1 blend radius 0.5" )
cubit.cmd ("cylinder radius 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
narrow_thresh = 1.0
oriented_narrow = cubit.get_surfs_with_narrow_regions ([1], narrow_thresh)
print(oriented_narrow)
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_ids Vector of volume IDs to examine.
type of narrow_size: float
narrow_size Distance threshold for detecting narrow edge pairs with orientation checks.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of surface IDs containing at least one narrow edge-pair region.

◆ get_tangential_intersections()

def cubit.get_tangential_intersections (   target_volume_ids,
  upper_bound,
  lower_bound 
)

Find surfaces with tangential intersection angles outside specified bounds.

Iterates over all faces of volumes in target_volume_ids. For each face, computes any tangential intersection angles between adjacent faces. A surface is included if any angle is < lower_bound or > upper_bound.


type of target_volume_ids: std::vector< int,std::allocator< int > >

Parameters
target_volume_ids Vector of volume IDs to examine.
type of upper_bound: float
upper_bound Upper threshold for acceptable tangential angle.
type of lower_bound: float
lower_bound Lower threshold for acceptable tangential angle.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of surface IDs having any tangential intersection angle < lower_bound or > upper_bound.

◆ get_target_surfaces()

def cubit.get_target_surfaces (   volume_id )

Retrieve the list of sweep target surfaces for a specified volume.

When a volume uses the Sweep scheme, target surfaces are the ending faces to which the hexahedral mesh is extruded. This function returns all surface IDs designated as targets. If no explicit target was set, returns an empty list.

.. code-block:: python
# 1) Create a brick (Volume ID = 1).
cubit.cmd ("brick x 10" ) # Volume ID = 1
# 2) Specify surface 2 as the source and surface 5 as the target for sweeping.
cubit.cmd ("vol 1 scheme sweep source surf 2 target surf 5" )
# 3) Query the target surfaces for volume 1.
# Expected output: (5,)
print("Target surfaces:" , targets)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : std::vector< int,std:: allocator< int > >
Returns
A list (vector<int> or Python tuple) of surface IDs designated as sweep targets.

◆ get_target_timestep()

def cubit.get_target_timestep ( )

Return the current target time step threshold used in the density multiplier metric.

This threshold influences adaptive time stepping by multiplying element-based estimates.

.. code-block:: python
# Set the target time step via Cubit command and query it.
cubit.cmd ("set target timestep 0.005" )
print("Target time step:" , target) # prints 0.005
 @n return type of :  float
Returns
The currently configured target time step threshold.

◆ get_tet_count()

def cubit.get_tet_count ( )

Retrieve the count of tetrahedral elements in the current model.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
tet_count = cubit.get_tet_count ()
print("Tet count:" , tet_count)
 @n return type of :  int
Returns
Number of tetrahedral elements in the current model.

◆ get_tet_global_element_id()

def cubit.get_tet_global_element_id (   tet_id )

Get the Global Element ID for a specific tetrahedral element.

This function returns the Global Element ID assigned to the given local tet ID when the element was placed into a block.

.. code-block:: python
# Create a brick, set up tetmesh, and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Assign all tets in volume 1 to block 1 (establishes global IDs)
cubit.cmd ("block 1 tet all" )
# Query the Global Element ID of local tet 22
print("Global Element ID of tet 22:" , gid)
 @n type of tet_id:  int
Parameters
tet_id Local tetrahedral element ID.
return type of : int
Returns
Global Element ID for the specified tetrahedron, or 0 if the tet is not in a block.

◆ get_tetmesh_growth_factor()

def cubit.get_tetmesh_growth_factor (   volume_id )

Get the growth factor for tet meshing on a volume.

The growth factor controls how quickly tetrahedral sizes can change when transitioning from small to larger elements within the volume. Valid values range from 1.0 (uniform sizing) to 10.0 (rapid growth).

.. code-block:: python
# 1) Set growth factor to 1.3 on volume 5.
cubit.cmd ("volume 5 scheme tetmesh growth_factor 1.3" )
# 2) Query the growth factor.
print(f"Volume 5 tetmesh growth factor: {gf}" ) # Expected: 1.3
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : float
Returns
Growth factor (double) currently set on the volume.

◆ get_tetmesh_insert_mid_nodes()

def cubit.get_tetmesh_insert_mid_nodes ( )

Get the global flag indicating insertion of mid-edge (quadratic) nodes during tet meshing.

Returns true if the tet mesher is configured to create mid-edge nodes while generating tets (improves quadratic element quality); false if midnodes are inserted post-meshing.

.. code-block:: python
# 1) Enable automatic insertion of mid-edge nodes.
cubit.cmd ("set tetmesher add mid_edge_nodes on" )
# 2) Query the mid-edge node insertion flag.
print(f"Insert mid-edge nodes during tet meshing? {mid_node_on}" )
 @n return type of :  boolean
Returns
True if mid-edge nodes are inserted during meshing; false otherwise.

◆ get_tetmesh_minimize_interior_points()

def cubit.get_tetmesh_minimize_interior_points ( )

Get the global flag indicating minimization of interior points in tet meshing.

Returns true if the tet mesher will attempt to reduce the number of interior nodes inserted; false if interior point insertion is unrestricted. Disabling interior point insertion may produce a mesh with fewer nodes but can fail in complex geometries.

.. code-block:: python
# 1) Disable interior point insertion.
cubit.cmd ("set tetmesher interior points off" )
# 2) Query the interior point minimization flag.
print(f"Minimize interior points? {min_interior}" )
 @n return type of :  boolean
Returns
True if minimizing interior points is ON; false otherwise.

◆ get_tetmesh_minimize_slivers()

def cubit.get_tetmesh_minimize_slivers ( )

Get the global flag indicating minimization of sliver tetrahedra.

Returns true if the tet mesher will apply additional processing to identify and remove sliver-shaped tetrahedra (minimize slivers); false if sliver removal is not explicitly requested.

.. code-block:: python
# 1) Enable sliver minimization.
cubit.cmd ("set tetmesher optimize sliver on" )
# 2) Query the sliver minimization flag.
print(f"Minimize sliver tetrahedra? {min_sliver}" )
 @n return type of :  boolean
Returns
True if sliver minimization is ON; false otherwise.

◆ get_tetmesh_num_anisotropic_layers()

def cubit.get_tetmesh_num_anisotropic_layers ( )

Get the global number of anisotropic tet layers setting.

Returns how many anisotropic layers the tet mesher will attempt to place in thin regions. If this global setting is zero, anisotropic layering is disabled.

.. code-block:: python
# 1) Enable 2 anisotropic layers globally.
cubit.cmd ("set tetmesher anisotropic layers 2" )
# 2) Query the number of anisotropic layers.
print(f"Global anisotropic tet layers: {num_aniso}" ) # Expected: 2
 @n return type of :  int
Returns
Number of anisotropic layers (integer); 0 if disabled.

◆ get_tetmesh_optimization_level()

def cubit.get_tetmesh_optimization_level ( )

Get the global tet meshing optimization level.

Returns the integer optimization level in use for the tet mesher, ranging from 0 (none) to 6 (extreme). Higher levels yield better element quality at the expense of runtime.

.. code-block:: python
# 1) Set tet mesher optimization level to 4 (strong).
cubit.cmd ("set tetmesher optimize level 4" )
# 2) Query the optimization level.
print(f"Tet mesher optimization level: {opt_level}" ) # Expected: 4
 @n return type of :  int
Returns
Optimization level (int in [0..6]).

◆ get_tetmesh_optimize_mid_nodes()

def cubit.get_tetmesh_optimize_mid_nodes ( )

Get the global flag indicating optimization of mid-edge nodes during tet meshing.

Returns true if the tet mesher is configured to optimize (adjust) mid-edge node positions during meshing to improve element quality; false if no midnode optimization is performed.

.. code-block:: python
# 1) Enable mid-edge node optimization.
cubit.cmd ("set tetmesher optimize surface mid_edge_nodes on" )
# 2) Query the mid-edge node optimization flag.
print(f"Optimize mid-edge nodes during tet meshing? {opt_mid_on}" )
 @n return type of :  boolean
Returns
True if mid-edge node optimization is ON; false otherwise.

◆ get_tetmesh_optimize_overconstrained_edges()

def cubit.get_tetmesh_optimize_overconstrained_edges ( )

Get the global flag indicating optimization of overconstrained edges.

Returns true if the tet mesher will split edges that connect two surface nodes but do not lie on the surface ("overconstrained edges"); false if not.

.. code-block:: python
# 1) Enable optimization of overconstrained edges.
cubit.cmd ("set tetmesher optimize overconstrained edges on" )
# 2) Query the overconstrained edges optimization flag.
print(f"Optimize overconstrained edges? {opt_over_edge}" )
 @n return type of :  boolean
Returns
True if overconstrained edges optimization is ON; false otherwise.

◆ get_tetmesh_optimize_overconstrained_tets()

def cubit.get_tetmesh_optimize_overconstrained_tets ( )

Get the global flag indicating optimization of overconstrained tetrahedra.

Returns true if the tet mesher will optimize any tetrahedra that have more than one triangular face on the same geometric surface (removes "overconstrained" tets); false if not.

.. code-block:: python
# 1) Enable optimization of overconstrained tetrahedra.
cubit.cmd ("set tetmesher optimize overconstrained tetrahedra on" )
# 2) Query the overconstrained tetrahedra optimization flag.
print(f"Optimize overconstrained tets? {opt_over_tet}" )
 @n return type of :  boolean
Returns
True if overconstrained tetrahedra optimization is ON; false otherwise.

◆ get_tetmesh_parallel()

def cubit.get_tetmesh_parallel ( )

Get the global parallel-tetmesher flag (HPC) setting.

Returns true if the MeshGems-Tetra HPC (parallel) tet mesher is enabled globally; false if using the older serial tet mesher. This setting applies to all subsequent tet meshes until changed.

.. code-block:: python
# 1) Enable parallel tet mesher globally.
cubit.cmd ("set tetmesher hpc on threads 4" )
# 2) Query the parallel flag.
parallel_on = cubit.get_tetmesh_parallel ()
print(f"Parallel tet mesher enabled? {parallel_on}" )
 @n return type of :  boolean
Returns
True if parallel (HPC) tet mesher is ON; false if OFF.

◆ get_tetmesh_proximity_flag()

def cubit.get_tetmesh_proximity_flag (   volume_id )

Get the proximity-layer flag for tet meshing on a volume.

Returns whether proximity layers are enabled for the specified volume. When enabled, the tet mesher will insert a minimum number of tetrahedral layers in thin regions to capture physical features.

.. code-block:: python
# 1) Enable proximity layers (e.g., 3 layers) on volume 5.
cubit.cmd ("volume 5 scheme tetmesh proximity layers 3" )
# 2) Query the proximity flag.
print(f"Proximity layers enabled for volume 5? {prox_on}" )
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : boolean
Returns
True if proximity layers are ON; false if OFF.

◆ get_tetmesh_proximity_layers()

def cubit.get_tetmesh_proximity_layers (   volume_id )

Get the number of proximity layers for tet meshing on a volume.

Returns the integer number of tetrahedral layers configured for thin regions. Only valid if proximity is enabled; otherwise, returns zero.

.. code-block:: python
# 1) Enable 4 proximity layers on volume 5.
cubit.cmd ("volume 5 scheme tetmesh proximity layers 4" )
# 2) Query the number of proximity layers.
print(f"Volume 5 proximity layers: {num_layers}" ) # Expected: 4
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : int
Returns
Number of proximity layers (integer); 0 if proximity is OFF.

◆ get_tetmesh_relax_surface_constraints()

def cubit.get_tetmesh_relax_surface_constraints ( )

Get the global flag indicating relaxation of surface mesh constraints in tet meshing.

Returns true if the tet mesher is configured to relax surface mesh conformity constraints, allowing insertion of tetrahedra that may deviate slightly from the exact surface mesh; false otherwise.

.. code-block:: python
# 1) Enable relaxing of surface constraints.
cubit.cmd ("set tetmesher boundary recovery on" )
# 2) Query the relax surface constraints flag.
print(f"Relax surface constraints? {relax_surf}" )
 @n return type of :  boolean
Returns
True if relaxing surface constraints is ON; false otherwise.

◆ get_tight_bounding_box()

def cubit.get_tight_bounding_box (   geometry_type,
  entity_list 
)

Get the tight bounding box for a list of entities.

Computes an oriented (tight) bounding box for the specified entities. The box is aligned with the principal axes of the geometry, not the global axes. This provides a minimal-volume bounding box that follows the geometry's orientation.

Title Array contents

  • [0-2] center coordinates (x, y, z)
  • [3-5] U-axis (normalized) vector (x, y, z)
  • [6-8] V-axis (normalized) vector (x, y, z)
  • [9-11] W-axis (normalized) vector (x, y, z)
  • [12-14] lengths along U, V, W axes
.. code-block:: python
cubit.cmd ("brick x 10" ); cubit.cmd ("rotate volume 1 angle 45 about z" )
bbox = cubit.get_tight_bounding_box ("volume" , [1])
print("Center:" , bbox[0:3], "U-axis:" , bbox[3:6], "V-axis:" , bbox[6:9],
"W-axis:" , bbox[9:12], "Lengths:" , bbox[12:15])
# Expected output: Center: (0.0, 0.0, 0.0) ... Lengths: (5.0, 5.0, 5.0)
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("body", "volume", "surface", "curve", or "vertex").
type of entity_list: std::vector< int,std::allocator< int > >
entity_list List of entity IDs.
return type of : std:: array< double,15 >
Returns
15-element array representing the tight bounding box.

◆ get_top_level_assembly_items()

def cubit.get_top_level_assembly_items ( )

◆ get_total_bounding_box()

def cubit.get_total_bounding_box (   geometry_type,
  entity_list 
)

Get the combined bounding box for a list of entities.

.. code-block:: python

# Prepare a list of surface IDs.
entity_list = [22, 23, 24]
# Query the total bounding box for those surfaces.
bbox = cubit.get_total_bounding_box ("surface" , entity_list)
print(bbox) # Prints 10 values: x-min, x-max, x-range, y-min, y-max, y-range, z-min, z-max, z-range, diagonal
 @n type of geometry_type:  string
Parameters
geometry_type Specifies the geometry type ("body", "volume", "surface", "curve", or "vertex").
type of entity_list: std::vector< int,std::allocator< int > >
entity_list List of IDs associated with geometry_type.
return type of : std:: array< double,10 >
Returns
A 10-element array containing the combined bounding box parameters.
Title Array contents
  • [0] x-min
  • [1] x-max
  • [2] x-range (x-max ? x-min)
  • [3] y-min
  • [4] y-max
  • [5] y-range (y-max ? y-min)
  • [6] z-min
  • [7] z-max
  • [8] z-range (z-max ? z-min)
  • [9] diagonal length of the bounding box

◆ get_total_volume()

def cubit.get_total_volume (   volume_list )

Get the total volume for a list of volumes.

.. code-block:: python

# Assume volumes 1, 2, and 3 exist.
volume_list = [1, 2, 3]
total = cubit.get_total_volume (volume_list)
print("Total volume:" , total)
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_list List of volume IDs to include.
return type of : float
Returns
The sum of the volumes for all specified IDs.

◆ get_tri_count()

def cubit.get_tri_count ( )

Retrieve the count of triangular elements in the current model.

For a tetrahedral volume mesh, returns the number of surface triangles.

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" ) # mesh as tets (surface faces are tris)
tri_count = cubit.get_tri_count ()
print("Tri count:" , tri_count)
 @n return type of :  int
Returns
Number of triangular elements (surface faces of a tet mesh) in the current model's mesh.

◆ get_tri_global_element_id()

def cubit.get_tri_global_element_id (   tri_id )

Get the Global Element ID for a specific triangular element.

Cubit assigns a Global Element ID to each element when it is placed into a block. This function returns the Global Element ID corresponding to the given local tri ID within its type-specific ID space.

.. code-block:: python
# Create a brick and mesh its surfaces with triangles
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 scheme trimesh" )
cubit.cmd ("mesh surface 1" )
# Assign all tri elements on surface 1 to block 1
cubit.cmd ("block 1 tri all" )
# Query the Global Element ID of local tri 22
print("Global Element ID of tri 22:" , gid)
 @n type of tri_id:  int
Parameters
tri_id Local triangular element ID within its type.
return type of : int
Returns
Global Element ID for the specified triangle, or 0 if not placed into a block.

◆ get_trimesh_geometry_sizing()

def cubit.get_trimesh_geometry_sizing ( )

Retrieve the global geometry sizing flag for the TriMesh scheme.

If ON, TriMesh will incorporate the geometry approximation angle when computing element sizes. If OFF, geometry approximation is ignored.

.. code-block:: python
# 1) Enable geometry-based sizing globally.
cubit.cmd ("set trimesher geometry sizing on" )
# 2) Query the geometry sizing flag.
print("TriMesh geometry sizing enabled?" , geom_size_on) # Expected: True
 @n return type of :  boolean
Returns
True if TriMesh geometry sizing is ON; false otherwise.

◆ get_trimesh_num_anisotropic_layers()

def cubit.get_trimesh_num_anisotropic_layers ( )

Retrieve the global number of anisotropic triangle layers for the TriMesh scheme.

When ON, TriMesh will attempt to place specified layers of triangles in thin surface regions. Returns the number of layers; zero if anisotropic layers are disabled.

.. code-block:: python
# 1) Enable TriMesh anisotropic layers with 3 layers globally.
cubit.cmd ("set trimesher anisotropic layers on 3" )
# 2) Query the number of anisotropic layers.
print("Global TriMesh anisotropic layers:" , layers) # Expected: 3
 @n return type of :  int
Returns
Number of anisotropic layers (int); 0 if disabled.

◆ get_trimesh_ridge_angle()

def cubit.get_trimesh_ridge_angle ( )

Retrieve the global ridge angle for the TriMesh scheme.

The ridge angle determines which angles in a discrete surface are preserved as ridges when meshing. Triangles on discrete surfaces with dihedral angles above this threshold remain as ridges.

.. code-block:: python
# 1) Set TriMesh ridge angle to 30 degrees.
cubit.cmd ("set trimesher ridge angle 30" )
# 2) Query the current ridge angle.
print("TriMesh ridge angle:" , ridge, "degrees" ) # Expected: 30
 @n return type of :  float
Returns
Ridge angle in degrees (double).

◆ get_trimesh_split_overconstrained_edges()

def cubit.get_trimesh_split_overconstrained_edges ( )

Retrieve the global flag for splitting overconstrained edges in the TriMesh scheme.

If ON, TriMesh will split edges owned by a surface but whose nodes lie on curves, ensuring two elements through thickness in those regions.

.. code-block:: python
# 1) Enable splitting overconstrained edges globally.
cubit.cmd ("set trimesher split overconstrained edges on" )
# 2) Query the split overconstrained edges flag.
print("TriMesh split overconstrained edges?" , split_on) # Expected: True
 @n return type of :  boolean
Returns
True if splitting overconstrained edges is ON; false otherwise.

◆ get_trimesh_surface_gradation()

def cubit.get_trimesh_surface_gradation ( )

Retrieve the global surface mesh gradation for the TriMesh scheme.

The surface gradation controls how quickly triangle sizes change on surfaces when using MeshGems. A value > 1.0 limits the size ratio of adjacent triangles; larger values yield faster growth.

.. code-block:: python
# 1) Set global TriMesh surface gradation to 1.2.
cubit.cmd ("set trimesher surface gradation 1.2" )
# 2) Query the current surface gradation.
print("Global TriMesh surface gradation:" , grad) # Expected: 1.2
 @n return type of :  float
Returns
Global surface gradation value (double).

◆ get_trimesh_surface_proximity_ratio()

def cubit.get_trimesh_surface_proximity_ratio ( )

Retrieve the global surface proximity ratio for the TriMesh scheme.

The proximity ratio is used when surface proximity is ON to scale the feature-based size in thin regions.

.. code-block:: python
# 1) Enable surface proximity with a ratio of 2.0 globally.
cubit.cmd ("set trimesher surface proximity on ratio 2.0" )
# 2) Query the surface proximity ratio.
print("TriMesh surface proximity ratio:" , ratio) # Expected: 2.0
 @n return type of :  float
Returns
Global surface proximity ratio (double).

◆ get_trimesh_target_min_size()

def cubit.get_trimesh_target_min_size (   geometry_type,
  entity_id 
)

Retrieve the target minimum triangle size set on a specific geometry entity for the TriMesh scheme.

Returns the local "minimum size" constraint for the given entity (curve, surface, or volume) when using TriMesh. If no minimum was set on that entity, returns 0.

.. code-block:: python
# 1) Create a surface (Surface ID = 12) and set its local TriMesh minimum size to 0.05.
cubit.cmd ("surface 12 scheme trimesh minimum size 0.05" )
# 2) Query the target minimum size for surface 12.
min_size = cubit.get_trimesh_target_min_size ("surface" , 12)
print("Surface 12 TriMesh minimum size:" , min_size) # Expected: 0.05
Parameters
geom_type Geometry type of the entity ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity whose TriMesh minimum size is queried.
return type of : float
Returns
Target minimum triangle size (double) set on that entity; 0 if not set.

◆ get_trimesh_tiny_edge_length()

def cubit.get_trimesh_tiny_edge_length ( )

Retrieve the global tiny edge length for the TriMesh scheme.

The tiny edge length setting defines the minimum edge length below which elements are considered "tiny". TriMesh may use this value during cleanup or facet generation.

.. code-block:: python
# 1) Set TriMesh tiny edge length to 0.01.
cubit.cmd ("set trimesher tiny edge length 0.01" )
# 2) Query the current tiny edge length.
print("TriMesh tiny edge length:" , tiny) # Expected: 0.01
 @n return type of :  float
Returns
Global tiny edge length value (double).

◆ get_trimesh_use_surface_proximity()

def cubit.get_trimesh_use_surface_proximity ( )

Retrieve the global surface proximity flag for the TriMesh scheme.

When enabled, surface proximity adds refinement in thin regions of surfaces based on a proximity ratio.

.. code-block:: python
# 1) Enable surface proximity globally with default ratio of 1.0.
cubit.cmd ("set trimesher surface proximity on" )
# 2) Query whether surface proximity is on.
print("TriMesh surface proximity enabled?" , prox) # Expected: True
 @n return type of :  boolean
Returns
True if global surface proximity is ON; false if OFF.

◆ get_trimesh_volume_gradation()

def cubit.get_trimesh_volume_gradation ( )

Retrieve the global volume mesh gradation for the TriMesh scheme.

The volume gradation controls how triangle sizes on adjacent surfaces respond to nearby features. This affects how small surface triangles propagate to neighboring regions.

.. code-block:: python
# 1) Set global TriMesh volume gradation to 1.5.
cubit.cmd ("set trimesher volume gradation 1.5" )
# 2) Query the current volume gradation.
print("Global TriMesh volume gradation:" , vgrad) # Expected: 1.5
 @n return type of :  float
Returns
Global volume gradation value (double).

◆ get_undo_enabled()

def cubit.get_undo_enabled ( )

Query whether undo is currently enabled.

.. code-block:: python

# Enable undo.
cubit.cmd ("set undo on" )
enabled = cubit.get_undo_enabled () # returns True
print("Undo enabled:" , enabled)
# Disable undo.
cubit.cmd ("set undo off" )
enabled = cubit.get_undo_enabled () # returns False
print("Undo enabled:" , enabled)
 @n return type of :  boolean
Returns
True if undo is enabled; otherwise false.

◆ get_unmerged_curves_on_shells()

def cubit.get_unmerged_curves_on_shells (   shell_vols,
  thickness 
)

Identify unmerged curves between sheet (shell) volumes for use in shell construction workflows.

This function is normally used in the construction of shell representations from thin volumes. It identifies unmerged curve IDs on the specified shell_vols that are within the corresponding thickness distance of faces on other shell volumes in the list. These curves typically represent locations where the sheet bodies would need to be extended or trimmed to fully match the geometry of the original thin volumes.

Only sheet (shell) volumes are processed; solid volumes are ignored.

The thickness list specifies a proximity distance (normally the thickness of the original thin volumes) to use for detecting nearby curves. The list must match the length of shell_vols.

.. code-block:: python
cubit.cmd ('brick x 10 y 10 z 1' ) # Thin volume 1
cubit.cmd ('brick x 10 y 1 z 10' ) # Thin volume 2
cubit.cmd ('vol 2 mov x y 4.5 z 5.5' ) # Position thin volume 2 to create L shape
cubit.cmd ('surface 2 copy' ) # Generates sheet body 3
cubit.cmd ('surface 11 copy' ) # Generates sheet body 4
shell_vols = [3, 4] # The sheet body volume IDs
thickness = [1.0, 1.0] # Thickness of original thin volumes
unmerged_curves = cubit.get_unmerged_curves_on_shells (shell_vols, thickness)
print("Unmerged curves between sheet bodies:" )

for c_id in unmerged_curves: print(c_id)

# Expected output:
# 28
# 30
# Example use: Extend curve 30 to fill the gap between the two sheet bodies:
cubit.cmd ('tweak curve 30 target surface 2' )
 @n type of shell_vols:  std::vector< int,std::allocator< int > >
Parameters
shell_vols List of volume IDs to check. Only sheet (shell) volumes will be processed.
type of thickness: std::vector< double,std::allocator< double > >
thickness List of thickness values (proximity distance) corresponding to shell_vols. Length must match shell_vols.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of unmerged curve IDs on the specified shell volumes that are in proximity to faces on other shell volumes.

◆ get_valence()

def cubit.get_valence (   vertex_id )

Get the valence (number of incident edges) for a specific vertex.

The valence of a vertex is the number of curves (edges) that meet at that vertex.

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; vertex 1 is a corner with three incident edges.
cubit.cmd ("brick x 10" )
val = cubit.get_valence (1)
print("Valence of vertex 1:" , val) # prints 3
 @n type of vertex_id:  int
Parameters
vertex_id ID of the vertex to query.
return type of : int
Returns
The number of edges (curves) meeting at the specified vertex.

◆ get_valid_block_element_types()

def cubit.get_valid_block_element_types (   block_id )

Get a list of valid element types for the specified block.

Returns the list of supported element types (e.g., "hex8", "hex20", "tet10") that can be assigned to the given block, based on its associated geometry or mesh configuration.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("block 1 vol 1" )

for t in valid_types: print(t)

  @n type of block_id:  int
Parameters
block_id ID of the block.
return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Vector of supported element type strings.

◆ get_velocity_combine_type()

def cubit.get_velocity_combine_type (   entity_id )

Get the velocity's combine type.

Returns how multiple velocity boundary conditions are combined. Possible values include "Overwrite", "Average", "SmallestCombine", or "LargestCombine".


type of entity_id: int

Parameters
entity_id ID of the velocity boundary condition.
return type of : string
Returns
Combine type string for the given velocity BC.

◆ get_version()

def cubit.get_version ( )

Retrieve the current Cubit version string.

Returns the version identifier of the active Cubit engine, typically in "major.minor.patch" format.

.. code-block:: python
import cubit
version = cubit.get_version ()
print("Cubit version:" , version)
 @n return type of :  string
Returns
A string containing the current Cubit version.

◆ get_vertex_coordinates()

def cubit.get_vertex_coordinates (   entityID )

Get the 3D coordinates of a vertex.

Returns the exact 3D coordinates for a vertex.

.. code-block:: python
v_id = 12 # vertex 12
print(f"Vertex {v_id} coords: {vcoord}" )
Parameters
entity_id ID of the vertex to query.
return type of : std:: array< double,3 >
Returns
A 3-element array [x, y, z] representing the vertex coordinates.

◆ get_vertex_count()

def cubit.get_vertex_count ( )

Get the current number of vertices in the model.

.. code-block:: python

# Create a 10x10x10 brick; this generates eight corner vertices.
cubit.cmd ("brick x 10" )
vert_count = cubit.get_vertex_count () # returns 8
print("Vertex count:" , vert_count)
 @n return type of :  int
Returns
The number of vertices currently defined in the model.

◆ get_vertex_node()

def cubit.get_vertex_node (   vertex_id )

Get the node ID owned by a vertex.

This function returns the ID of the node associated with the specified vertex. If the vertex does not have an associated node, the function returns -1.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the node owned by vertex 1
node_id = cubit.get_vertex_node (1)
print(f"Vertex 1 owns node ID: {node_id}" )
 @n type of vertex_id:  int
Parameters
vertex_id ID of the vertex.
return type of : int
Returns
ID of the node owned by the vertex. Returns -1 if no node exists.

◆ get_vertex_type()

def cubit.get_vertex_type (   surface_id,
  vertex_id 
)

Retrieve the vertex type for a given vertex on a surface.

Vertex types classify each corner based on how many mesh elements meet there:

  • "end" : interior angle ~ 90deg (one element)
  • "side" : interior angle ~ 180deg (two elements)
  • "corner" : interior angle ~ 270deg (three elements)
  • "reverse" : interior angle ~ 360deg (four elements)
  • "unknown" : not classified or not applicable
.. code-block:: python
# Create a brick; surface 1 has four "end" vertices.
cubit.cmd ("brick x 10" )
# Query the type of vertex 1 on surface 1.
vtype = cubit.get_vertex_type (1, 1)
print("Vertex 1 on surface 1 type:" , vtype)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface containing the vertex.
type of vertex_id: int
vertex_id ID of the vertex to query.
return type of : string
Returns
: The vertex type "end", "side", "corner", "reverse", or "unknown".

◆ get_view_at()

def cubit.get_view_at ( )

Get the camera's current "at" (target) point.

Returns the xyz coordinates of the point that the camera is looking at. Requires an active graphics window; if graphics are disabled, this call may fail.

.. code-block:: python
import cubit
# Display current view (outputs from/at/up vectors)
cubit.cmd ("journal view" )
# Get the "at" coordinates
print("Camera at:" , at) # e.g., [0.0, 0.0, 0.0]
# Set a new "at" point via Cubit command
cubit.cmd ("at 5 5 5" )
print("Camera at after setting:" , at)
 @n return type of : std:: array< double,3 >
Returns
Array of three doubles {x, y, z} representing the camera's target point.

◆ get_view_distance()

def cubit.get_view_distance ( )

Get the camera's distance between its position and focus point.

Returns the straight-line distance from the camera "from" point to its "at" point. Requires an active graphics window; if graphics are disabled, this call may fail.

.. code-block:: python
import cubit
# Display current view parameters (prints from/at/up vectors)
cubit.cmd ("journal view" )
# Explicitly set the camera 'from' point to (10, 5, 15)
cubit.cmd ("from 10 5 15" )
# Now get the updated camera distance
print("Camera distance after setting 'from':" , dist)
 @n return type of :  float
Returns
Distance (double) between the camera position ("from") and its focus point ("at").

◆ get_view_from()

def cubit.get_view_from ( )

Get the camera's current 'from' (position) point.

Returns the xyz coordinates of the camera's location in space. Requires an active graphics window; if graphics are disabled, this call may fail.

.. code-block:: python
import cubit
# Display current view (outputs from/at/up vectors)
cubit.cmd ("journal view" )
# Get the "from" coordinates
print("Camera from:" , frm) # e.g., [10.0, 5.0, 15.0]
# Move the camera to a new "from" point
cubit.cmd ("from 20 10 30" )
print("Camera from after setting:" , frm)
 @n return type of : std:: array< double,3 >
Returns
Array of three doubles {x, y, z} representing the camera's position.

◆ get_view_up()

def cubit.get_view_up ( )

Get the camera's 'up' direction vector.

Returns the normalized xyz vector that defines the upward orientation of the camera. Requires an active graphics window; if graphics are disabled, this call may fail.

.. code-block:: python
import cubit
# Display current view (outputs from/at/up vectors)
cubit.cmd ("journal view" )
# Get the "up" coordinates
print("Camera up vector:" , up) # e.g., [0.0, 1.0, 0.0]
# Change the camera up direction (example command)
cubit.cmd ("up 0 1 0" )
print("Camera up vector after setting:" , up)
 @n return type of : std:: array< double,3 >
Returns
Array of three doubles {x, y, z} representing the camera's up direction vector.

◆ get_volume_area()

def cubit.get_volume_area (   volume_id )

Get the total surface area of a specified volume.

This returns the sum of all face areas bounding the volume.

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; volume 1 is generated.
cubit.cmd ("brick x 10" )
area = cubit.get_volume_area (1) # 6 faces x (10x10) = 600
print("Volume 1 surface area:" , area) # prints 600
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : float
Returns
Total surface area of the specified volume.

◆ get_volume_CAD_material()

def cubit.get_volume_CAD_material (   volume_id )

◆ get_volume_count()

def cubit.get_volume_count ( )

Get the current number of volumes in the model.

.. code-block:: python

# Create a 10x10x10 brick; this generates one volume (ID 1).
cubit.cmd ("brick x 10" )
vol_count = cubit.get_volume_count () # returns 1
print("Volume count:" , vol_count)
 @n return type of :  int
Returns
The number of volumes currently defined in the model.

◆ get_volume_element_count()

def cubit.get_volume_element_count (   volume_id )

Retrieve the count of 3D elements in a specified volume.

Returns the total number of hexahedra, tetrahedra, pyramids, and wedges within the given volume (regardless of block assignments).

.. code-block:: python
cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" ) # mesh as tets
print("3D elements in volume 1:" , count3D)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : int
Returns
Number of hexes, tets, pyramids, and wedges in the specified volume.

◆ get_volume_gap_solutions()

def cubit.get_volume_gap_solutions (   surface_id_1,
  surface_id_2 
)

Suggests remedies for a gap between two surfaces on different volumes.

Given two surface IDs from different volumes that are close but separated by a gap, this function provides options to close or reconcile the gap.

To identify surface gaps, use get_gaps_between_volumes or get_volume_gaps.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 10" )
cubit.cmd ("volume 2 move x 10.1" ) # small gap between face 6 and face 10
solutions = cubit.get_volume_gap_solutions (6, 10)

for i in range(len(solutions[0])): print("Option:", solutions[0][i])

print(" Command:" , solutions[1][i])
print(" Preview:" , solutions[2][i])
print(" Shorthand:" , solutions[3][i])
# Expected output (first two results):
# Option: Replace Surface 6 with Surface 10
# Command: tweak surface 6 replace with surface 10
# Preview: tweak surface 6 replace with surface 10 preview
# Shorthand: 6 6 10
# Option: Replace Surface 10 with Surface 6
# Command: tweak surface 10 replace with surface 6
# Preview: tweak surface 10 replace with surface 6 preview
# Shorthand: 6 10 6
 @n type of surface_id_1:  int
Parameters
surface_id_1 ID of the first surface forming a gap (must be on a different volume than surface_id_2).
type of surface_id_2: int
surface_id_2 ID of the second surface forming a gap (must be on a different volume than surface_id_1).
return type of : std::vector< std::vector< std::string,std::allocator< std::string > >,std::allocator< std::vector< std::string,std::allocator< std:: string > > > >
Returns
A vector of four aligned string vectors: [0] Display strings for each recommended remedy, [1] Cubit command strings to apply each remedy, [2] Cubit preview command strings for each remedy, [3] Shorthand descriptions (operation ID and surface/volume IDs).

◆ get_volume_hexes()

def cubit.get_volume_hexes (   volume_id )

Get the list of hexahedron (hex) IDs contained in a volume.

This function returns the IDs of all hexahedron (hex) elements that are part of the specified volume.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the hexes in volume 1
hex_ids = cubit.get_volume_hexes (1)
print(f"Volume 1 contains {len(hex_ids)} hex(s)." )

for hex_id in hex_ids: print(f" Hex ID: {hex_id}")

  @n type of volume_id:  int
Parameters
volume_id ID of the volume to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of hexahedron (hex) IDs contained in the volume.

◆ get_volume_nodes()

def cubit.get_volume_nodes (   volume_id )

Get the list of node IDs owned by a volume.

This function returns the IDs of nodes owned by the specified volume. Nodes on bounding surfaces, curves, and vertices are excluded. Only interior (volume-owned) nodes are returned.

.. code-block:: python
# Create a brick and mesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh vol 1" )
# Query the nodes owned by volume 1
volume_nodes = cubit.get_volume_nodes (1)
print(f"Volume 1 owns {len(volume_nodes)} node(s)." )

for node_id in volume_nodes: print(f" Node ID: {node_id}")

  @n type of volume_id:  int
Parameters
volume_id ID of the volume.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of node IDs owned by the volume (excluding nodes on bounding surfaces, curves, and vertices).

◆ get_volume_pyramids()

def cubit.get_volume_pyramids (   volume_id )

Get the list of pyramid IDs contained in a volume.

This function returns the IDs of all pyramid elements that are part of the specified volume.

.. code-block:: python
# Create two bricks and mesh them with different schemes
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10" )
cubit.cmd ("merge all" )
cubit.cmd ("vol 1 scheme map" )
cubit.cmd ("mesh vol 1" )
cubit.cmd ("vol 2 scheme tetmesh" )
cubit.cmd ("mesh vol 2" )
# Query the pyramids in volume 2
pyramid_ids = cubit.get_volume_pyramids (2)
print(f"Volume 2 contains {len(pyramid_ids)} pyramid(s)." )

for pyr_id in pyramid_ids: print(f" Pyramid ID: {pyr_id}")

  @n type of volume_id:  int
Parameters
volume_id ID of the volume to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of pyramid IDs contained in the volume.

◆ get_volume_tets()

def cubit.get_volume_tets (   volume_id )

Get the list of tetrahedron (tet) IDs contained in a volume.

This function returns the IDs of all tetrahedron (tet) elements that are part of the specified volume.

.. code-block:: python
# Create a brick and tetmesh volume 1
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" )
# Query the tets in volume 1
tet_ids = cubit.get_volume_tets (1)
print(f"Volume 1 contains {len(tet_ids)} tet(s)." )

for tet_id in tet_ids: print(f" Tet ID: {tet_id}")

  @n type of volume_id:  int
Parameters
volume_id ID of the volume to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of tetrahedron (tet) IDs contained in the volume.

◆ get_volume_volume()

def cubit.get_volume_volume (   vol_id )

Get the enclosed volume of a specified volume.

.. code-block:: python

# Create a 10x10x10 brick centered at the origin; volume 1 is generated.
cubit.cmd ("brick x 10" )
vol = cubit.get_volume_volume (1) # returns 1000
print("Volume 1 volume:" , vol) # prints 1000
 @n type of vol_id:  int
Parameters
vol_id ID of the volume to query.
return type of : float
Returns
The enclosed volume of the specified volume.

◆ get_volume_wedges()

def cubit.get_volume_wedges (   volume_id )

Get the list of wedge IDs contained in a volume.

This function returns the IDs of all wedge elements that are part of the specified volume.

.. code-block:: python
# Create a brick and mesh surface 1 with triangles
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 scheme trimesh" )
cubit.cmd ("mesh surf 1" )
# Sweep the surface mesh to create wedges in volume 1
cubit.cmd ("vol 1 scheme sweep" )
cubit.cmd ("mesh vol 1" )
# Query the wedges in volume 1
wedge_ids = cubit.get_volume_wedges (1)
print(f"Volume 1 contains {len(wedge_ids)} wedge(s)." )

for wedge_id in wedge_ids: print(f" Wedge ID: {wedge_id}")

  @n type of volume_id:  int
Parameters
volume_id ID of the volume to examine.
return type of : std::vector< int,std:: allocator< int > >
Returns
List of wedge IDs contained in the volume.

◆ get_volumes_for_node()

def cubit.get_volumes_for_node (   node_name,
  node_instance 
)

◆ get_wedge_count()

def cubit.get_wedge_count ( )

Retrieve the count of wedge-shaped elements in the current model.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("surface 1 scheme trimesh" ) # set triangular scheme on surface 1
cubit.cmd ("mesh surface 1" ) # mesh surface 1 with triangles
cubit.cmd ("mesh vol 1" ) # sweep triangles, generating wedges
wedge_count = cubit.get_wedge_count ()
print("Wedge count:" , wedge_count)
 @n return type of :  int
Returns
Number of wedge-shaped elements in the current model (e.g., generated by sweeping triangles).

◆ get_wedge_global_element_id()

def cubit.get_wedge_global_element_id (   wedge_id )

Get the Global Element ID for a specific wedge element.

This function returns the Global Element ID assigned to the given local wedge ID when the element is placed into a block.

.. code-block:: python
# Create a brick and mesh its top surface with triangles
cubit.cmd ("brick x 10" )
cubit.cmd ("surface 1 scheme trimesh" )
cubit.cmd ("mesh surface 1" )
# Sweep the triangular surface to generate wedges in volume 1
cubit.cmd ("vol 1 scheme sweep" )
cubit.cmd ("mesh vol 1" )
# Assign all wedges in volume 1 to block 1 (establishes global IDs)
cubit.cmd ("block 1 wedge all" )
# Query the Global Element ID of local wedge 22
print("Global Element ID of wedge 22:" , gid)
 @n type of wedge_id:  int
Parameters
wedge_id Local wedge element ID within its type.
return type of : int
Returns
Global Element ID for the specified wedge, or 0 if not placed into a block.

◆ get_wrt_entity()

def cubit.get_wrt_entity (   source_type,
  source_id,
  sideset_id 
)

Get the 'with-respect-to' entity of an item in a sideset.

This function returns the "with-respect-to" (WRT) entity associated with the specified entity (face, quad, or tri) in the specified sideset. The WRT entity provides context for how the sideset references or is oriented with respect to the entity.

.. code-block:: python
# Query the with-respect-to entity of face 332 in sideset 2
wrt_entity = cubit.get_wrt_entity ("face" , 332, 2)
print(f"WRT entity for face 332 in sideset 2: {wrt_entity}" )
 @n type of source_type:  string
Parameters
source_type Item type: "face", "quad", or "tri".
type of source_id: int
source_id ID of the entity.
type of sideset_id: int
sideset_id ID of the sideset.
return type of : string
Returns
'With-respect-to' entity of the specified entity in the sideset.

◆ group_names_ids()

def cubit.group_names_ids ( )

Retrieve names and IDs of all defined groups (excluding the pick group).

Returns a vector of (name, ID) pairs for each active group in the current session.

.. code-block:: python
# Create and name two groups.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"g1\" add vertex in vol 1" )
cubit.cmd ("group \"g2\" add volume in vol 1" )
# Fetch group names and IDs.
groups = cubit.group_names_ids ()

for name, gid in groups: print(f"Group '{name}' has ID {gid}")

  @n return type of : std::vector< std::pair< std::string,int >,std::allocator< std::pair< std:: string,int > > >
Returns
Vector of (group name, group ID) pairs.

◆ has_valid_size()

def cubit.has_valid_size (   geometry_type,
  entity_id 
)

Check whether a geometric entity has a valid size.

Title This function returns whether the specified geometric entity currently has a valid size.

  • All entities have a size if auto sizing is enabled.
  • If auto sizing is off, an entity only has a size if it has been explicitly set (e.g. via a size command).

Title Return value:

  • 1 if the entity has a valid size
  • 0 if the entity does not have a valid size
.. code-block:: python
# Create a brick
cubit.cmd ("brick x 10" )
# Check whether surface 1 has a valid size
has_size = cubit.has_valid_size ("surface" , 1)
print(f"Surface 1 has valid size? {'Yes' if has_size else 'No'}" )
 @n type of geometry_type:  string
Parameters
geometry_type Type of the geometric entity (e.g. "surface", "curve", "volume", etc.).
type of entity_id: int
entity_id ID of the geometric entity.
return type of : int
Returns
1 if the entity has a valid size, 0 if it does not.

◆ heatflux_is_on_shell_area()

def cubit.heatflux_is_on_shell_area (   bc_area_enum,
  entity_id 
)

Check if a heatflux BC is on a shell area.


type of bc_area_enum: int

Parameters
bc_area_enum CI_BCEntityTypes: 7 (top), 8 (bottom).
type of entity_id: int
entity_id ID of the heatflux BC.
return type of : boolean
Returns
True if the BC is applied to the specified shell area.

◆ highlight()

def cubit.highlight (   entity_type,
  entity_id 
)

Highlight the given entity in the graphics window without selecting it.

Adds a visual highlight (for example, an orange colored overlay) to the specified entity. Unlike selection, highlighting does not add the entity to the pick list or change its selection state. Selecting an entity (for example, via "select volume 5") also produces a highlight, but calling this function only affects appearance.

.. code-block:: python
import cubit
# Select volume 5 (adds to pick list and highlights it)
cubit.cmd ("select volume 5" )
# Highlight volume 6 without selecting it
cubit.highlight ("volume" , 6)
# Retrieve the list of selected IDs (only volume 5 is selected)
print("Selected IDs:" , ids)
 @n type of entity_type:  string
Parameters
entity_type Entity type to highlight ("vertex", "curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity to highlight.

◆ init()

def cubit.init (   argv )

Initialize the Cubit engine with optional startup arguments.

Must be called before any other Cubit API functions. Passing a single empty string in the argument list will launch Cubit with default settings.

.. code-block:: python
import cubit
cubit.init (["" ])


type of argv: std::vector< std::string,std::allocator< std::string > >

Parameters
argv List of startup directives for Cubit (e.g., command-line flags). Use {""} for defaults.

◆ is_acis_engine_available()

def cubit.is_acis_engine_available ( )

Determine whether the ACIS geometry engine is available.

Notes ACIS is the default engine in standard Cubit distributions and should always be available.

.. code-block:: python
print("ACIS engine available:" , has_acis)
 @n return type of :  boolean
Returns
True if ACIS support is present; otherwise false.

◆ is_assembly_metadata_attached()

def cubit.is_assembly_metadata_attached (   volume_id )

Check if metadata is attached to a volume.

Used to validate part association or identify unassociated geometry.
type of volume_id: int

Parameters
volume_id ID of the volume.
return type of : boolean
Returns
True if metadata exists, false otherwise.

◆ is_blend_surface()

def cubit.is_blend_surface (   surface_id )

Determine if a face's underlying surface is a blend (fillet).

Checks whether the surface with ID surface_id represents a blend created by a fillet operation.

.. code-block:: python
# Create a 2x2x2 brick and fillet edge 1 with radius 0.5.
cubit.cmd ("brick x 2 y 2 z 2" )
cubit.cmd ("modify curve 1 blend radius 0.5" )
# Surface 7 should now be a blend.
is_blend = cubit.is_blend_surface (7)
print("Surface 7 is blend:" , is_blend)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
return type of : boolean
Returns
True if the surface is a blend (fillet); otherwise false.

◆ is_boundary_layer_id_available()

def cubit.is_boundary_layer_id_available (   boundary_layer_id )

Check if a boundary layer ID is currently available.

Useful for verifying uniqueness before assignment.
type of boundary_layer_id: int

Parameters
boundary_layer_id Boundary layer ID to check.
return type of : boolean
Returns
True if ID is available, false if already in use.

◆ is_catia_engine_available()

def cubit.is_catia_engine_available ( )

Determine whether the CATIA geometry engine is available.

Notes CATIA is not included in standard Cubit distributions. Only special builds with CATIA support will return true.

.. code-block:: python
print("CATIA engine available:" , has_catia)
 @n return type of :  boolean
Returns
True if CATIA support is compiled in; otherwise false.

◆ is_cavity_surface()

def cubit.is_cavity_surface (   surface_id )

Return whether the specified surface is part of a cavity.

A cavity surface is a surface that bounds a closed void within the model geometry.

If the surface is part of a cavity (such as the inner walls of a subtracted volume), this function returns true; otherwise, false.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("brick x 5" )
cubit.cmd ("vol 5 move x 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
surf_id = 17
is_cavity = cubit.is_cavity_surface (surf_id)
print(f"Surface {surf_id} is {'a cavity surface' if is_cavity else 'not a cavity surface'}" )
# Expected output (example):
# Surface 17 is a cavity surface.
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : boolean
Returns
True if the surface is part of a cavity, false otherwise.

◆ is_chamfer_surface()

def cubit.is_chamfer_surface (   surface_id,
  thickness_threshold 
)

Determine if a face's underlying surface is a chamfer.

Checks whether the surface with ID surface_id represents a chamfer by comparing its maximum thickness to thickness_threshold.

.. code-block:: python
# Create a 2x2x2 brick and chamfer edge 1 with radius 0.5.
cubit.cmd ("brick x 2 y 2 z 2" )
cubit.cmd ("modify curve 1 chamfer radius 0.5" )
# Surface 7 should now be a chamfer.
is_chamfer = cubit.is_chamfer_surface (7, 1.0)
print("Surface 7 is chamfer:" , is_chamfer)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
type of thickness_threshold: float
thickness_threshold Max thickness to qualify as chamfer.
return type of : boolean
Returns
True if the surface thickness <= thickness_threshold, indicating a chamfer.

◆ is_close_loop_surface()

def cubit.is_close_loop_surface (   surface_id,
  mesh_size 
)

Check if a surface has multiple loops closer than a given threshold.

Returns true if the face has two or more boundary loops and any two edges from different loops lie within mesh_size of each other. Otherwise returns false.

.. code-block:: python
# Create two concentric cylinders and subtract inner from outer.
cubit.cmd ("cylinder x 3 height 10" )
cubit.cmd ("cylinder x 2 height 10" )
cubit.cmd ("subtract volume 2 from volume 1" )
# Surface 9 (annulus-like face) has two loops separated by distance 1.
has_close = cubit.is_close_loop_surface (9, 1.0)
print("Surface 9 has close loops:" , has_close) # True
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
type of mesh_size: float
mesh_size Distance threshold for loop separation.
return type of : boolean
Returns
True if the surface has two or more loops and at least one pair of edges between loops within mesh_size.

◆ is_command_echoed()

def cubit.is_command_echoed ( )

Check whether Cubit echoes commands to the console.

Returns true if each command is printed as it is executed.

.. code-block:: python
import cubit
print(cubit.is_command_echoed ()) # True or False
 @n return type of :  boolean
Returns
True if command echoing is enabled; false otherwise.

◆ is_command_journaled()

def cubit.is_command_journaled ( )

Query whether Cubit is journaling commands.

Returns true if command journaling is currently enabled. Journaling is on by default, but may be turned off explicitly using a command or API call.

.. code-block:: python
import cubit
# Disable journaling
# Check journaling state

if not cubit.is_command_journaled() : print("Journaling is disabled.")

# Re-enable journaling
 @n return type of :  boolean
Returns
True if command journaling is enabled; false otherwise.

◆ is_cone_surface()

def cubit.is_cone_surface (   surface_id )

Determine whether a surface is a cone.

Returns whether the specified surface is a conical surface.

.. code-block:: python
# Create a cylinder volume with a cone on top.
cubit.cmd ('cylinder rad 1 height 5' ) # Create cylinder
cubit.cmd ('create frustum height 1 radius 1 top 0' ) # Create cone (frustum with top radius 0)
cubit.cmd ('vol 2 mov z 3' ) # Move cone on top of cylinder
cubit.cmd ('unite vol all' ) # Unite volumes into one
cubit.cmd ('split period vol 1' ) # Split cylinder and cone surfaces
result1 = cubit.is_cone_surface (4) # from frustum
result2 = cubit.is_cone_surface (1) # from cylinder
print("Surface 4 is cone:" , result1)
print("Surface 1 is cone:" , result2)
# Expected output:
# Surface 4 is cone: True
# Surface 1 is cone: False
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to test.
return type of : boolean
Returns
True if the surface is a cone, false otherwise.

◆ is_continuous_surface()

def cubit.is_continuous_surface (   surface_id,
  angle_tol 
)

Return whether the surface has any adjacent continuous surfaces.

Two surfaces are considered continuous if the exterior angle between them at a shared curve is 180 degrees +/- angle_tol.

.. code-block:: python
cubit.cmd ("cylinder rad 1 height 5" )
cubit.cmd ("vol 1 split periodic" ) # Splits cylinder surface into surfaces 4 and 5
result = cubit.is_continuous_surface (4, 0.1)
print("Surface 4 has adjacent continuous surfaces:" , result)
# Expected output:
# True
 @n type of surface_id:  int
Parameters
surface_id ID of surface to query.
type of angle_tol: float
angle_tol Angle tolerance for continuity (degrees).
return type of : boolean
Returns
True if the surface has at least one adjacent continuous surface, false otherwise.

◆ is_cylinder_surface()

def cubit.is_cylinder_surface (   surface_id )

Determine if a given face's underlying surface is a circular cylinder.

Checks whether the surface associated with the specified face ID is a true cylindrical surface.

.. code-block:: python
# Create a cylinder of radius 2 and height 5.
cubit.cmd ("cylinder radius 2 height 5" )
# Surface 1 (the lateral face) should be a cylinder.
print("Surface 1 is cylinder:" , is_cyl) # True
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
return type of : boolean
Returns
True if the surface is a cylindrical surface; otherwise false.

◆ is_geometry_visibility_on()

def cubit.is_geometry_visibility_on ( )

Check if geometry graphics are visible in the graphics window.

Geometry display can be toggled on or off to show or hide CAD entities. This is useful when you want to view only the mesh without underlying geometry.

.. code-block:: python
import cubit
# Enable geometry visibility and verify
cubit.cmd ("geometry vis off" )
print("Geometry visible?" , geomVis)
 @n return type of :  boolean
Returns
true if geometry graphics are currently visible; false otherwise.

◆ is_hole_surface()

def cubit.is_hole_surface (   surface_id,
  radius_threshold 
)

Return whether the specified surface is part of a hole.

A hole surface is one that bounds a small feature, such as a drilled or machined hole, whose maximum radius does not exceed the given threshold.

If radius_threshold < 0, the default is used: 3 x mesh_size.

.. code-block:: python
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 1 height 10" )
cubit.cmd ("vol 2 move z 5" )
cubit.cmd ("subtract volume 2 from volume 1" )
surf_id = 10
radius_thresh = 2.0
is_hole = cubit.is_hole_surface (surf_id, radius_thresh)
print(f"Surface {surf_id} is {'a hole surface' if is_hole else 'not a hole surface'}" )
# Expected output (example):
# Surface 10 is a hole surface.
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
type of radius_threshold: float
radius_threshold Maximum radius criterion for hole detection. If < 0, defaults to 3 x mesh_size.
return type of : boolean
Returns
True if the surface is part of a hole, false otherwise.

◆ is_interval_count_odd()

def cubit.is_interval_count_odd (   surface_id )

Check if any loop on a surface has an odd number of mesh intervals.

The pave meshing scheme requires each loop on a surface to have an even number of intervals so that quads can be generated. Use this function to detect if a surface contains any loop with an odd interval count, which would prevent pave meshing.

.. code-block:: python
# Assume surface 5 has been meshed with interval counts.

if has_odd: print("Surface 5 contains an odd loop; cannot apply pave mesh.") else:

print("Surface 5 can be paved with all quads." )
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
return type of : boolean
Returns
True if any loop on the surface has an odd number of intervals; otherwise false.

◆ is_merged()

def cubit.is_merged (   geometry_type,
  entity_id 
)

Check if a specified geometry entity has been merged into another.

This function returns true if the given entity-identified by its geometry type ("curve", "surface", or "volume") and integer ID-has been merged into a different entity; otherwise, it returns false.

After performing merge operations (for example, merge vol all), shared or redundant entities may no longer exist as standalone objects. Use is_merged() to verify whether a particular entity was absorbed by another during such operations.

.. code-block:: python
# 1) Create two unit cubes (Volume IDs = 1 and 2).
cubit.cmd ("brick x 10" ); # Volume ID = 1
cubit.cmd ("brick x 10" ); # Volume ID = 2
# 2) Move volume 2 ten units in the x-direction so they share a face.
cubit.cmd ("vol 2 mov x 10" );
# 3) Merge all volumes into a single volume.
cubit.cmd ("merge all" );
# 4) Check if surface 6 (the original shared face) has been merged.

if (cubit.is_merged ("surface", 6)) { std::cout << "Surface 6 has been merged." << std::endl; } else { std::cout << "Surface 6 is not merged." << std::endl; }

  @n type of geometry_type:  string
Parameters
geometry_type The type of geometry to check. Valid values are "curve", "surface", or "volume".
type of entity_id: int
entity_id The integer ID of the entity to query.
return type of : boolean
Returns
true if the specified entity was merged into another; false otherwise.

◆ is_mesh_element_in_group()

def cubit.is_mesh_element_in_group (   element_type,
  element_id 
)

Check if a specific mesh element belongs to any group.

.. code-block:: python

# Determine if tetrahedron with ID 445 is in a group.

if cubit.is_mesh_element_in_group ("tet", 445): print("Tet 445 is in a group") else:

print("Tet 445 is not in any group" )
 @n type of element_type:  string
Parameters
element_type Mesh element type (e.g., "node", "edge", "tri", "quad", "tet", "hex").
type of element_id: int
element_id ID of the mesh element to test.
return type of : boolean
Returns
True if the element is contained in at least one group, false otherwise.

◆ is_mesh_visibility_on()

def cubit.is_mesh_visibility_on ( )

Check if mesh graphics are visible in the graphics window.

Mesh display can be toggled on or off to show or hide mesh elements. Hiding mesh can improve performance when displaying the geometry.

.. code-block:: python
import cubit
# Enable mesh visibility and verify
cubit.cmd ("mesh vis off" )
print("Mesh visible?" , meshVis)
 @n return type of :  boolean
Returns
true if mesh graphics are currently visible; false otherwise.

◆ is_meshed()

def cubit.is_meshed (   geometry_type,
  entity_id 
)

Determine whether a specified geometry entity has been meshed.

Returns true if the given entity (curve, surface, or volume) already has a valid mesh; otherwise false.

.. code-block:: python
# 1) Mesh surface 137.
cubit.cmd ("mesh surface 137" )
# 2) Check if surface 137 is now meshed.

if cubit.is_meshed ("surface", 137): print("Surface 137 is meshed.") else:

print("Surface 137 is not meshed." )
 @n type of geometry_type:  string
Parameters
geometry_type Geometry type ("curve", "surface", or "volume").
type of entity_id: int
entity_id ID of the entity to check.
return type of : boolean
Returns
True if the specified entity is already meshed; false otherwise.

◆ is_modified()

def cubit.is_modified ( )

Check if the model has been modified since import or last save.

Returns true if any CAD operation has altered the current model state (e.g., remove surface 10 after an import), false if the model is still in its original, unmodified state.

.. code-block:: python
import cubit
# Import and modify
cubit.cmd ('import "part.sat"' )
cubit.cmd ("remove surface 10" )
modified = cubit.is_modified ()
print("Model modified?" , modified)
 @n return type of :  boolean
Returns
True if the model has been changed by any operation; false otherwise.

◆ is_multi_volume()

def cubit.is_multi_volume (   body_id )

Check if a body contains multiple volumes.

Cubit bodies typically consist of a single volume; multi-volume bodies are rare and usually arise from importing ACIS models. To split a multi-volume body into separate volumes, use: cubit.cmd ('split body <id>')

.. code-block:: python
# Assume body 10 may contain multiple volumes.
multi = cubit.is_multi_volume (10)

if multi: print("Body 10 has multiple volumes. Splitting...")

cubit.cmd ("split body 10" )
 @n type of body_id:  int
Parameters
body_id ID of the body to query.
return type of : boolean
Returns
True if the body contains more than one volume; otherwise false.

◆ is_narrow_surface()

def cubit.is_narrow_surface (   surface_id,
  mesh_size 
)

Determine if any two non-adjacent edges on the surface form a narrow region.

Iterates over all pairs of edges without a shared vertex. For each pair, if their shortest distance <= mesh_size and their local edge directions (relative to surface normals) differ by more than 15deg, the surface is marked narrow.

.. code-block:: python
# Check if surface 5 contains any narrow region smaller than 0.1 units.
narrow = cubit.is_narrow_surface (5, 0.1)
print("Surface 5 is narrow:" , narrow)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to check.
type of mesh_size: float
mesh_size Distance threshold for identifying narrow edge pairs.
return type of : boolean
Returns
True if any qualifying edge pair is found; otherwise false.

◆ is_occlusion_on()

def cubit.is_occlusion_on ( )

Check if occlusion is enabled.

Returns true if occlusion is currently active.

.. code-block:: python
 @n return type of :  boolean
Returns
true if occlusion (hidden-line removal) is enabled; false otherwise.

◆ is_on_thin_shell()

def cubit.is_on_thin_shell (   bc_type_enum,
  entity_id 
)

Check if a boundary condition is applied to a thin shell.

Valid for temperature, convection, and heatflux BCs.


type of bc_type_enum: int

Parameters
bc_type_enum BC type (temperature = 4, convection = 7, heatflux = 8).
type of entity_id: int
entity_id ID of the boundary condition.
return type of : boolean
Returns
True if BC is on a thin shell element.

◆ is_opencascade_engine_available()

def cubit.is_opencascade_engine_available ( )

Determine whether the OpenCASCADE geometry engine is available.

Notes OpenCASCADE is not included in standard Cubit distributions. Only special builds with OpenCASCADE support will return true.

.. code-block:: python
print("OpenCASCADE engine available:" , has_occ)
 @n return type of :  boolean
Returns
True if OpenCASCADE support is compiled in; otherwise false.

◆ is_part_of_list()

def cubit.is_part_of_list (   target_id,
  id_list 
)

Check if an ID is present in a list of IDs.

This function checks whether the specified target ID is present in the given list of IDs. Returns true if the target ID is found in the list; otherwise returns false .

.. code-block:: python
# Example ID list
id_list = [1, 2, 3, 5, 8]
# Check if ID 3 is part of the list
found = cubit.is_part_of_list (3, id_list)
print(f"Is 3 in the list? {'Yes' if found else 'No'}" )
# Check if ID 4 is part of the list
found = cubit.is_part_of_list (4, id_list)
print(f"Is 4 in the list? {'Yes' if found else 'No'}" )
 @n type of target_id:  int
Parameters
target_id Target ID to search for.
type of id_list: std::vector< int,std::allocator< int > >
id_list List of IDs.
return type of : boolean
Returns
true if target_id is a member of id_list, otherwise false.

◆ is_performing_undo()

def cubit.is_performing_undo ( )

Query whether an undo operation is currently being performed.

Use this to detect if Cubit is in the middle of executing an undo command.

.. code-block:: python
import cubit
cubit.cmd ("undo" )
print(cubit.is_performing_undo ()) # True if still undoing
 @n return type of :  boolean
Returns
True if an undo is in progress; false otherwise.

◆ is_periodic()

def cubit.is_periodic (   geometry_type,
  entity_id 
)

Query whether a specified surface or curve is periodic.

.. code-block:: python

cubit.cmd ("create cylinder radius 3 height 10" )
periodic = cubit.is_periodic ("surface" , 1) # returns True
print(periodic)
Parameters
geom_type Specifies the geometry type ("surface" or "curve").
type of entity_id: int
entity_id ID of the entity to query.
return type of : boolean
Returns
True if the entity is periodic; otherwise false.

◆ is_perspective_on()

def cubit.is_perspective_on ( )

Check if perspective projection is enabled.

Returns true if the graphics window is using perspective projection; false if orthographic.

.. code-block:: python
import cubit
# Enable perspective projection and verify
cubit.cmd ("graphics perspective on" )
persp_on = cubit.is_perspective_on ()
print("Perspective on?" , persp_on)
 @n return type of :  boolean
Returns
true if perspective projection is enabled; false otherwise.

◆ is_playback_paused()

def cubit.is_playback_paused ( )

Check if journal playback is currently paused.

Returns true if journal playback is currently paused, either manually via pause_playback() or due to an error when playback-paused-on-error is enabled.

.. code-block:: python
import cubit
# Pause playback
# Check if playback is paused

if cubit.is_playback_paused() : print("Playback is currently paused.")

# Resume playback
 @n return type of :  boolean
Returns
True if playback is paused; false otherwise.

◆ is_playback_paused_on_error()

def cubit.is_playback_paused_on_error ( )

Query whether playback is paused on error.

Returns the current setting that controls whether Cubit pauses journal playback when an error occurs.

.. code-block:: python
import cubit
# Enable pause on error
# Run a journal file
cubit.cmd ("play 'test.jou'" )
# Check pause-on-error status

if cubit.is_playback_paused_on_error() : print("Playback paused on error.")

  @n return type of :  boolean
Returns
True if playback will pause on errors; false otherwise.

◆ is_point_contained()

def cubit.is_point_contained (   geometry_type,
  entity_id,
  xyz_point 
)

Determine if a point is inside, outside, on, or unknown relative to a given entity.

Commonly used for volumes or sheet bodies to test point containment.

.. code-block:: python
# Create a 10x10x10 brick centered at the origin; volume 1 occupies -5 to +5.
cubit.cmd ("brick x 10" )
# Test a point inside the volume.
pt_inside = (0.0, 0.0, 0.0)
result_inside = cubit.is_point_contained ("volume" , 1, pt_inside)
# result_inside == 1 (inside)
print("Point inside:" , result_inside)
# Test a point outside the volume.
pt_outside = (10.0, 0.0, 0.0)
result_outside = cubit.is_point_contained ("volume" , 1, pt_outside)
# result_outside == 0 (outside)
print("Point outside:" , result_outside)
# Test a point on the boundary of the volume.
pt_on = (5.0, 0.0, 0.0)
result_on = cubit.is_point_contained ("volume" , 1, pt_on)
# result_on == 2 (on boundary)
print("Point on boundary:" , result_on)
 @n type of geometry_type:  string
Parameters
geometry_type Type of the entity ("volume" or "body").
type of entity_id: int
entity_id ID of the entity to test.
type of xyz_point: std::array< double,3 >
xyz_point A 3-element array {x, y, z} defining the point to test.
return type of : int
Returns
-1 on failure, 0 if outside, 1 if inside, 2 if on the boundary.

◆ is_scale_visibility_on()

def cubit.is_scale_visibility_on ( )

Check if the scale annotation is visible in the graphics window.

The scale annotation displays X, Y, and Z axes (with unit markings) at the bounding box of the current objects. It helps judge physical dimensions.

.. code-block:: python
import cubit
# Turn on the scale annotation and verify visibility
cubit.cmd ("Graphics Scale on" )
print("Scale visible?" , scaleVis)
 @n return type of :  boolean
Returns
true if the scale annotation is currently visible; false otherwise.

◆ is_select_partial_on()

def cubit.is_select_partial_on ( )

Check if partial selection is enabled.


return type of : boolean

Returns
true if partial picks are allowed; false otherwise.
.. code-block:: python
import cubit

◆ is_sheet_body()

def cubit.is_sheet_body (   volume_id )

Determine if a volume is a sheet body (zero thickness).

.. code-block:: python

# Create a solid brick (volume 1).
cubit.cmd ("brick x 10" )
# Copy surface 1 and move it by 1 unit in Z; this creates a new sheet body (ID 2).
cubit.cmd ("surface 1 copy move z 1" )
# Check if volume 2 is a sheet body.
is_sheet = cubit.is_sheet_body (2) # expected: True
print(is_sheet)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to query.
return type of : boolean
Returns
True if the volume is a sheet body (zero thickness); otherwise false.

◆ is_special_build()

def cubit.is_special_build (   build_type )

Check if a special build type is available.

Determines if the specified build_type corresponds to a special Cubit build or engine support compiled into this Cubit build. The comparison is case-insensitive and "acis", "catia", "goodyear", "granite", "machine_learning" ("ml"), "opencascade", and "sgm".

.. code-block:: python
import cubit
has_ml = cubit.is_special_build ("ml" )
print("ML special build available:" , has_ml)
 @n type of build_type:  string
Parameters
build_type Name of the special build to check (e.g., "acis", "catia", "ml"). Case-insensitive.
return type of : boolean
Returns
True if the specified special build type is available; false otherwise.

◆ is_surface_meshable()

def cubit.is_surface_meshable (   surface_id )

Check if a surface is meshable under the current meshing scheme.

Returns whether the specified surface can be meshed using the active mesh settings. Surfaces have a default scheme if none was explicitly set.

.. code-block:: python
import cubit
# Set the surface scheme to 'map' (default applies if not set):
cubit.cmd ("surface 17 scheme map" )
can_mesh = cubit.is_surface_meshable (17)
print("Surface 17 meshable under 'map'?" , can_mesh)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to test.
return type of : boolean
Returns
True if the surface is meshable; false otherwise.

◆ is_surface_planar()

def cubit.is_surface_planar (   surface_id )

◆ is_surface_planer()

def cubit.is_surface_planer (   surface_id )

Query whether a specified surface is planar.

Some workflows require distinguishing planar faces from curved ones. Both is_surface_planer (archaic spelling) and is_surface_planar are provided for compatibility; they behave identically.

.. code-block:: python
# Create a brick; surfaces 1-6 are planar.
cubit.cmd ("brick x 10" )
flat = cubit.is_surface_planar (1) # returns True
print(flat)
 @n type of surface_id:  int
Parameters
surface_id ID of the surface to query.
return type of : boolean
Returns
True if the surface is planar; otherwise false.

◆ is_type_filtered()

def cubit.is_type_filtered (   filter_type )

Check if a specific entity type is currently excluded from picking.

Returns true if the given type is in the pick filter list (i.e., will not be picked).

.. code-block:: python
import cubit
filtered = cubit.is_type_filtered ("surface" )
print("Surface filtered?" , filtered)
 @n type of filter_type:  string
Parameters
filter_type Entity type to test ("vertex", "curve", "surface", "volume", "node", "edge", "face", etc.).
return type of : boolean
Returns
True if that type is currently filtered out; false otherwise.

◆ is_undo_save_needed()

def cubit.is_undo_save_needed ( )

Check if the model requires an undo checkpoint save.

Returns true if any CAD operation has modified the model since the last call to set_undo_saved() .

.. code-block:: python
import cubit
cubit.cmd ('import "part.sat"' )
print(cubit.is_undo_save_needed ()) # True
print(cubit.is_undo_save_needed ()) # False
 @n return type of :  boolean
Returns
True if the model has changed since last undo save; false otherwise.

◆ is_virtual()

def cubit.is_virtual (   geometry_type,
  entity_id 
)

Query whether a specified geometry entity is virtual.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("composite create surf 1 6" ) # create composite surface (Surface ID = 7)
is_virt = cubit.is_virtual ("surface" , 7)
print("Surface 7 is virtual:" , is_virt)
cubit.cmd ("composite delete surf 7" ) # delete composite surface
is_virt = cubit.is_virtual ("surface" , 1)
print("Surface 1 is virtual:" , is_virt)
 @n type of geometry_type:  string
Parameters
geometry_type The type of geometry ("curve", "surface", "volume", etc.).
type of entity_id: int
entity_id The ID of the entity to query.
return type of : boolean
Returns
True if the specified entity is virtual; false otherwise.

◆ is_visible()

def cubit.is_visible (   geometry_type,
  entity_id 
)

Query visibility for a specific geometry entity.

.. code-block:: python

# Turn off visibility for volume 4
cubit.cmd ("vol 4 vis off" )

if not cubit.is_visible ("volume", 4): print("Volume 4 is now hidden.")

# Turn visibility back on for volume 4
cubit.cmd ("vol 4 vis on" )

if cubit.is_visible ("volume", 4): print("Volume 4 is now visible.")

  @n type of geometry_type:  string
Parameters
geometry_type The type of geometry ("curve", "surface", "volume", etc.).
type of entity_id: int
entity_id The ID of the entity to query.
return type of : boolean
Returns
True if the specified entity is currently visible; false otherwise.

◆ is_volume_meshable()

def cubit.is_volume_meshable (   volume_id )

Check if a volume is meshable under the current meshing scheme.

Returns whether the specified volume can be meshed using the active mesh settings. Volumes have a default scheme if none was explicitly set.

.. code-block:: python
import cubit
# Set the volume scheme to 'sweep' (default applies if not set):
cubit.cmd ("volume 42 scheme sweep" )
can_mesh = cubit.is_volume_meshable (42)
print("Volume 42 meshable under 'sweep'?" , can_mesh)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to test.
return type of : boolean
Returns
True if the volume is meshable; false otherwise.

◆ is_working_dir_set()

def cubit.is_working_dir_set ( )

Check if the "-workingdir" option was provided at Cubit startup.

Determines whether the user specified a working directory on the Cubit command line using -workingdir <path>.

.. code-block:: python
import cubit
print("Working dir set?" , cubit.is_working_dir_set ())
 @n return type of :  boolean
Returns
true if -workingdir was used when launching Cubit; false otherwise.

◆ journal_commands()

def cubit.journal_commands (   state )

Enable or disable journaling of Cubit commands.

Controls whether commands issued via cubit.cmd or API calls are recorded in the active journal file. Journaling is enabled by default when Cubit starts.

.. code-block:: python
import cubit
# Disable journaling using command
cubit.cmd ("set journal off" )
# Manually disable via API
# Re-enable journaling
 @n type of state:  boolean
Parameters
state True to enable journaling; false to disable it.

◆ load_ML()

def cubit.load_ML (   args,
  kwargs 
)

Load machine learning training data into memory.

This function loads and caches the specified machine learning models for immediate use in predictions or feature extraction. If a model is required by another ML function and not yet loaded, it will be loaded automatically. Calling this function explicitly ensures the model is loaded immediately.


type of model_type: string, optional

Parameters
model_type Specifies which data to load:
  • "all" : Load both classification and regression models.
  • "classification" : Load classification models only.
  • "regression" : Load regression models only.
    return type of : boolean
Returns
True if the data was loaded successfully; false otherwise.
 .. code-block:: python
# Example usage in Python
success = cubit.loadML("regression" )

if success: print("Regression models loaded.") else:

print("Failed to load models." )

◆ measure_between_entities()

def cubit.measure_between_entities (   entity_type1,
  entity_id1,
  entity_type2,
  entity_id2 
)

Returns the shortest distance between two geometry entities and their closest points.

Computes the closest points between two entities and returns the distance along with the coordinates of these points.

.. code-block:: python
# Geometry setup
cubit.cmd ("brick x 10" )
cubit.cmd ("vol 1 copy mov x 10.1 y 5" )
dist_info = cubit.measure_between_entities ("Vertex" , 12, "Volume" , 1)
dist = dist_info[0]
vertex_point = [dist_info[1], dist_info[2], dist_info[3]]
volume_point = [dist_info[4], dist_info[5], dist_info[6]]
print("Distance:" , dist)
print("Vertex point:" , tuple(vertex_point))
print("Volume point:" , tuple(volume_point))
# Expected Output:
# Distance: 0.1
# Vertex point: (5.1, 0.0, 5.0)
# Volume point: (5.0, 0.0, 5.0)
 @n type of entity_type1:  string
Parameters
entity_type1 Type of the first geometry entity.
type of entity_id1: int
entity_id1 ID of the first geometry entity.
type of entity_type2: string
entity_type2 Type of the second geometry entity.
type of entity_id2: int
entity_id2 ID of the second geometry entity.
 @n return type of : std::vector< double,std:: allocator< double > >
Returns
: A vector containing distance and coordinates [distance, x1, y1, z1, x2, y2, z2].

◆ ML_train()

def cubit.ML_train (   geom_type )

Force retraining of the ML classification model for a specific geometry type.

This function initiates a new training run for the specified classification operation. Currently, it is supported only for "volume_no_op" and "surface_no_op" models.


type of geom_type: string

Parameters
geom_type Geometry type to train ("volume" or "surface"), or operation name.
return type of : boolean
Returns
True if the training job was successfully triggered; false otherwise.
 .. code-block:: python
success = cubit.ML_train ("surface" )

if success: print("Training for surface model started successfully.") else:

print("Failed to trigger training for surface model." )

◆ move()

def cubit.move (   entity,
  vector,
  preview = False 
)

Translates an Entity by a specified vector.

Moves the given entity by the offset defined in vector . Use preview to display the translation without applying it.

   .. code-block:: python
# Create a unit cube (center at 0,0,0)
cubit.cmd ("brick x 1 y 1 z 1" )
# Move the cube (body 1) by (1, 2, 3)
b = cubit.body (1)
vec = [1.0, 2.0, 3.0]
cubit.move (b, vec, False )
# Get and print the center point of the moved body
pt = b.center_point()
print("Center Point:" , pt) # prints (1.0, 2.0, 3.0)
  @n type of entity:  :py:class:`Entity`, in
Parameters
entity The Entity to translate.
type of vector: std::array< double,3 >, in
vector The translation vector (x, y, z).
type of preview: boolean, in, optional
preview If true, show a preview without applying (default false).

◆ number_undo_commands()

def cubit.number_undo_commands ( )

Query the number of undoable commands in the stack.

.. code-block:: python

# Enable undo and perform three operations.
cubit.cmd ("set undo on" )
cubit.cmd ("brick x 10" )
cubit.cmd ("cylinder rad 3 height 12" )
cubit.cmd ("subtract vol 2 from vol 1" )
# Check the undo stack size (should be 3).
print("Undo stack size:" , count) # prints 3
# Undo the last operation (subtract).
cubit.cmd ("undo" )
# Check the stack size again (should be 2).
print("Undo stack size:" , count) # prints 2
 @n return type of :  int
Returns
The number of commands currently in the undo stack.

◆ parse_cubit_list()

def cubit.parse_cubit_list (   type,
  entity_list_string 
)

Parse a Cubit-style entity selection expression into a list of IDs.

Converts a free-form Cubit entity expression?supporting ranges, name patterns, and topological queries?into a flat list of integer IDs for the given type.

Title Supported syntax examples

  • "1 to 12" - IDs 1 through 12
  • "5,7,9" - IDs 5, 7, and 9
  • with name "my*" - all matching names
  • in volume 5 to 23 - surfaces or curves within volumes 5?23
.. code-block:: python
# Setup: create 4 bricks and name volumes
cubit.command("brick x 10" )
cubit.command("volume 1 copy move x 10 repeat 3" )
cubit.command('vol 1 name "widget1"' )
cubit.command('vol 2 name "widget2"' )
cubit.command('vol 3 name "gizmo1"' )
cubit.command('vol 4 name "gizmo2"' )
# 1) Curves 1?4 and 8
curve_ids = cubit.parse_cubit_list ('curve' , '1 to 4 8' )
print(tuple(curve_ids)) # (1, 2, 3, 4, 8)
# 2) Volumes named "widget*"
widget_ids = cubit.parse_cubit_list ('volume' , 'with name "widget*"' )
print(tuple(widget_ids)) # (1, 2)
# 3) Curves in volumes named "gizmo*"
gizmo_curve_ids = cubit.parse_cubit_list ('curve' , 'in volume with name "gizmo*"' )
print(tuple(gizmo_curve_ids)) # (25, 26, . . ., 48)
 @n type of type:  string
Parameters
type Entity type string (e.g., "vertex", "curve", "surface", "volume").
type of entity_list_string: string
entity_list_string Free-form Cubit selection expression.
return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of validated entity IDs matching the expression.

◆ parse_locations()

def cubit.parse_locations (   location_str )

Parse a Cubit location specification into concrete 3D coordinates.

Accepts any Cubit-style location expression and returns the resulting point(s) as x-y-z triples. See documentation for supported location options.

.. code-block:: python
# Create a brick
cubit.command("brick x 10" )
# Single point at absolute coordinates
pts1 = cubit.parse_locations ("1 2 3" )
print(pts1) # Output: ((1.0, 2.0, 3.0),)
# Coordinates of vertex 5
pts2 = cubit.parse_locations ("at vertex 5" )
print(pts2) # Output: ((5.0, 5.0, -5.0),)
# Multiple positions
pts3 = cubit.parse_locations ("position 1 2 3 position 4 5 6" )
print(pts3) # Output: ((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))
# Vertices in volume 1
pts4 = cubit.parse_locations ("at vertex in vol 1" )
print(pts4) # Output: ((5.0, -5.0, 5.0), (5.0, 5.0, 5.0), (-5.0, 5.0, 5.0), (-5.0, -5.0, 5.0), ...)
# Mesh the volume and get all nodes on curve 1
cubit.command("vol 1 size 2" )
cubit.command("mesh vol 1" )
pts5 = cubit.parse_locations ("at node in curve 1" )
print(pts5) # Output: ((5.0, -5.0, 5.0), (5.0, 5.0, 5.0), (5.0, -3.0, 5.0), (5.0, -1.0, 5.0), (5.0, 1.0, 5.0), (5.0, 3.0, 5.0))
 @n type of location_str:  string
Parameters
location_str Cubit location expression string.
return type of : std::vector< std::array< double,3 >,std::allocator< std:: array< double,3 > > >
Returns
Vector of 3-element arrays (x, y, z) for each parsed location.

◆ pause_playback()

def cubit.pause_playback ( )

Pause journal playback immediately.

Halts any ongoing playback of journal commands. Typically used within a journal file to pause execution for debugging or inspection. Playback can be resumed by calling resume_playback() .

.. code-block:: python
import cubit
# Perform initial setup
# (Assume these steps are part of a journal execution context)
# Pause playback for inspection
# Resume playback after inspection

◆ print_cmd_options()

def cubit.print_cmd_options ( )

Display Cubit's supported startup options.

Prints every command-line flag that the Cubit executable accepts when launched from a terminal, along with its syntax and description.

Example output (first few of many):

.. code-block:: c++

-Include <$val>        (Default path to search for input files)
-[no]banner            (Suppress printing of startup information.)
-[no]batch             (Batch Mode--No Interactive Command Input)
-debug <$val>          (Set specified flags on, e.g. 1,3,7-9 enables 1,3,7,8,9))
etc.                   (and many more options)

.. code-block:: python

import cubit

◆ print_current_selections()

def cubit.print_current_selections ( )

Print all selected entities and their types.

Outputs each selection in order (index, type, and ID) to the console.

.. code-block:: python

◆ print_currently_selected_entity()

def cubit.print_currently_selected_entity ( )

Print details of the current selected entity.

Shows the type and ID of the entity at the internal selection pointer.

.. code-block:: python

◆ print_info()

def cubit.print_info (   message )

Print a message through Cubit's messaging system.

Send an informational message to the Cubit message handler for display or logging.

.. code-block:: python
import cubit
cubit.print_info ("Processing complete." )
 @n type of message:  string
Parameters
message The text to be printed.

◆ print_raw_help()

def cubit.print_raw_help (   input_line,
  order_dependent,
  consecutive_dependent 
)

Display context-sensitive help while typing commands.

Called when the user presses one of the help keys ('?', '&', or '!') at the prompt. It prints relevant syntax or usage hints based on the current input line.

.. code-block:: python
import cubit
# User typed "mesh surface " then pressed '&'
line = "mesh surface "
order_dependent = False# key was '&'
consecutive_dependent = False# key was not '?'
cubit.print_raw_help (line, order_dependent, consecutive_dependent)
 @n type of input_line:  string
Parameters
input_line Current command-line text being edited.
type of order_dependent: int
order_dependent Set to 1 (true) if the key was '?' or '!'; set to 0 (false) if it was '&'.
type of consecutive_dependent: int
consecutive_dependent Set to 1 (true) if the key was '?' (allows repeated help); otherwise 0 (false).

◆ print_surface_summary_stats()

def cubit.print_surface_summary_stats ( )

Print summary statistics for all surfaces in the model.

Title Reported metrics

  • Number of surfaces measured and their average area
  • Minimum and maximum surface area, with corresponding surface IDs
  • Minimum hydraulic radius (area/perimeter) and the surface ID
  • Minimum curve length (smallest edge) with edge ID and surface ID
  • Maximum ratio of adjacent curve lengths on a surface and its surface ID
  • Minimum distance between loops on multi-loop surfaces (if applicable) and surface ID
  • Minimum distance between edges within a single loop and surface ID
  • Minimum and maximum interior angles between adjacent curves on a surface, with surface IDs
.. code-block:: python
# Create a 10x10x10 brick; surfaces 1-6 are generated.
cubit.cmd ("brick x 10" )
# Print summary statistics for all surfaces.

◆ print_volume_summary_stats()

def cubit.print_volume_summary_stats ( )

Print summary statistics for all volumes in the model.

Title Reported metrics

  • Total number of volumes measured and average volume
  • Minimum volume value and its volume ID
  • Minimum hydraulic radius (6 * volume/total_surface_area) and its volume ID
  • Minimum and maximum interior angles between any two faces in a volume, including the two face IDs and volume ID
  • Maximum area ratio between adjacent faces in a volume, including the larger and smaller face IDs and volume ID
  • Total counts of merged and unmerged surfaces across all volumes and their ratio
  • Number of shell groups found among the combined faces of all volumes and the name of the RefGroup containing those shells
  • Summary statistics for all surfaces in these volumes (calls print_surface_summary_stats())
.. code-block:: python
# Create two bricks and subtract the smaller from the larger.
cubit.cmd ("brick x 10" ) # volume 1
cubit.cmd ("brick x 5" ) # volume 2
cubit.cmd ("subtract vol 2 from vol 1" )
# Print summary statistics for all volumes.

◆ prism()

def cubit.prism (   height,
  sides,
  major,
  minor 
)

Create a prism of the specified dimensions.

Creates an extruded prism from a regular polygon base defined by major and minor radii. The prism height and number of sides specify its shape and extrusion.

   .. code-block:: python
import cubit
# 1) Create a regular hexagonal prism: height=3, sides=6, major radius=2, minor radius=2.
my_prism = cubit.prism (3, 6, 2, 2)
print("Prism ID:" , my_prism.id())
# 2) Create an elongated hexagonal prism: height=3, sides=6, major radius=4, minor radius=2.
my_prism = cubit.prism (3, 6, 4, 2)
print("Prism ID:" , my_prism.id())
  @n type of height:  float, in
Parameters
height Height of the prism.
type of sides: int, in
sides Number of sides of the base polygon.
type of major: float, in
major Major radius of the base polygon.
type of minor: float, in
minor Minor radius of the base polygon.
return type of : :py:class: Body
Returns
Body object representing the newly created prism geometry.

◆ project_unit_square()

def cubit.project_unit_square (   pts,
  surface_id,
  quad_id,
  node00_id,
  node10_id 
)

Map points in a unit square (u-v coordinates on a quad face) and project them onto a surface.

For each (u, v) in pts (with values in [0, 1], representing local coordinates on the quad face), this function uses node00_id (u=0, v=0) and node10_id (u=1, v=0) to locate the corresponding point on the quad (quad_id), then projects that 3D point onto the specified surface (surface_id). Returns the 3D coordinates of each projected point.

.. code-block:: python
# 1) Create a sphere of radius 1 (surface_id = 1, volume_id = 1).
cubit.cmd ("sphere rad 1" )
# 2) Set mesh size on volume 1 and mesh it.
cubit.cmd ("vol 1 size 1" )
cubit.cmd ("mesh vol 1" )
# 3) Define points in the unit square (u-v coordinates on quad face).
pts = [(0.25, 0.25), (0.5, 0.5), (0.75, 0.75)]
# 4) Project onto surface 1 using quad_id = 3, node00_id = 10, node10_id = 15.
positions = cubit.project_unit_square (pts, 1, 3, 10, 15)

for p in positions: print(p) # Each p is a list [x, y, z]

  @n type of pts:  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >
Parameters
pts A list of (u, v) pairs (each a length-2 vector) in [0, 1], representing local u-v coordinates on the quad face.
type of surface_id: int
surface_id ID of the surface onto which points are projected.
type of quad_id: int
quad_id ID of the quad face used to map unit-square coordinates.
type of node00_id: int
node00_id ID of the quad node corresponding to (u=0, v=0).
type of node10_id: int
node10_id ID of the quad node corresponding to (u=1, v=0).
return type of : std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std:: allocator< double > > > >
Returns
A list of 3-element vectors [x, y, z] representing each projected point.

◆ pyramid()

def cubit.pyramid (   height,
  sides,
  major,
  minor,
  top = 0.0 
)

Create a pyramid of specified dimensions.

Creates an extruded pyramid from a regular polygon base defined by major and minor radii. The apex or top plateau size can be specified.

   .. code-block:: python
import cubit
# 1) Create a pointed pyramid: height=4, sides=5, major radius=3, minor radius=2.
pyramid_point = cubit.pyramid (4, 5, 3, 2)
print("Pointed pyramid ID:" , pyramid_point.id())
# 2) Create a truncated pyramid (frustum): height=4, sides=5, major=3, minor=2, top radius=1.
pyramid_frustum = cubit.pyramid (4, 5, 3, 2, 1)
print("Frustum pyramid ID:" , pyramid_frustum.id())
  @n type of height:  float, in
Parameters
height Height of the pyramid.
type of sides: int, in
sides Number of sides of the base polygon.
type of major: float, in
major Major radius of the base polygon.
type of minor: float, in
minor Minor radius of the base polygon.
type of top: float, in, optional
top Top radius for a truncated pyramid (default = 0, pointed apex).
return type of : :py:class: Body
Returns
Body object representing the newly created pyramid geometry.

◆ reflect()

def cubit.reflect (   entity,
  axis,
  preview = False 
)

Reflects an Entity about a specified axis (e.g., plane normal).

Reflects the given entity across the plane perpendicular to axis . The original entity can be previewed without modification using preview .

   .. code-block:: python
# Create a unit cube (Body ID 1)
cubit.cmd ("brick x 1 y 1 z 1" )
# Move the cube along +X by 10 units
b = cubit.body (1)
cubit.move (b, [10.0, 0.0, 0.0], False )
# Reflect across the Y-Z plane (normal = X-axis)
axis = [1.0, 0.0, 0.0]
cubit.reflect (b, axis, False )
# Get and print the new center point
pt = b.center_point()
print("Center Point:" , pt) # prints (-10.0, 0.0, 0.0)
  @n type of entity:  :py:class:`Entity`, in
Parameters
entity The Entity to be reflected.
type of axis: std::array< double,3 >, in
axis The axis (normal) defining the reflection plane.
type of preview: boolean, in, optional
preview If true, show a preview without applying (default false).

◆ release_interface()

def cubit.release_interface (   instance )

Release a previously retrieved Cubit interface.

Decrements the reference count (or performs cleanup) for the given interface instance. After calling this, the pointer should not be used.

.. code-block:: python
import cubit
iface = cubit.get_interface ("MeshInterface" )

if iface is not None:

use iface ...

success = cubit.release_interface(iface) if not success: print("Failed to release interface")

  @n type of instance:  CubitBaseInterface
Parameters
instance Pointer to the CubitBaseInterface to release.
return type of : boolean
Returns
True if the interface was successfully released; false otherwise.

◆ remove_entity_from_group()

def cubit.remove_entity_from_group (   group_id,
  entity_id,
  entity_type 
)

Remove a specific entity from a given group.

.. code-block:: python

# Initialize geometry and group all vertices in volume 1.
cubit.cmd ("brick x 10" )
cubit.cmd ("group \"vert_group\" add vertex in vol 1" )
vert_group_id = cubit.get_id_from_name ("vert_group" )
# Remove vertex with ID 8 from the group.
cubit.remove_entity_from_group (vert_group_id, 8, "vertex" )
# Query remaining vertices in the group.
verts = cubit.get_group_vertices (vert_group_id)
print("Remaining vertices:" , len(verts)) # prints "7"
 @n type of group_id:  int
Parameters
group_id ID of the group from which the entity will be removed.
type of entity_id: int
entity_id ID of the entity to remove.
type of entity_type: string
entity_type Type of the entity (e.g., "vertex", "curve", "surface", "volume"). Only geometric entities are supported.
return type of : void
Returns
None.

◆ remove_filter_type()

def cubit.remove_filter_type (   filter_type )

Remove an entity type from the graphics pick filter.

Disallows picking of the specified entity type; other filters remain unchanged.

.. code-block:: python
import cubit
# Remove "curve" from the pick filter
 @n type of filter_type:  string
Parameters
filter_type Entity type to remove from the pickable set (e.g., "vertex", "curve", "surface", "volume", "node", "edge", "face").

◆ replace_progress_handler()

def cubit.replace_progress_handler (   progress )

Replace the current progress-bar callback handler and return the old one.

Unregisters the existing handler and replaces it with the given one. Returns the previous handler without deleting it.

.. code-block:: python
import cubit
new_handler = MyProgressHandler()
old_handler = cubit.replace_progress_handler (new_handler)
# old_handler can be reused or released by Python garbage collection
 @n type of progress:  :py:class:`CubitProgressHandler`
Parameters
progress Shared pointer to the new CubitProgressHandler instance.
return type of : :py:class: CubitProgressHandler
Returns
Shared pointer to the previous handler (may be null if none was set).

◆ reset()

def cubit.reset ( )

Reset Cubit state.

Clears all geometry and mesh data currently loaded in the session, returning Cubit to its initial state.

   .. code-block:: python
import cubit
# Create geometry and mesh
cubit.cmd ("brick x 10" )
cubit.cmd ("mesh volume 1" )
# Reset Cubit session
print("Cubit session has been reset." )

◆ reset_camera()

def cubit.reset_camera ( )

Reset the camera view and clear auxiliary graphics windows.

Restores the default view, closes dialogs, and clears overlays.

.. code-block:: python
import cubit
cubit.cmd ("from 10 5 15" )
cubit.cmd ("at 0 0 0" )
cubit.cmd ("up 0 1 0" )
cubit.cmd ("journal view" ) # display updated from/at/up

◆ resume_playback()

def cubit.resume_playback ( )

Resume a paused journal playback.

Continues journal playback after it has been paused, either manually via pause_playback() or automatically due to an error when playback-paused-on-error is enabled.

.. code-block:: python
import cubit
# Assume playback was paused earlier (manually or on error)

◆ scale()

def cubit.scale (   entity,
  factor,
  preview = False 
)

Scales an Entity uniformly by a specified factor.

Scales the given entity by factor in all directions. Use preview to display the scaled geometry without applying it.

   .. code-block:: python
# Create a 5x5x5 cube (Body ID 1)
cubit.cmd ("brick x 5" )
# Scale the cube by a factor of 2
b = cubit.body (1)
cubit.scale (b, 2.0, False )
# Get and print the new volume
vol = b.volume()
print("Volume:" , vol) # prints 1000
  @n type of entity:  :py:class:`Entity`, in
Parameters
entity The Entity to scale.
type of factor: float, in
factor The uniform scale factor.
type of preview: boolean, in, optional
preview If true, show a preview without applying (default false).

◆ set_copy_block_on_geometry_copy_setting()

def cubit.set_copy_block_on_geometry_copy_setting (   val )

Set the behavior for block propagation during geometry copy.

Valid settings:

  • "ON": Create new blocks on copied geometry/mesh, mirroring the original.
  • "USE_ORIGINAL": Add copied geometry/mesh to the original block.
  • "OFF": Do not copy block to the new geometry/mesh.
.. code-block:: python
print("Set to OFF, success:" , success)
print("Current setting:" , setting)
print("Set to ON, success:" , success)
print("Current setting:" , setting)
 @n type of val:  string
Parameters
val Desired setting ("ON", "USE_ORIGINAL", or "OFF").
return type of : boolean
Returns
True if setting was successfully applied, false otherwise.

◆ set_copy_nodeset_on_geometry_copy_setting()

def cubit.set_copy_nodeset_on_geometry_copy_setting (   val )

Set the behavior for nodeset propagation during geometry copy.

Valid settings:

  • "ON": Create new nodesets on copied geometry/mesh, mirroring the original.
  • "USE_ORIGINAL": Add copied geometry/mesh to the original nodeset.
  • "OFF": Do not copy nodeset to the new geometry/mesh.
.. code-block:: python
print("Set to OFF, success:" , success)
print("Current setting:" , setting)
print("Set to ON, success:" , success)
print("Current setting:" , setting)
 @n type of val:  string
Parameters
val Desired setting ("ON", "USE_ORIGINAL", or "OFF").
return type of : boolean
Returns
True if setting was successfully applied, false otherwise.

◆ set_copy_sideset_on_geometry_copy_setting()

def cubit.set_copy_sideset_on_geometry_copy_setting (   val )

Set the behavior for sideset propagation during geometry copy.

Valid settings:

  • "ON": Create new sidesets on copied geometry/mesh, mirroring the original.
  • "USE_ORIGINAL": Add copied geometry/mesh to the original sideset.
  • "OFF": Do not copy sideset to the new geometry/mesh.
.. code-block:: python
print("Set to OFF, success:" , success)
print("Current setting:" , setting)
print("Set to ON, success:" , success)
print("Current setting:" , setting)
 @n type of val:  string
Parameters
val Desired setting ("ON", "USE_ORIGINAL", or "OFF").
return type of : boolean
Returns
True if setting was successfully applied, false otherwise.

◆ set_cubit_interrupt()

def cubit.set_cubit_interrupt (   interrupt )

Enable or disable interruptible operations in Cubit.

When set to true, any interruptible Cubit process will be stopped at the next interrupt check.

.. code-block:: python
import cubit
# Disable interrupts
# Enable interrupts
 @n type of interrupt:  boolean
Parameters
interrupt True to stop interruptible processes, false to allow them.

◆ set_cubit_message_handler()

def cubit.set_cubit_message_handler (   hdlr )

Redirect Cubit output to a custom message handler.

Replace the default Cubit message handler so that all subsequent messages are routed to the provided handler instance, which must implement print_message() and/or print_error().

.. code-block:: python
import cubit

class MyHandler(cubit.CubitMessageHandler ): def print_message(self, message):

print("[Info]" , message)

def print_error(self, message): print("[Error]", message, file=sys.stderr)

handler = MyHandler()
 @n type of hdlr:  :py:class:`CubitMessageHandler`
Parameters
hdlr Shared pointer to a CubitMessageHandler that will receive messages.

◆ set_element_variable()

def cubit.set_element_variable (   element_ids,
  variable_name,
  variables 
)

Sets scalar variables on specified mesh elements for Exodus export.

Assigns the element variable named variable_name to the elements in element_ids , using the corresponding values in variables . If variables contains a single entry, that value is applied to all elements; otherwise, its length must match element_ids . When exporting the mesh to an Exodus file, these element variables will be included for downstream analysis.

   .. code-block:: python
# Create a rectangular surface and mesh to generate elements
cubit.cmd ("create surface rectangle width 10" )
cubit.cmd ("mesh surface 1" )
# Define block 1 using surface 1 to specify global element IDs
cubit.cmd ("block 1 surface 1" )
# Assign 'compression' variable to elements in block 1
element_ids = [1, 2, 3, 4] # IDs derived from block 1
var_name = "compression"
values = [1.2, 1.53, 2.3, 9.5]
cubit.set_element_variable (element_ids, var_name, values)
# Export mesh to Exodus to include element variables
cubit.cmd ("export mesh \"output.e\"" )
  @n type of element_ids:  std::vector< int,std::allocator< int > >, in
Parameters
element_ids List of element IDs to assign variables to.
type of variable_name: string, in
variable_name Name of the element variable.
type of variables: std::vector< double,std::allocator< double > >, in
variables Values for each element (single value applies to all elements).

◆ set_entity_name()

def cubit.set_entity_name (   entity_type,
  entity_id,
  new_name 
)

Set the name of a specified entity.

Equivalent to the command:

.. code-block:: c++

{Body|Volume|Surface|Curve|Vertex} <id_range> name '<name_string>'

For example, to name vertex 22 "point_load":

.. code-block:: c++

Vertex 22 name 'point_load'

.. code-block:: python

success = cubit.set_entity_name ("vertex" , 22, "point_load" )

if success: print("Rename succeeded")

  @n type of entity_type:  string
Parameters
entity_type Type of the entity ("body", "volume", "surface", "curve", or "vertex").
type of entity_id: int
entity_id ID of the entity to rename.
type of new_name: string
new_name The new name to assign to the entity.
return type of : boolean
Returns
True if the entity was found and renamed; otherwise false.

◆ set_exit_handler()

def cubit.set_exit_handler (   hdlr )

Set a custom exit callback for Cubit.

Provide an ExternalExitHandler-derived instance to handle Cubit's exit events.

.. code-block:: python
import cubit

class MyExitHandler(cubit.ExternalExitHandler ): def handle_exit_event(self, code):

print(f"Cubit exiting with code {code}, cleaning up..." )
handler = MyExitHandler()
 @n type of hdlr:  :py:class:`ExternalExitHandler`
Parameters
hdlr Pointer to an ExternalExitHandler implementation that will be called when Cubit exits.

◆ set_filter_types()

def cubit.set_filter_types (   num_types,
  filter_types 
)

Set multiple pick filter types for graphics selections.

Configures the graphics system to allow picking any entity whose type is in the provided list. Overrides any previously set pick filters.

.. code-block:: python
import cubit
# Enable picking of surfaces and curves
cubit.set_filter_types (2, ["surface" , "curve" ])
 @n type of num_types:  int
Parameters
num_types Number of entity types in filter_types.
type of filter_types: std::vector< std::string,std::allocator< std::string > >
filter_types Vector of entity-type strings to enable for picking. Valid values include "vertex", "curve", "surface", "volume", "node", "edge", "face", etc.

◆ set_label_type()

def cubit.set_label_type (   entity_type,
  label_flag 
)

Sets label display type for a given entity type.

Controls how labels are displayed for the specified entity type in the graphics window.

Valid entity_type values:

"RefVolume" , "RefFace" , "RefEdge" , "RefVertex" ,
"CubitHex" , "CubitTet" , "CubitFace" , "CubitTri" ,
"CubitEdge" , "CubitNode" , "CubitSphere"

Label flag values ( SVUtil::LabelType ): 0=CUBIT_LABEL_NONE, 1=CUBIT_LABEL_ID, 2=CUBIT_LABEL_ELEMENT_ID, 3=CUBIT_LABEL_NAME, 4=CUBIT_LABEL_INTERVAL, 5=CUBIT_LABEL_SIZE, 6=CUBIT_LABEL_MERGE, 7=CUBIT_LABEL_IS_MERGED, 8=CUBIT_LABEL_FIRMNESS, 9=CUBIT_LABEL_SCHEME, 10=CUBIT_LABEL_NAME_ID, 11=CUBIT_LABEL_NAME_ONLY, 12=CUBIT_LABEL_SPHERE_ID

.. code-block:: python
cubit.set_label_type ("RefFace" , 1) # Show face IDs
 @n type of entity_type:  string
Parameters
entity_type Entity type to label.
type of label_flag: int
label_flag Label display type.
 @n return type of :  void
Returns
None.

◆ set_max_group_id()

def cubit.set_max_group_id (   maximum_group_id )

Reset Cubit's internal maximum group ID to a specified value.

Cubit tracks a monotonically increasing next group ID. GUI power tools may create and delete groups behind the scenes, incrementing Cubit's group ID counter and causing downstream journal files to reference unexpected IDs. This function restores control by resetting Cubit's max group ID, but only when the specified maximum_group_id matches Cubit's current highest ID?otherwise no change occurs.

Warning
Use sparingly. An incorrect maximum_group_id can desynchronize journal files or lead to ID collisions.


type of maximum_group_id: int

Parameters
maximum_group_id The desired maximum group ID to enforce (must equal Cubit's current max ID).
return type of : void
Returns
None.

◆ set_ML_base_user_dir()

def cubit.set_ML_base_user_dir (   path,
  print_info = False 
)

Set the root directory for user-provided ML training data (classification only).

Specifies the location of user training files for classification operations. The directory must contain subfolders matching the ML operation names (e.g., "ml/volume_no_op").


type of path: string

Parameters
path Top-level path to the user training data directory.
type of print_info: boolean, optional
print_info If true, output status messages about directory setup.
   .. code-block:: python
data_dir = "/path/to/user/training/data"
cubit.set_ML_base_user_dir (data_dir, True )

◆ set_modified()

def cubit.set_modified ( )

Reset the model's modified status to "unmodified".

Clears the internal flag so that is_modified() returns false until the next CAD operation.

.. code-block:: python
import cubit
cubit.cmd ('import "part.sat"' )
# Now:
print(cubit.is_modified ()) # False
cubit.cmd ("remove surface 10" )
print(cubit.is_modified ()) # True

◆ set_nodal_variable()

def cubit.set_nodal_variable (   node_ids,
  variable_name,
  variables 
)

Sets scalar variables on specified mesh nodes.

Assigns the nodal variable named variable_name to the nodes in node_ids , using the corresponding values in variables . If variables contains a single value, that value is applied to all nodes; otherwise, its length must match node_ids . When exporting to Exodus, these nodal values will be included for analysis.

   .. code-block:: python
# Create a rectangular sheet and mesh it to generate nodes
cubit.cmd ("create surface rectangle width 10" )
cubit.cmd ("mesh surface 1" )
# Assign compression variable to nodes 1, 2, 3, and 4
node_ids = [1, 2, 3, 4]
var_name = "compression"
values = [1.2, 1.53, 2.3, 9.5]
cubit.set_nodal_variable (node_ids, var_name, values)
  @n type of node_ids:  std::vector< int,std::allocator< int > >, in
Parameters
node_ids List of node IDs to assign variables to.
type of variable_name: string, in
variable_name Name of the nodal variable.
type of variables: std::vector< double,std::allocator< double > >, in
variables Values for each node (single value applies to all nodes).

◆ set_overlap_max_angle()

def cubit.set_overlap_max_angle (   maximum_angle )

Set the maximum angle tolerance for calculating surface overlaps.

Updates the threshold that defines how much angular difference between surface normals can exist before surfaces are considered non-overlapping. Smaller values enforce stricter overlap detection by requiring surfaces to be nearly coplanar.

.. code-block:: python
# Set the overlap max angle to 5 degrees.
# Verify the new setting.
new_max_angle = cubit.get_overlap_max_angle ()
print("New overlap max angle:" , new_max_angle)
 @n type of maximum_angle:  float
Parameters
maximum_angle The new maximum angle tolerance (in degrees) to use when testing surface overlaps.

◆ set_overlap_max_gap()

def cubit.set_overlap_max_gap (   maximum_gap )

Set the maximum gap tolerance for calculating surface overlaps.

Updates the threshold that defines how large a gap between two surfaces can be before they are considered non-overlapping. Smaller values make the overlap test more stringent, while larger values allow greater discrepancies.

.. code-block:: python
# Set the overlap max gap to 0.01 model units.
# Verify the new setting.
new_max_gap = cubit.get_overlap_max_gap ()
print("New overlap max gap:" , new_max_gap)
 @n type of maximum_gap:  float
Parameters
maximum_gap The new maximum gap tolerance (in model units) to use when testing surface overlaps.

◆ set_overlap_min_gap()

def cubit.set_overlap_min_gap (   min_gap )

Set the minimum gap tolerance for calculating surface overlaps.

Updates the threshold that defines how small a gap between two surfaces can be before they are considered overlapping. Smaller values enforce stricter overlap detection by ignoring only very tiny gaps.

.. code-block:: python
# Set the overlap min gap to 0.0001 model units.
# Verify the new setting.
new_min_gap = cubit.get_overlap_min_gap ()
print("New overlap min gap:" , new_min_gap)
 @n type of min_gap:  float
Parameters
min_gap The new minimum gap tolerance (in model units) to use when testing surface overlaps.

◆ set_pick_type()

def cubit.set_pick_type (   pick_type,
  silent = False 
)

Set the current pick mode for entity selection.

Specifies which entity type the graphics system will select on the next pick. This determines the output of get_selected_ids() and pick dialogs.

.. code-block:: python
import cubit
# Change pick mode to surface (prints confirmation)
cubit.set_pick_type ("surface" )
# Change pick mode to volume silently (no confirmation)
cubit.set_pick_type ("volume" , True )
 @n type of pick_type:  string
Parameters
pick_type Entity type to pick. Valid values include: "vertex", "curve", "surface", "volume", "node", "edge", "face", etc.
type of silent: boolean, optional
silent If true, suppress the console message confirming the change. Defaults to false (confirmation printed).

◆ set_playback_paused_on_error()

def cubit.set_playback_paused_on_error (   pause )

Configure whether playback pauses on error.

Controls whether Cubit pauses journal playback automatically when an error occurs, allowing inspection before continuing.

.. code-block:: python
# Python example
import cubit
# Enable pause on error during journal playback
# Run a journal file; playback will pause if an error occurs
cubit.cmd ("play 'test.jou'" )
# Disable pause on error
 @n type of pause:  boolean
Parameters
pause True to pause playback on error; false to continue automatically.

◆ set_progress_handler()

def cubit.set_progress_handler (   progress )

Register a progress-bar callback handler with Cubit.

Sets the given handler as the active progress-bar callback. If a handler is already registered, it is released (but not returned).

.. code-block:: python
import cubit

class MyProgressHandler(cubit.CubitProgressHandler ): def start(self, title, info_string, hasCancel): print {info_string}") def end(self): print("Progress complete.") def percent(self, pcnt): print {pcnt * 100:.1f}%", end="\r") def check_interrupt(self): return False

handler = MyProgressHandler()


type of progress: :py:class: CubitProgressHandler

Parameters
progress Shared pointer to a CubitProgressHandler instance.

◆ set_rendering_mode()

def cubit.set_rendering_mode (   mode )

Set the current graphics rendering mode (equivalent to "Graphics Mode <option>").

This is the programmatic equivalent of the Cubit command:

where mode can be one of HiddenLine , TrueHiddenLine , SmoothShade , Transparent , WireFrame , or GeomFacet . Instead of a string, this function accepts an integer code:

  • 0 = WireFrame
  • 1 = HiddenLine
  • 2 = TrueHiddenLine
  • 3 = SmoothShade
  • 4 = Transparent
  • 5 = GeomFacet
Python example (for reference):

.. code-block:: python
import cubit
# Equivalent to: cubit.cmd("Graphics Mode SmoothShade")


type of mode: int

Parameters
mode Integer code for the rendering mode (0-5), corresponding to: 0=WireFrame, 1=HiddenLine, 2=TrueHiddenLine, 3=SmoothShade, 4=Transparent, 5=GeomFacet.

◆ set_undo_saved()

def cubit.set_undo_saved ( )

Clear the undo-needed flag for the model.

Marks the current model state as saved for undo purposes. After calling, is_undo_save_needed() returns false until the next modifying operation.

.. code-block:: python
import cubit

◆ silent_cmd()

def cubit.silent_cmd (   input_string )

Execute a Cubit command without echoing or verbose output.

Behaves like cmd() , but suppresses prompt echo and messages–ideal for scripting.

.. code-block:: python
import cubit
ok = cubit.silent_cmd ("mesh volume 1" )
 @n type of input_string:  string
Parameters
input_string C-string containing the complete Cubit command.
return type of : boolean
Returns
true if the command executed successfully; false otherwise.

◆ snap_locations_to_geometry()

def cubit.snap_locations_to_geometry (   locations,
  entity_type,
  entity_id,
  tol 
)

Snaps given XYZ locations to nearest points on specified entity.

Points are first snapped to the closest location on the specified entity. Within the provided tolerance, points are then snapped preferentially to vertices, followed by curves.

.. code-block:: python
# Geometry setup
cubit.cmd ("sphere rad 1" )
cubit.cmd ("split periodic vol 1" ) # creates a curve at the equator
locations = [[1, 0.001, 0], [1, 1, 1], [-1, 0.1, 0]]
snapped_xyz_vec = cubit.snap_locations_to_geometry (locations, "body" , 1, 0.01)
print(snapped_xyz_vec)
# Expected Output:
# ((1.0, 0.0, 0.0), (0.577350, 0.577350, 0.577350), (-0.995037, 0.099504, 0.0))
 @n type of locations:  std::vector< std::array< double,3 >,std::allocator< std::array< double,3 > > >
Parameters
locations A vector of XYZ points to snap.
type of entity_type: string
entity_type Type of entity (e.g., "volume", "surface", "curve").
type of entity_id: int
entity_id ID of the target entity.
type of tol: float
tol Tolerance for snapping to vertices and curves.
 @n return type of : std::vector< std::array< double,3 >,std::allocator< std:: array< double,3 > > >
Returns
A vector of snapped XYZ points corresponding to input locations.

◆ sphere()

def cubit.sphere (   radius,
  x_cut = 0,
  y_cut = 0,
  z_cut = 0,
  inner_radius = 0 
)

Create all or part of a sphere.

Creates a spherical geometry of given radius. Optional planar cuts (along the yz, xz, or xy planes) and an inner radius for hollow spheres can be specified.

   .. code-block:: python
import cubit
# 1) Create a full sphere of radius 1.
full_sphere = cubit.sphere (1.0)
print("Full sphere Body ID:" , full_sphere.id())
print("Sphere volume:" , full_sphere.volume())
# Expected output:
# Full sphere Body ID: 1
# Sphere volume: 4.18879
# 2) Create a half-sphere (cut by yz-plane).
half_sphere = cubit.sphere (1.0, 1)
print("Half-sphere Body ID:" , half_sphere.id())
print("Half-sphere volume:" , half_sphere.volume())
# Expected output:
# Half-sphere Body ID: 2
# Half-sphere volume: 2.0940168474871794
# 3) Create a hollow sphere: outer radius 5, inner radius 3.
hollow_sphere = cubit.sphere (5.0, 0, 0, 0, 3.0)
print("Hollow sphere Body ID:" , hollow_sphere.id())
print("Hollow sphere volume:" , hollow_sphere.volume())
# Expected output:
# Hollow sphere Body ID: 3
# Hollow sphere volume: 410.5014400690663
  @n type of radius:  float, in
Parameters
radius Radius of the sphere.
type of x_cut: int, in, optional
x_cut If 1, cut sphere by the yz-plane (default = 0).
type of y_cut: int, in, optional
y_cut If 1, cut sphere by the xz-plane (default = 0).
type of z_cut: int, in, optional
z_cut If 1, cut sphere by the xy-plane (default = 0).
type of inner_radius: float, in, optional
inner_radius Inner radius for a hollow sphere (default = 0).
return type of : :py:class: Body
Returns
Body object representing the newly created sphere geometry.

◆ step_next_possible_selection()

def cubit.step_next_possible_selection ( )

Advance to the next entity in the current selection list.

Moves the internal selection pointer forward, updating which entity is considered the "current" selection for print_currently_selected_entity() .

.. code-block:: python

◆ step_previous_possible_selection()

def cubit.step_previous_possible_selection ( )

Move back to the previous entity in the current selection list.

Moves the internal selection pointer backward, so that the "current" selection reverts to the one before the last step.

.. code-block:: python

◆ stop_playback()

def cubit.stop_playback ( )

Stop journal playback entirely.

Immediately terminates the execution of a journal file. This is typically used within a journal to abort playback due to errors or conditional logic. To restart, use resume_playback() or manually reissue commands.

.. code-block:: python
import cubit
# Check some condition, then stop playback if needed
# Playback will not continue past this point

◆ string_from_id_list()

def cubit.string_from_id_list (   ids )

Convert a list of integers into a compact Cubit-style ID string.

Collapses consecutive IDs into "start to end" ranges, separates entries with commas, and inserts line breaks at 80 characters for readability.

Title Examples:

  • {1,2,3,4,5,6,7,8} -> "1 to 8\n"
  • {1,2,3,100,5,6,7,8} -> "1 to 3, 5 to 8, 100\n"
.. code-block:: python
import cubit
ids = [1, 2, 3, 4]
# s == "1 to 4\n"
 @n type of ids:  std::vector< int,std::allocator< int > >
Parameters
ids Vector of integer IDs to format.
return type of : string
Returns
String containing ranges and line breaks at column 80.

◆ subtract()

def cubit.subtract (   tool_in,
  from_in,
  imprint_in = False,
  keep_old_in = False 
)

Performs a boolean subtract operation: removes tool bodies from target bodies.

Subtracts each body in tool_in from the corresponding body in from_in . The subtraction can imprint shared geometry if imprint_in is true, and the original bodies can be preserved if keep_old_in is true.

   .. code-block:: python
# Create a box (Body ID 1) and a cylinder (Body ID 2)
cubit.cmd ("brick x 10" ) # Volume 1000
cubit.cmd ("cylinder radius 3 height 10" ) # Volume ~282.74
# Define tool and target bodies
tool = cubit.body (2)
target = cubit.body (1)
# Subtract cylinder from box
result = cubit.subtract ([tool], [target], False , False )
b = result[0]
print("Resulting Body ID:" , b.id())
print("Volume:" , b.volume()) # prints ~717.26
  @n type of tool_in:  std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
Parameters
tool_in Bodies to subtract (tools).
type of from_in: std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
from_in Bodies to subtract from (targets).
type of imprint_in: boolean, in, optional
imprint_in True to imprint shared geometry (default false).
type of keep_old_in: boolean, in, optional
keep_old_in True to retain the original bodies (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of Body objects representing the resulting bodies after subtraction.

◆ surface()

def cubit.surface (   id_in )

Retrieve a surface object by its ID.

Retrieves the surface object corresponding to the provided ID.

   .. code-block:: python
import cubit
# Create a 10x10x10 brick (surface IDs include the outer faces).
cubit.cmd ("brick x 10" )
# Retrieve surface with ID 1.
surface = cubit.surface (1)
print("Surface ID:" , surface.id())
  @n type of id_in:  int
Parameters
id_in ID of the surface to retrieve.
return type of : :py:class: Surface
Returns
Surface object corresponding to the specified ID.

◆ sweep_curve()

def cubit.sweep_curve (   curves,
  along_curves,
  draft_angle,
  draft_type,
  rigid 
)

Sweep one or more curves along a path to create sheet bodies.

Constructs sheet bodies by sweeping the specified cross-section curves along the given path curves. Optional draft angle, draft type, and rigidity control taper and rounding behavior. This creates surface bodies (no solid volume); each returned Body contains exactly one Surface . Use the body's surfaces() method to access it and obtain area.

   .. code-block:: python
import cubit
# Create section curve.
v0 = cubit.create_vertex (0, 0, 0)
v1 = cubit.create_vertex (1, 0, 0)
section = cubit.create_curve (v0, v1)
# Create path curve.
p0 = cubit.create_vertex (0, 0, 0)
p1 = cubit.create_vertex (0, 0, 1)
path = cubit.create_curve (p0, p1)
# Sweep with default parameters.
bodies = cubit.sweep_curve ([section], [path])
# We expect one sheet body.
sheet = bodies[0]
print("Sheet Body ID:" , sheet.id())
# Retrieve its surface and print area.
surface = sheet.surfaces()[0]
print("Surface area:" , surface.area())
# Expected output:
# Sheet Body ID: 1
# Surface area: 1.0
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curves Cross-section curves to sweep.
type of along_curves: std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
along_curves Path curves defining the sweep trajectory.
type of draft_angle: float, in
draft_angle Angle (in degrees) for draft taper (default = 0).
type of draft_type: int, in
draft_type Draft type: 0=extended, 1=rounded, 2=natural (default = 0).
type of rigid: boolean, in
rigid If true, maintains cross-section rigidity (default = false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
Vector of sheet Body objects created by the sweep (each contains one Surface). :raises: CubitFailureException Thrown if input is invalid or sweep fails.

◆ temperature_is_on_shell_area()

def cubit.temperature_is_on_shell_area (   bc_type_enum,
  bc_area_enum,
  entity_id 
)

Check if a temperature BC is on a shell area.


type of bc_type_enum: int

Parameters
bc_type_enum BC type (temperature = 4, convection = 7).
type of bc_area_enum: int
bc_area_enum CI_BCEntityTypes: 7 (top), 8 (bottom), 9 (gradient), 10 (middle).
type of entity_id: int
entity_id ID of the BC.
return type of : boolean
Returns
True if the temperature BC is on the specified shell area.

◆ temperature_is_on_solid()

def cubit.temperature_is_on_solid (   bc_type_enum,
  entity_id 
)

Check if a temperature BC is applied to a solid region.

Valid for temperature and convection BCs.


type of bc_type_enum: int

Parameters
bc_type_enum BC type (temperature = 4, convection = 7).
type of entity_id: int
entity_id ID of the boundary condition.
return type of : boolean
Returns
True if temperature BC is on a solid.

◆ torus()

def cubit.torus (   center_radius,
  swept_radius 
)

Create a torus of specified dimensions.

Creates a toroidal geometry defined by the distance from center to the center of the swept circle (major radius) and the radius of the swept circle (minor radius).

   .. code-block:: python
import cubit
# 1) Create a torus: center_radius=5, swept_radius=1.
torus1 = cubit.torus (5, 1)
print("Torus ID:" , torus1.id())
print("Torus volume:" , torus1.volume())
# Expected output:
# Torus ID: 1
# Torus volume: 98.69604
# 2) Create a thick torus: center_radius=3, swept_radius=2.
torus2 = cubit.torus (3, 2)
print("Torus ID:" , torus2.id())
print("Torus volume:" , torus2.volume())
# Expected output:
# Torus ID: 2
# Torus volume: 236.87051
  @n type of center_radius:  float, in
Parameters
center_radius Distance from torus center to center of swept circle (major radius, must be > swept_radius).
type of swept_radius: float, in
swept_radius Radius of the circle to be swept (minor radius, must be < center_radius).
return type of : :py:class: Body
Returns
Body object representing the newly created torus geometry.

◆ tweak_curve_offset()

def cubit.tweak_curve_offset (   curves,
  distances,
  keep_old = False,
  preview = False 
)

2D equivalent of tweak_surface_offset: offsets specified curves on a sheet body.

Offsets each curve in curves by the corresponding value in distances on a 2D sheet body. The original sheet can be retained via keep_old , and a preview generated via preview .

   .. code-block:: python
# Create a rectangular sheet with width 10 (height defaults to 10)
cubit.cmd ("create surface rectangle width 10" )
# Offset curve 1 by 10 units
curves = [ cubit.curve (1) ]
distances = [ 10.0 ]
bodies = cubit.tweak_curve_offset (curves, distances, False , False )
# Only one sheet body is returned
b = bodies[0]
print("Body ID:" , b.id())
# Get the first surface from the sheet and print its area
surf = b.surfaces()[0]
area = surf.area()
print("Surface Area:" , area) # prints 200
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curves List of Curve objects to offset.
type of distances: std::vector< double,std::allocator< double > >, in
distances List of distances for each curve (in model units).
type of keep_old: boolean, in, optional
keep_old True to retain the original sheet body (default false).
type of preview: boolean, in, optional
preview True to generate a preview without modifying geometry (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of sheet Body objects representing the resulting bodies after offset.

◆ tweak_curve_remove()

def cubit.tweak_curve_remove (   curves,
  keep_old = False,
  preview = False 
)

Removes specified curves and extends adjacent surfaces on a sheet body.

2D equivalent of tweak_surface_remove. Removes each curve (edge) in curves from a 2D sheet body. Adjacent surfaces are extended to fill the gap created by removal. The original sheet can be retained via keep_old , and a preview can be generated without modification when preview is true.

   .. code-block:: python
# Create a rectangular sheet with width 10
cubit.cmd ("create surface rectangle width 10" )
# Fillet vertex 1 with radius 1 (creates curve ID 5)
cubit.cmd ("tweak vertex 1 fillet radius 1" )
# Remove the fillet curve (ID 5)
curves = [ cubit.curve (5) ]
bodies = cubit.tweak_curve_remove (curves, False , False )
# Only one sheet body is returned
b = bodies[0]
print("Body ID:" , b.id())
# Get the first surface from the sheet and print its area
surf = b.surfaces()[0]
area = surf.area()
print("Surface Area:" , area) # prints 100
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curves List of Curve objects to remove.
type of keep_old: boolean, in, optional
keep_old True to retain the original sheet body (default false).
type of preview: boolean, in, optional
preview True to generate a preview without modifying geometry (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of sheet Body objects representing the resulting bodies after curve removal.

◆ tweak_surface_offset()

def cubit.tweak_surface_offset (   surfaces,
  distances 
)

Offsets specified surfaces by given distances.

Offsets each surface in surfaces by the corresponding value in distances , modifying the geometry and returning the resulting bodies (one per set of inputs).

 .. code-block:: python
# Create a 1x1x1 brick; surfaces 1-6 are generated.
cubit.cmd ("brick x 1 y 1 z 1" )
# Offset surface 1 by 1 unit
surfaces = [ cubit.surface (1) ]
distances = [ 1.0 ]
bodies = cubit.tweak_surface_offset (surfaces, distances)
# Only one body is returned
b = bodies[0] # returns 1
print("Body ID:" , b.id())
vol = b.volume() # returns 2
print("Volume:" , vol)
@n type of surfaces:  std::vector< CubitInterface::Surface,std::allocator< CubitInterface::Surface > >
Parameters
surfaces List of Surface objects to offset.
type of distances: std::vector< double,std::allocator< double > >
distances List of distances for each surface (positive values offset outward).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of Body objects corresponding to the modified geometry (one Body for each offset operation).

◆ tweak_surface_remove()

def cubit.tweak_surface_remove (   surfaces,
  extend_ajoining = True,
  keep_old = False,
  preview = False 
)

Removes specified surfaces from a body, optionally extending adjacent surfaces.

Removes each surface in surfaces from its body. If extend_ajoining is true, adjacent surfaces are extended to close the gap. The original body can be retained via keep_old , and a preview can be generated without modification when preview is true.

   .. code-block:: python
# Create a brick with x-length 10
cubit.cmd ("brick x 10" )
# Add a blend on curve 12 with radius 1
cubit.cmd ("modify curve 12 blend radius 1" )
# Remove the blend surface (ID 7)
surfaces = [ cubit.surface (7) ]
bodies = cubit.tweak_surface_remove (surfaces, True , False , False )
# Only one body is returned
b = bodies[0]
print("Body ID:" , b.id())
# Get the volume of the resulting brick
vol = b.volume() # returns 1000
print("Volume:" , vol) # prints 1000
  @n type of surfaces:  std::vector< CubitInterface::Surface,std::allocator< CubitInterface::Surface > >, in
Parameters
surfaces List of Surface objects to remove.
type of extend_ajoining: boolean, in, optional
extend_ajoining True to extend adjacent surfaces (default true).
type of keep_old: boolean, in, optional
keep_old True to retain the original body (default false).
type of preview: boolean, in, optional
preview True to generate a preview without modifying geometry (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of Body objects representing the resulting bodies after removal.

◆ tweak_vertex_fillet()

def cubit.tweak_vertex_fillet (   verts,
  radius,
  keep_old = False,
  preview = False 
)

2D sheet vertex chamfer: creates chamfers at specified vertices by offsetting adjacent curves.

Performs a chamfer operation at each vertex in verts on a 2D sheet body. Adjacent curves are trimmed and extended to form a flat face at distance radius from the vertex. The original sheet can be retained via keep_old , and a preview generated via preview .

   .. code-block:: python
# Create a rectangular sheet with width 10
cubit.cmd ("create surface rectangle width 10" )
# Chamfer vertex 1 with distance 1 (creates new edges)
verts = [ cubit.vertex (1) ]
bodies = cubit.tweak_vertex_fillet (verts, 1.0, False , False )
# Only one sheet body is returned
b = bodies[0]
print("Body ID:" , b.id())
# Get the first surface from the sheet and print its area
surf = b.surfaces()[0]
area = surf.area()
print("Surface Area:" , area) # prints 99.5
  @n type of verts:  std::vector< CubitInterface::Vertex,std::allocator< CubitInterface::Vertex > >, in
Parameters
verts List of Vertex objects to chamfer.
type of radius: float, in
radius Chamfer distance (model units).
type of keep_old: boolean, in, optional
keep_old True to retain the original sheet body (default false).
type of preview: boolean, in, optional
preview True to generate a preview without modifying geometry (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of sheet Body objects representing the resulting bodies after chamfering.

◆ unite()

def cubit.unite (   body_in,
  keep_old_in = False 
)

Performs a boolean unite operation: merges specified bodies into one.

Unites the bodies in body_in into a single body. Surfaces in contact remain connected. The original bodies can be retained via keep_old_in .

   .. code-block:: python
# Create a 10x10x10 brick (Body ID 1) and a cylinder (Body ID 2)
cubit.cmd ("brick x 10" ) # Volume 1000
cubit.cmd ("cylinder radius 3 height 10" ) # Volume ~282.74
# Move the cylinder (Body 2) along +Z by 10
cubit.cmd ("move volume 2 z 10" )
# Unite bodies 1 and 2 into one
inputs = [ cubit.body (1), cubit.body (2) ]
result = cubit.unite (inputs, False )
b = result[0]
print("Body ID:" , b.id())
print("Volume:" , b.volume()) # prints ~1282.74
  @n type of body_in:  std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
Parameters
body_in List of Body objects to unite.
type of keep_old_in: boolean, in, optional
keep_old_in True to retain original bodies (default false).
return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
Returns
A vector of Body objects representing the new united bodies (one Body).

◆ unload_ML()

def cubit.unload_ML (   args,
  kwargs 
)

Unload machine learning training data from memory.

This function clears cached ML models and releases associated resources for the specified type.


type of model_type: string, optional

Parameters
model_type Specifies which data to unload:
  • "all" : Unload both classification and regression models.
  • "classification" : Unload classification models only.
  • "regression" : Unload regression models only.
   .. code-block:: python
# Example usage in Python
cubit.unloadML("regression" )
print("Regression models unloaded." )

◆ unselect_entity()

def cubit.unselect_entity (   entity_type,
  entity_id 
)

Unselect an entity that is currently selected.

Removes the highlight and pick status of the specified entity.

.. code-block:: python
import cubit
# First select curve 221
cubit.cmd ("select curve 221" )
# Now unselect the same curve
cubit.unselect_entity ("curve" , 221)
 @n type of entity_type:  string
Parameters
entity_type Type of the entity ("vertex", "curve", "surface", "volume").
type of entity_id: int
entity_id ID of the entity to unselect.

◆ vertex()

def cubit.vertex (   id_in )

Retrieve a vertex object by its ID.

Retrieves the vertex object corresponding to the provided ID.

   .. code-block:: python
import cubit
# Create a 10x10x10 brick (vertex IDs include corners).
cubit.cmd ("brick x 10" )
vertex = cubit.vertex (1)
print("Vertex ID:" , vertex.id())
  @n type of id_in:  int
Parameters
id_in ID of the vertex to retrieve.
return type of : :py:class: Vertex
Returns
Vertex object corresponding to the specified ID.

◆ volume()

def cubit.volume (   id_in )

Retrieve a volume by its ID.

Retrieves the volume object corresponding to the provided ID.

   .. code-block:: python
import cubit
# Create a 10x10x10 brick (volume ID 1).
cubit.cmd ("brick x 10" )
volume = cubit.volume (1)
print("Volume ID:" , volume.id())
  @n type of id_in:  int
Parameters
id_in ID of the volume to retrieve.
return type of : :py:class: Volume
Returns
Volume object corresponding to the specified ID.

◆ volume_contains_tets()

def cubit.volume_contains_tets (   volume_id )

Determine whether a specified volume contains any tetrahedral elements.

.. code-block:: python

cubit.cmd ("brick x 10" ) # create brick (Volume ID = 1)
cubit.cmd ("vol 1 scheme tetmesh" )
cubit.cmd ("mesh vol 1" ) # mesh volume 1 with tets
print("Volume 1 contains tets:" , has_tets)
 @n type of volume_id:  int
Parameters
volume_id ID of the volume to check.
return type of : boolean
Returns
True if the volume contains any tetrahedral elements; false otherwise.

◆ was_last_cmd_undoable()

def cubit.was_last_cmd_undoable ( )

Report whether the last executed command was undoable.

Returns true if the most recent Cubit command supports undo; false otherwise.

.. code-block:: python
import cubit
cubit.cmd ("create brick x 5" )
print("Last command undoable?" , undoable)
 @n return type of :  boolean
Returns
true if the last command supports undo; false otherwise.

◆ write_to_journal()

def cubit.write_to_journal (   words )

Append a custom entry to Cubit's journal and recording streams.

Forces the given text to be recorded as if it were a Cubit command. This marks the model as modified and, if journaling and recording are enabled, writes the entry to the active journal and recording files.

.. code-block:: python
import cubit
# Write an import command directly into the journal
cubit.write_to_journal ('import "part.sat"' )
 @n type of words:  string
Parameters
words Text to append to the journal and recording streams.

Variable Documentation

◆ BAR

BAR = _cubit3.BAR

◆ BAR2

BAR2 = _cubit3.BAR2

◆ BAR3

BAR3 = _cubit3.BAR3

◆ BEAM

BEAM = _cubit3.BEAM

◆ BEAM2

BEAM2 = _cubit3.BEAM2

◆ BEAM3

BEAM3 = _cubit3.BEAM3

◆ CI_BCENTITY_CC

CI_BCENTITY_CC = _cubit3.CI_BCENTITY_CC

◆ CI_BCENTITY_CC_SHELL_BOTTOM

CI_BCENTITY_CC_SHELL_BOTTOM = _cubit3.CI_BCENTITY_CC_SHELL_BOTTOM

◆ CI_BCENTITY_CC_SHELL_TOP

CI_BCENTITY_CC_SHELL_TOP = _cubit3.CI_BCENTITY_CC_SHELL_TOP

◆ CI_BCENTITY_FIRST

CI_BCENTITY_FIRST = _cubit3.CI_BCENTITY_FIRST

◆ CI_BCENTITY_LAST

CI_BCENTITY_LAST = _cubit3.CI_BCENTITY_LAST

◆ CI_BCENTITY_SHELL_AREA_BOTTOM

CI_BCENTITY_SHELL_AREA_BOTTOM = _cubit3.CI_BCENTITY_SHELL_AREA_BOTTOM

◆ CI_BCENTITY_SHELL_AREA_GRADIENT

CI_BCENTITY_SHELL_AREA_GRADIENT = _cubit3.CI_BCENTITY_SHELL_AREA_GRADIENT

◆ CI_BCENTITY_SHELL_AREA_MIDDLE

CI_BCENTITY_SHELL_AREA_MIDDLE = _cubit3.CI_BCENTITY_SHELL_AREA_MIDDLE

◆ CI_BCENTITY_SHELL_AREA_TOP

CI_BCENTITY_SHELL_AREA_TOP = _cubit3.CI_BCENTITY_SHELL_AREA_TOP

◆ CI_BCENTITY_SOLID_HEATFLUX

CI_BCENTITY_SOLID_HEATFLUX = _cubit3.CI_BCENTITY_SOLID_HEATFLUX

◆ CI_BCENTITY_SOLID_TEMP

CI_BCENTITY_SOLID_TEMP = _cubit3.CI_BCENTITY_SOLID_TEMP

◆ CI_BCENTITY_TEMP

CI_BCENTITY_TEMP = _cubit3.CI_BCENTITY_TEMP

◆ CI_BCENTITY_UNKNOWN

CI_BCENTITY_UNKNOWN = _cubit3.CI_BCENTITY_UNKNOWN

◆ CI_BCTYPE_ACCELERATION

CI_BCTYPE_ACCELERATION = _cubit3.CI_BCTYPE_ACCELERATION

◆ CI_BCTYPE_AXIS

CI_BCTYPE_AXIS = _cubit3.CI_BCTYPE_AXIS

◆ CI_BCTYPE_CONSTRAINT

CI_BCTYPE_CONSTRAINT = _cubit3.CI_BCTYPE_CONSTRAINT

◆ CI_BCTYPE_CONTACT_PAIR

CI_BCTYPE_CONTACT_PAIR = _cubit3.CI_BCTYPE_CONTACT_PAIR

◆ CI_BCTYPE_CONTACT_REGION

CI_BCTYPE_CONTACT_REGION = _cubit3.CI_BCTYPE_CONTACT_REGION

◆ CI_BCTYPE_CONVECTION

CI_BCTYPE_CONVECTION = _cubit3.CI_BCTYPE_CONVECTION

◆ CI_BCTYPE_DISPLACEMENT

CI_BCTYPE_DISPLACEMENT = _cubit3.CI_BCTYPE_DISPLACEMENT

◆ CI_BCTYPE_EXHAUSTFAN

CI_BCTYPE_EXHAUSTFAN = _cubit3.CI_BCTYPE_EXHAUSTFAN

◆ CI_BCTYPE_FAN

CI_BCTYPE_FAN = _cubit3.CI_BCTYPE_FAN

◆ CI_BCTYPE_FIRST

CI_BCTYPE_FIRST = _cubit3.CI_BCTYPE_FIRST

◆ CI_BCTYPE_FORCE

CI_BCTYPE_FORCE = _cubit3.CI_BCTYPE_FORCE

◆ CI_BCTYPE_GAP

CI_BCTYPE_GAP = _cubit3.CI_BCTYPE_GAP

◆ CI_BCTYPE_HEATFLUX

CI_BCTYPE_HEATFLUX = _cubit3.CI_BCTYPE_HEATFLUX

◆ CI_BCTYPE_INLETVENT

CI_BCTYPE_INLETVENT = _cubit3.CI_BCTYPE_INLETVENT

◆ CI_BCTYPE_INTAKEFAN

CI_BCTYPE_INTAKEFAN = _cubit3.CI_BCTYPE_INTAKEFAN

◆ CI_BCTYPE_INTERFACE

CI_BCTYPE_INTERFACE = _cubit3.CI_BCTYPE_INTERFACE

◆ CI_BCTYPE_INTERIOR

CI_BCTYPE_INTERIOR = _cubit3.CI_BCTYPE_INTERIOR

◆ CI_BCTYPE_LAST

CI_BCTYPE_LAST = _cubit3.CI_BCTYPE_LAST

◆ CI_BCTYPE_LUMPMASS

CI_BCTYPE_LUMPMASS = _cubit3.CI_BCTYPE_LUMPMASS

◆ CI_BCTYPE_MASSFLOWINLET

CI_BCTYPE_MASSFLOWINLET = _cubit3.CI_BCTYPE_MASSFLOWINLET

◆ CI_BCTYPE_MATERIAL

CI_BCTYPE_MATERIAL = _cubit3.CI_BCTYPE_MATERIAL

◆ CI_BCTYPE_MEDIA

CI_BCTYPE_MEDIA = _cubit3.CI_BCTYPE_MEDIA

◆ CI_BCTYPE_MPC

CI_BCTYPE_MPC = _cubit3.CI_BCTYPE_MPC

◆ CI_BCTYPE_OUTFLOW

CI_BCTYPE_OUTFLOW = _cubit3.CI_BCTYPE_OUTFLOW

◆ CI_BCTYPE_OUTLETVENT

CI_BCTYPE_OUTLETVENT = _cubit3.CI_BCTYPE_OUTLETVENT

◆ CI_BCTYPE_PERIODIC

CI_BCTYPE_PERIODIC = _cubit3.CI_BCTYPE_PERIODIC

◆ CI_BCTYPE_PERIODICSHADOW

CI_BCTYPE_PERIODICSHADOW = _cubit3.CI_BCTYPE_PERIODICSHADOW

◆ CI_BCTYPE_POROUSJUMP

CI_BCTYPE_POROUSJUMP = _cubit3.CI_BCTYPE_POROUSJUMP

◆ CI_BCTYPE_PRESSURE

CI_BCTYPE_PRESSURE = _cubit3.CI_BCTYPE_PRESSURE

◆ CI_BCTYPE_PRESSUREFARFIELD

CI_BCTYPE_PRESSUREFARFIELD = _cubit3.CI_BCTYPE_PRESSUREFARFIELD

◆ CI_BCTYPE_PRESSUREINLET

CI_BCTYPE_PRESSUREINLET = _cubit3.CI_BCTYPE_PRESSUREINLET

◆ CI_BCTYPE_PRESSUREOUTLET

CI_BCTYPE_PRESSUREOUTLET = _cubit3.CI_BCTYPE_PRESSUREOUTLET

◆ CI_BCTYPE_RADIATOR

CI_BCTYPE_RADIATOR = _cubit3.CI_BCTYPE_RADIATOR

◆ CI_BCTYPE_RIGIDBODY

CI_BCTYPE_RIGIDBODY = _cubit3.CI_BCTYPE_RIGIDBODY

◆ CI_BCTYPE_SPRING

CI_BCTYPE_SPRING = _cubit3.CI_BCTYPE_SPRING

◆ CI_BCTYPE_SUPERSONICINFLOW

CI_BCTYPE_SUPERSONICINFLOW = _cubit3.CI_BCTYPE_SUPERSONICINFLOW

◆ CI_BCTYPE_SUPERSONICOUTFLOW

CI_BCTYPE_SUPERSONICOUTFLOW = _cubit3.CI_BCTYPE_SUPERSONICOUTFLOW

◆ CI_BCTYPE_SYMMETRY

CI_BCTYPE_SYMMETRY = _cubit3.CI_BCTYPE_SYMMETRY

◆ CI_BCTYPE_TEMPERATURE

CI_BCTYPE_TEMPERATURE = _cubit3.CI_BCTYPE_TEMPERATURE

◆ CI_BCTYPE_UNKNOWN

CI_BCTYPE_UNKNOWN = _cubit3.CI_BCTYPE_UNKNOWN

◆ CI_BCTYPE_VELOCITY

CI_BCTYPE_VELOCITY = _cubit3.CI_BCTYPE_VELOCITY

◆ CI_BCTYPE_VELOCITYINLET

CI_BCTYPE_VELOCITYINLET = _cubit3.CI_BCTYPE_VELOCITYINLET

◆ CI_BCTYPE_WALL

CI_BCTYPE_WALL = _cubit3.CI_BCTYPE_WALL

◆ CI_CONDUCTIVITY

CI_CONDUCTIVITY = _cubit3.CI_CONDUCTIVITY

◆ CI_DENSITY

CI_DENSITY = _cubit3.CI_DENSITY

◆ CI_ERROR

CI_ERROR = cvar.CI_ERROR

◆ CI_MATERIAL_FIRST

CI_MATERIAL_FIRST = _cubit3.CI_MATERIAL_FIRST

◆ CI_MATERIAL_LAST

CI_MATERIAL_LAST = _cubit3.CI_MATERIAL_LAST

◆ CI_MATERIAL_UNKNOWNPROPERTY

CI_MATERIAL_UNKNOWNPROPERTY = _cubit3.CI_MATERIAL_UNKNOWNPROPERTY

◆ CI_MODULUS

CI_MODULUS = _cubit3.CI_MODULUS

◆ CI_POISSON

CI_POISSON = _cubit3.CI_POISSON

◆ CI_SHEAR_MODULUS

CI_SHEAR_MODULUS = _cubit3.CI_SHEAR_MODULUS

◆ CI_SPECIFIC_HEAT

CI_SPECIFIC_HEAT = _cubit3.CI_SPECIFIC_HEAT

◆ CI_THERMAL_EXPANSION

CI_THERMAL_EXPANSION = _cubit3.CI_THERMAL_EXPANSION

◆ CI_ULTIMATE_STRAIN

CI_ULTIMATE_STRAIN = _cubit3.CI_ULTIMATE_STRAIN

◆ CI_ULTIMATE_STRENGTH

CI_ULTIMATE_STRENGTH = _cubit3.CI_ULTIMATE_STRENGTH

◆ CI_YIELD_STRENGTH

CI_YIELD_STRENGTH = _cubit3.CI_YIELD_STRENGTH

◆ CUBIT_TRI

CUBIT_TRI = _cubit3.CUBIT_TRI

◆ CURVE

CURVE = _cubit3.CURVE

◆ cvar

cvar = _cubit3.cvar

◆ HEX

HEX = _cubit3.HEX

◆ HEX20

HEX20 = _cubit3.HEX20

◆ HEX21

HEX21 = _cubit3.HEX21

◆ HEX26

HEX26 = _cubit3.HEX26

◆ HEX27

HEX27 = _cubit3.HEX27

◆ HEX8

HEX8 = _cubit3.HEX8

◆ HEX9

HEX9 = _cubit3.HEX9

◆ HEXSHELL

HEXSHELL = _cubit3.HEXSHELL

◆ INVALID_ELEMENT_TYPE

INVALID_ELEMENT_TYPE = _cubit3.INVALID_ELEMENT_TYPE

◆ PYRAMID

PYRAMID = _cubit3.PYRAMID

◆ PYRAMID13

PYRAMID13 = _cubit3.PYRAMID13

◆ PYRAMID18

PYRAMID18 = _cubit3.PYRAMID18

◆ PYRAMID5

PYRAMID5 = _cubit3.PYRAMID5

◆ PYRAMID8

PYRAMID8 = _cubit3.PYRAMID8

◆ QUAD

QUAD = _cubit3.QUAD

◆ QUAD4

QUAD4 = _cubit3.QUAD4

◆ QUAD5

QUAD5 = _cubit3.QUAD5

◆ QUAD8

QUAD8 = _cubit3.QUAD8

◆ QUAD9

QUAD9 = _cubit3.QUAD9

◆ SHARED_PTR_DISOWN

SHARED_PTR_DISOWN = _cubit3.SHARED_PTR_DISOWN

◆ SHEL

SHEL = _cubit3.SHEL

◆ SHELL4

SHELL4 = _cubit3.SHELL4

◆ SHELL8

SHELL8 = _cubit3.SHELL8

◆ SHELL9

SHELL9 = _cubit3.SHELL9

◆ SPHERE_EXO

SPHERE_EXO = _cubit3.SPHERE_EXO

◆ SPRING

SPRING = _cubit3.SPRING

◆ SUPERELEMENT_TOPOLOGY

SUPERELEMENT_TOPOLOGY = _cubit3.SUPERELEMENT_TOPOLOGY

◆ SURFACE

SURFACE = _cubit3.SURFACE

◆ TETRA

TETRA = _cubit3.TETRA

◆ TETRA10

TETRA10 = _cubit3.TETRA10

◆ TETRA14

TETRA14 = _cubit3.TETRA14

◆ TETRA15

TETRA15 = _cubit3.TETRA15

◆ TETRA4

TETRA4 = _cubit3.TETRA4

◆ TETRA8

TETRA8 = _cubit3.TETRA8

◆ TRI3

TRI3 = _cubit3.TRI3

◆ TRI4

TRI4 = _cubit3.TRI4

◆ TRI6

TRI6 = _cubit3.TRI6

◆ TRI7

TRI7 = _cubit3.TRI7

◆ TRISHELL

TRISHELL = _cubit3.TRISHELL

◆ TRISHELL3

TRISHELL3 = _cubit3.TRISHELL3

◆ TRISHELL4

TRISHELL4 = _cubit3.TRISHELL4

◆ TRISHELL6

TRISHELL6 = _cubit3.TRISHELL6

◆ TRISHELL7

TRISHELL7 = _cubit3.TRISHELL7

◆ TRUSS

TRUSS = _cubit3.TRUSS

◆ TRUSS2

TRUSS2 = _cubit3.TRUSS2

◆ TRUSS3

TRUSS3 = _cubit3.TRUSS3

◆ VERTEX

VERTEX = _cubit3.VERTEX

◆ VOLUME

VOLUME = _cubit3.VOLUME

◆ WEDGE

WEDGE = _cubit3.WEDGE

◆ WEDGE15

WEDGE15 = _cubit3.WEDGE15

◆ WEDGE16

WEDGE16 = _cubit3.WEDGE16

◆ WEDGE20

WEDGE20 = _cubit3.WEDGE20

◆ WEDGE21

WEDGE21 = _cubit3.WEDGE21

◆ WEDGE6

WEDGE6 = _cubit3.WEDGE6