Cubit Python API 2026.6
Loading...
Searching...
No Matches
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
 Struct for BoltHoleInfo data used in CubitInterface. More...

 
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
 Struct for VolumeGap data used in CubitInterface. More...

 

Functions

 body (id_in)
 Retrieve a body by its ID.

 
 brick (width, depth=-1, height=-1)
 Create a brick of specified width, depth, and height.

 
 copy_body (init_body)
 Create a duplicate of the specified body.

 
 create_arc_curve (v0, v1, intermediate_point)
 Create an arc curve using end vertices and an intermediate point.

 
 create_curve (v0, v1)
 Create a curve between two vertices.

 
 create_nurbs_curve (degree, ctrl_pts, weights, knot_vec)
 Creates a NURBS curve... code-block:: c++.

 
 create_spline (points, surface_id)
 Create a spline curve through a sequence of 3D points on a surface.

 
 create_surface (curves)
 Create a sheet body from boundary curves.

 
 create_vertex (x, y, z)
 Create a vertex at specified coordinates.

 
 create_window ()
 
 curve (id_in)
 Retrieve a curve object by its ID.

 
 cylinder (height, x_radius, y_radius, top_radius)
 Create a cylinder or truncated cone of specified dimensions.

 
 delete_window (id)
 
 get_all_cfd_bcs ()
 
 get_assembly_children (assembly_id)
 
 get_assembly_items ()
 
 get_block_cad_material (block_id)
 
 get_block_string_attributes (block_id)
 
 get_mesh_error_count ()
 
 get_mesh_errors ()
 
 get_top_level_assembly_items ()
 
 get_volume_cad_material (volume_id)
 
 get_volumes_for_node (node_name, node_instance)
 
 move (entity, vector, preview=False)
 Translates an Entity by a specified vector.

 
 prism (height, sides, major, minor)
 Create a prism of the specified dimensions.

 
 pyramid (height, sides, major, minor, top=0.0)
 Create a pyramid of specified dimensions.

 
 reflect (entity, axis, preview=False)
 Reflects an Entity about a specified axis (e.g., plane normal).

 
 reset ()
 Reset Cubit state.

 
 scale (entity, factor, preview=False)
 Scales an Entity uniformly by a specified factor.

 
 set_element_variable (element_ids, variable_name, variables)
 Sets scalar variables on specified mesh elements for Exodus export.

 
 set_nodal_variable (node_ids, variable_name, variables)
 Sets scalar variables on specified mesh nodes.

 
 sphere (radius, x_cut=0, y_cut=0, z_cut=0, inner_radius=0)
 Create all or part of a sphere.

 
 subtract (tool_in, from_in, imprint_in=False, keep_old_in=False)
 Performs a boolean subtract operation: removes tool bodies from target bodies.

 
 surface (id_in)
 Retrieve a surface object by its ID.

 
 sweep_curve (curves, along_curves, draft_angle, draft_type, rigid)
 Sweep one or more curves along a path to create sheet bodies.

 
 torus (center_radius, swept_radius)
 Create a torus of specified dimensions.

 
 tweak_curve_offset (curves, distances, keep_old=False, preview=False)
 2D equivalent of tweak_surface_offset: offsets specified curves on a sheet body.

 
 tweak_curve_remove (curves, keep_old=False, preview=False)
 Removes specified curves and extends adjacent surfaces on a sheet body.

 
 tweak_surface_offset (surfaces, distances)
 Offsets specified surfaces by given distances.

 
 tweak_surface_remove (surfaces, extend_ajoining=True, keep_old=False, preview=False)
 Removes specified surfaces from a body, optionally extending adjacent surfaces.

 
 tweak_vertex_fillet (verts, radius, keep_old=False, preview=False)
 2D sheet vertex chamfer: creates chamfers at specified vertices by offsetting adjacent curves.

 
 unite (body_in, keep_old_in=False)
 Performs a boolean unite operation: merges specified bodies into one.

 
 vertex (id_in)
 Retrieve a vertex object by its ID.

 
 volume (id_in)
 Retrieve a volume by its ID.

 
CubitInterface Control
 init (argv)
 Initialize the Cubit engine with optional startup arguments.

 
 destroy ()
 Shut down Cubit and close the active journal file.

 
 _incr_acis ()
 
 _decr_acis ()
 
 set_cubit_message_handler (hdlr)
 Redirect Cubit output to a custom message handler.

 
 get_cubit_message_handler ()
 Retrieve the current Cubit message handler.

 
 set_exit_handler (hdlr)
 Set a custom exit callback for Cubit.

 
 set_progress_handler (progress)
 Register a progress-bar callback handler with Cubit.

 
 replace_progress_handler (progress)
 Replace the current progress-bar callback handler and return the old one.

 
 set_cubit_interrupt (interrupt)
 Enable or disable interruptible operations in Cubit.

 
System Control and Data
 set_playback_paused_on_error (pause)
 Configure whether playback pauses on error.

 
 is_playback_paused_on_error ()
 Query whether playback is paused on error.

 
 pause_playback ()
 Pause journal playback immediately.

 
 stop_playback ()
 Stop journal playback entirely.

 
 resume_playback ()
 Resume a paused journal playback.

 
 is_playback_paused ()
 Check if journal playback is currently paused.

 
 developer_commands_are_enabled ()
 Check if developer commands are enabled.

 
 get_interface (interface_name)
 Retrieve a Cubit interface by name.

 
 release_interface (instance)
 Release a previously retrieved Cubit interface.

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

 
 get_version ()
 Retrieve the current Cubit version string.

 
 get_revision_date ()
 Retrieve the Cubit revision date.

 
 get_build_number ()
 Retrieve the Cubit build number.

 
 get_acis_version ()
 Retrieve the ACIS kernel version string.

 
 get_acis_version_as_int ()
 Retrieve the ACIS kernel version as an integer.

 
 get_sgm_version ()
 Retrieve the SGM (Solid Geometry Manager) version.

 
 get_exodus_version ()
 Retrieve the Exodus mesh library version.

 
 get_meshgems_version ()
 Retrieve the MeshGems library version.

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

 
 get_python_version ()
 Retrieve the Python interpreter version used by Cubit.

 
 get_default_geometry_engine ()
 Get the name of the default modeler engine.

 
 is_catia_engine_available ()
 Determine whether the CATIA geometry engine is available.

 
 is_acis_engine_available ()
 Determine whether the ACIS geometry engine is available.

 
 is_opencascade_engine_available ()
 Determine whether the OpenCASCADE geometry engine is available.

 
 is_special_build (build_type)
 Check if a special build type is available.

 
 print_cmd_options ()
 Display Cubit's supported startup options.

 
 graphics_enabled ()
 Used to check if a GUI graphics window is enabled.

 
 is_modified ()
 Check if the model has been modified since import or last save.

 
 set_modified ()
 Reset the model's modified status to "unmodified".

 
 is_undo_save_needed ()
 Check if the model requires an undo checkpoint save.

 
 set_undo_saved ()
 Clear the undo-needed flag for the model.

 
 is_performing_undo ()
 Query whether an undo operation is currently being performed.

 
 was_last_cmd_undoable ()
 Report whether the last executed command was undoable.

 
 get_undo_enabled ()
 Query whether undo is currently enabled.

 
 number_undo_commands ()
 Query the number of undoable commands in the stack.

 
 is_command_echoed ()
 Check whether Cubit echoes commands to the console.

 
 get_command_from_history (command_number)
 Retrieve a specific command from Cubit's history buffer.

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

 
 get_next_command_from_history ()
 Get the next command from the history buffer.

 
 get_previous_command_from_history ()
 Get the previous command from the history buffer.

 
 write_to_journal (words)
 Append a custom entry to Cubit's journal and recording streams.

 
 journal_commands (state)
 Enable or disable journaling of Cubit commands.

 
 is_command_journaled ()
 Query whether Cubit is journaling commands.

 
 get_current_journal_file ()
 Get the filename of the current journal file.

 
 is_working_dir_set ()
 Check if the "-workingdir" option was provided at Cubit startup.

 
 app_util ()
 Return Cubit's AppUtil interface for global services.

 
 cgm_iface ()
 Return the CGM-based geometry interface for Cubit.

 
 cgm ()
 Return the raw CGMApp kernel instance used by Cubit.

 
Command Utilities
 cmd (input_string)
 Execute a raw Cubit command string immediately (modifies model state).

 
 silent_cmd (input_string)
 Execute a Cubit command without echoing or verbose output.

 
 print_info (message)
 Print a message through Cubit's messaging system.

 
 parse_cubit_list (type, entity_list_string)
 Parse a Cubit-style entity selection expression into a list of IDs.

 
 parse_locations (location_str)
 Parse a Cubit location specification into concrete 3D coordinates.

 
 string_from_id_list (ids)
 Convert a list of integers into a compact Cubit-style ID string.

 
 get_id_string (entity_ids, sort=True)
 Convert a list of integers into a compact Cubit-style ID range string.

 
 print_raw_help (input_line, order_dependent, consecutive_dependent)
 Display context-sensitive help while typing commands.

 
 get_error_count ()
 Retrieve the total number of errors in the current Cubit session.

 
 get_cubit_digits_setting ()
 Retrieve the current Cubit "digits" setting.

 
 is_part_of_list (target_id, id_list)
 Check if an ID is present in a list of IDs.

 
 get_last_id (entity_type)
 Get the ID of the last created entity of the given type.

 
 entity_exists (entity_type, id)
 Check whether an entity of the specified type and ID exists.

 
 get_idless_signature (entity_type, entity_id)
 Get the idless signature of a geometric or mesh entity.

 
 get_idless_signatures (entity_type, entity_id_list)
 Get the idless signatures of a range of geometric or mesh entities.

 
 is_file_hdf5 (filename)
 Check whether a file is an HDF5 file.

 
 get_aprepro_vars ()
 Retrieve the current Aprepro variable names.

 
 get_aprepro_value_as_string (variable_name)
 Get the string value of an Aprepro variable.

 
 get_aprepro_numeric_value (variable_name)
 Get the numeric value of a specified Aprepro variable.

 
Graphics Viewing
 get_view_distance ()
 Get the camera's distance between its position and focus point.

 
 get_view_at ()
 Get the camera's current "at" (target) point.

 
 get_view_from ()
 Get the camera's current 'from' (position) point.

 
 get_view_up ()
 Get the camera's 'up' direction vector.

 
 reset_camera ()
 Reset the camera view and clear auxiliary graphics windows.

 
 flush_graphics ()
 Force immediate rendering of pending graphics operations.

 
 is_perspective_on ()
 Check if perspective projection is enabled.

 
 is_clipping_plane_on ()
 Get the current clipping plane status :rtype: boolean.

 
 is_clipping_plane_manipulation_on ()
 Get the current clipping plane manipulation status :rtype: boolean.

 
 is_occlusion_on ()
 Check if occlusion is enabled.

 
 is_scale_visibility_on ()
 Check if the scale annotation is visible in the graphics window.

 
 is_mesh_visibility_on ()
 Check if mesh graphics are visible in the graphics window.

 
 is_geometry_visibility_on ()
 Check if geometry graphics are visible in the graphics window.

 
 get_rendering_mode ()
 Get the current graphics rendering mode.

 
 set_rendering_mode (mode)
 Set the current graphics rendering mode (equivalent to "Graphics Mode <option>").

 
 set_label_type (entity_type, label_flag)
 Sets label display type for a given entity type.

 
 get_label_type (entity_type)
 Gets the current label display type for a given entity type.

 
Graphics Entity Selections
 clear_drawing_set (set_name)
 Clear all geometry in a named drawing set (e.g., mesh preview).

 
 unselect_entity (entity_type, entity_id)
 Unselect an entity that is currently selected.

 
 get_rubberband_shape ()
 Get the current rubberband selection shape.

 
 is_select_partial_on ()
 Check if partial selection is enabled.

 
 clear_highlight ()
 Clear all entity highlights.

 
 clear_preview ()
 Clear preview graphics without affecting other display settings.

 
 highlight (entity_type, entity_id)
 Highlight the given entity in the graphics window without selecting it.

 
 get_selected_ids ()
 Retrieve all currently selected entity IDs in pick order.

 
 get_selected_id (index)
 Get the selected entity ID by index.

 
 get_selected_type (index)
 Get the selected entity type by index.

 
 get_pick_type ()
 Get the current pick mode for entity selection.

 
 set_pick_type (pick_type, silent=False)
 Set the current pick mode for entity selection.

 
 set_filter_types (num_types, filter_types)
 Set multiple pick filter types for graphics selections.

 
 add_filter_type (filter_type)
 Add an entity type to the graphics pick filter.

 
 remove_filter_type (filter_type)
 Remove an entity type from the graphics pick filter.

 
 is_type_filtered (filter_type)
 Check if a specific entity type is currently excluded from picking.

 
 get_pick_filters ()
 Retrieve the list of entity types currently allowed for picking.

 
 clear_picked_list ()
 Clear the list of currently picked entities.

 
 step_next_possible_selection ()
 Advance to the next entity in the current selection list.

 
 step_previous_possible_selection ()
 Move back to the previous entity in the current selection list.

 
 print_current_selections ()
 Print all selected entities and their types.

 
 print_currently_selected_entity ()
 Print details of the current selected entity.

 
 current_selection_count ()
 Get the number of entities in the current selection list.

 
Meshing Schemes Support
 get_default_element_type ()
 Retrieve the current default element type for meshing.

 
 is_volume_meshable (volume_id)
 Check if a volume is meshable under the current meshing scheme.

 
 is_surface_meshable (surface_id)
 Check if a surface is meshable under the current meshing scheme.

 
 get_vertex_type (surface_id, vertex_id)
 Retrieve the vertex type for a given vertex on a surface.

 
 get_submap_corner_types (surface_id)
 Get a list of vertex IDs and their corner-type codes for a surface submap.

 
 get_curve_bias_type (curve_id)
 Retrieve the bias scheme type applied to a curve.

 
 get_curve_bias_geometric_factor (curve_id)
 Get the primary geometric progression factor used for biasing a curve.

 
 get_curve_bias_geometric_factor2 (curve_id)
 Get the secondary geometric progression factor for a dual-bias curve.

 
 get_curve_bias_first_interval_length (curve_id)
 Query the length of the first interval on a biased curve.

 
 get_curve_bias_first_interval_fraction (curve_id)
 Retrieve the fraction of curve length used as the first interval size.

 
 get_curve_bias_fine_size (curve_id)
 Get the "fine size" parameter for a biased curve, if set.

 
 get_curve_bias_coarse_size (curve_id)
 Get the "coarse size" parameter for a biased curve, if set.

 
 get_curve_bias_first_last_ratio1 (curve_id)
 Retrieve the ratio of first-to-last interval at the start of a biased curve.

 
 get_curve_bias_first_last_ratio2 (curve_id)
 Retrieve the ratio of first-to-last interval at the end of a biased curve.

 
 get_curve_bias_last_first_ratio1 (curve_id)
 Retrieve the ratio of last-to-first interval at the start of a biased curve.

 
 get_curve_bias_last_first_ratio2 (curve_id)
 Retrieve the ratio of last-to-first interval at the end of a biased curve.

 
 get_curve_bias_from_start (curve_id, value)
 Determine if the bias is measured from the curve's start vertex.

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

 
 get_curve_bias_start_vertex_id (curve_id)
 Retrieve the vertex ID designated as the start of bias on a curve.

 
 get_curve_mesh_scheme_curvature (curve_id)
 Retrieve the curvature mesh scheme adaptation value for a curve.

 
 get_curve_mesh_scheme_pinpoint_locations (curve_id)
 Retrieve the pinpoint mesh scheme locations for a curve.

 
 get_mesh_scheme (geometry_type, entity_id)
 Retrieve the meshing scheme applied to a geometric entity.

 
 get_smooth_scheme (geometry_type, entity_id)
 Retrieve the smoothing scheme for a specified geometry entity.

 
 get_mesh_scheme_firmness (geometry_type, entity_id)
 Retrieve the meshing scheme firmness for a specified surface or volume.

 
 get_tetmesh_proximity_flag (volume_id)
 Get the proximity-layer flag for tet meshing on a volume.

 
 get_tetmesh_proximity_layers (volume_id)
 Get the number of proximity layers for tet meshing on a volume.

 
 get_tetmesh_growth_factor (volume_id)
 Get the growth factor for tet meshing on a volume.

 
 get_tetmesh_parallel ()
 Get the global parallel-tetmesher flag (HPC) setting.

 
 get_tetmesh_num_anisotropic_layers ()
 Get the global number of anisotropic tet layers setting.

 
 get_tetmesh_optimization_level ()
 Get the global tet meshing optimization level.

 
 get_tetmesh_insert_mid_nodes ()
 Get the global flag indicating insertion of mid-edge (quadratic) nodes during tet meshing.

 
 get_tetmesh_optimize_mid_nodes ()
 Get the global flag indicating optimization of mid-edge nodes during tet meshing.

 
 get_tetmesh_optimize_overconstrained_tets ()
 Get the global flag indicating optimization of overconstrained tetrahedra.

 
 get_tetmesh_optimize_overconstrained_edges ()
 Get the global flag indicating optimization of overconstrained edges.

 
 get_tetmesh_minimize_slivers ()
 Get the global flag indicating minimization of sliver tetrahedra.

 
 get_tetmesh_minimize_interior_points ()
 Get the global flag indicating minimization of interior points in tet meshing.

 
 get_tetmesh_relax_surface_constraints ()
 Get the global flag indicating relaxation of surface mesh constraints in tet meshing.

 
 get_mesh_geometry_approximation_angle (geometry_type, entity_id)
 Get the geometry approximation angle for TriMesh/TetMesh on a given entity.

 
 get_trimesh_surface_gradation ()
 Retrieve the global surface mesh gradation for the TriMesh scheme.

 
 get_trimesh_volume_gradation ()
 Retrieve the global volume mesh gradation for the TriMesh scheme.

 
 get_trimesh_use_surface_proximity ()
 Retrieve the global surface proximity flag for the TriMesh scheme.

 
 get_trimesh_surface_proximity_ratio ()
 Retrieve the global surface proximity ratio for the TriMesh scheme.

 
 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.

 
 get_trimesh_geometry_sizing ()
 Retrieve the global geometry sizing flag for the TriMesh scheme.

 
 get_trimesh_num_anisotropic_layers ()
 Retrieve the global number of anisotropic triangle layers for the TriMesh scheme.

 
 get_trimesh_split_overconstrained_edges ()
 Retrieve the global flag for splitting overconstrained edges in the TriMesh scheme.

 
 get_trimesh_coarse_mesh_toggle ()
 Get the global setting for trimesher coarse mesh :rtype: boolean.

 
 get_trimesh_anisotropic_ratio ()
 Get the global setting for trimesher coarse anisotropic ratio :rtype: float.

 
 get_trimesh_coarse_deviation_angle ()
 Get the global setting for trimesher coarse mesh geometric approximation angle :rtype: float.

 
 get_trimesh_tiny_edge_length ()
 Retrieve the global tiny edge length for the TriMesh scheme.

 
 get_trimesh_ridge_angle ()
 Retrieve the global ridge angle for the TriMesh scheme.

 
 get_node_constraint ()
 Query whether node constraint is enabled (move mid-nodes to geometry).

 
 get_node_constraint_value ()
 Query the numeric value of the node constraint setting.

 
 get_node_constraint_smart_threshold ()
 Query the current quality threshold for smart node constraint.

 
 get_node_constraint_smart_metric ()
 Query the current quality metric for smart node constraint.

 
 get_dbl_sculpt_default (variable)
 Retrieve the default value of a named sculpt parameter.

 
 get_int_sculpt_default (variable)
 Retrieve default integer-valued sculpt parameter.

 
 get_bool_sculpt_default (variable)
 Retrieve default boolean-valued sculpt parameter.

 
 get_string_sculpt_default (variable)
 Retrieve default string-valued sculpt parameter.

 
Mesh Sizing Support
 get_mesh_intervals (geometry_type, entity_id)
 Get the mesh interval count for a specified entity.

 
 get_mesh_size (geometry_type, entity_id)
 Retrieve the effective target edge length for meshing an entity.

 
 get_requested_mesh_size (geometry_type, id)
 Retrieve the mesh size explicitly set on a geometry entity.

 
 has_valid_size (geometry_type, entity_id)
 Check whether a geometric entity has a valid size.

 
 get_mesh_interval_firmness (geometry_type, entity_id)
 Retrieve the interval firmness for a specified geometry entity.

 
 get_requested_mesh_interval_firmness (geometry_type, entity_id)
 Retrieve the explicitly requested interval firmness for a specified entity.

 
 get_mesh_size_type (geometry_type, entity_id)
 Retrieve the mesh size setting type for a specified entity.

 
 get_requested_mesh_size_type (geometry_type, entity_id)
 Retrieve the mesh size setting type explicitly requested on a specified entity.

 
 auto_size_needs_to_be_calculated ()
 Check if automatic mesh sizing is outdated and needs recomputation.

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

 
 get_requested_mesh_intervals (geometry_type, entity_id)
 Retrieve the mesh interval count explicitly set on a geometry entity.

 
 is_interval_count_odd (surface_id)
 Check if any loop on a surface has an odd number of mesh intervals.

 
 get_auto_size (geometry_type, entity_id_list, auto_factor)
 Predict the automatic mesh size for a set of entities.

 
 get_element_budget (element_type, entity_id_list, auto_factor)
 Estimate the total element count for a set of volumes given size settings.

 
 get_exodus_sizing_function_variable_name ()
 Retrieve the Exodus-based sizing function variable name.

 
 get_exodus_sizing_function_file_name ()
 Retrieve the Exodus sizing function file name.

 
 get_sizing_function_name (entity_type, entity_id)
 Retrieve the meshing sizing function type for a surface or volume.

 
 exodus_sizing_function_file_exists ()
 Check if the Exodus sizing function file currently exists.

 
Mesh Query Support
 is_meshed (geometry_type, entity_id)
 Determine whether a specified geometry entity has been meshed.

 
 get_hex_count ()
 Retrieve the count of hexahedral elements in the current model.

 
 get_pyramid_count ()
 Retrieve the count of pyramid elements in the current model.

 
 get_tet_count ()
 Retrieve the count of tetrahedral elements in the current model.

 
 get_quad_count ()
 Retrieve the count of quadrilateral elements in the current model.

 
 get_tri_count ()
 Retrieve the count of triangular elements in the current model.

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

 
 get_sphere_count ()
 Retrieve the count of sphere elements in the current model.

 
 get_wedge_count ()
 Retrieve the count of wedge-shaped elements in the current model.

 
 get_node_count ()
 Retrieve the count of nodes in the current model.

 
 get_element_count ()
 Retrieve the count of exportable elements in the current model.

 
 get_volume_element_count (volume_id)
 Retrieve the count of 3D elements in a specified volume.

 
 get_surface_element_count (surface_id)
 Retrieve the count of elements on a specified surface.

 
 volume_contains_tets (volume_id)
 Determine whether a specified volume contains any tetrahedral elements.

 
 get_hex_sheet (node_id_1, node_id_2)
 Retrieve the IDs of all hexahedral elements forming a hex sheet through two nodes.

 
 get_hex_column (quad_id)
 Get the list of hex elements forming a hex column through the given quad/face.

 
 get_mesh_edge_length (edge_id)
 Compute the length of a specified mesh edge.

 
 get_meshed_volume_or_area (geometry_type, entity_ids)
 Sum mesh volumes or surface areas for CAD entities or mesh elements.

 
 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.

 
 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.

 
 get_quality_value (mesh_type, mesh_id, metric_name)
 Retrieve a specific quality metric value for a single mesh element.

 
 get_quality_values (mesh_type, mesh_ids, metric_name)
 Retrieve quality metric values for multiple mesh elements.

 
 calculate_timestep_estimate (entity_type, entity_ids)
 Estimate the time step based on element sizes and material properties.

 
 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.

 
 get_target_timestep ()
 Return the current target time step threshold used in the density multiplier metric.

 
 get_overconstrained_tets_in_volumes (volumes)
 Retrieve IDs of overconstrained tetrahedra within specified volumes.

 
 best_edge_to_collapse_interior_node (node_id)
 Find the best edge to collapse to remove an interior node in a triangular mesh.

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

 
 get_n_largest_distances_between_meshes (n, entity_type1, ids1, entity_type2, ids2)
 Finds the N largest node-to-element distances between two meshes.

 
Geometry Topology Support
 get_entities (entity_type)
 Retrieve IDs of all current entities of a specified type (geometry and mesh).

 
 get_current_ids (entity_type)
 Retrieve IDs of all current geometry entities of a specified type.

 
 get_body_count ()
 Get the current number of bodies in the model.

 
 get_volume_count ()
 Get the current number of volumes in the model.

 
 get_surface_count ()
 Get the current number of surfaces in the model.

 
 get_curve_count ()
 Get the current number of curves in the model.

 
 get_vertex_count ()
 Get the current number of vertices in the model.

 
 get_curve_count_in_volumes (target_volume_ids)
 Get the current number of curves in the specified volumes.

 
 get_relatives (source_geometry_type, source_id, target_geom_type)
 Get the relatives (parents or children) of a specified entity.

 
 are_adjacent_surfaces (surface_ids)
 Return whether two or more surfaces share at least one manifold curve.

 
 are_adjacent_curves (curve_ids)
 Return whether two or more curves share at least one manifold vertex.

 
 get_adjacent_surfaces (geometry_type, entity_id)
 Get a list of surfaces adjacent to a specified surface (including the surface itself).

 
 get_adjacent_volumes (geometry_type, entity_id)
 Get a list of adjacent volumes to a specified entity.

 
 get_num_volume_shells (volume_id)
 Get the number of shells in a volume.

 
 get_valence (vertex_id)
 Get the valence (number of incident edges) for a specific vertex.

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

 
 get_owning_body (geometry_type, entity_id)
 Get the owning body for a specified entity.

 
 get_owning_volume (geometry_type, entity_id)
 Get the owning volume for a specified entity.

 
 get_owning_volume_by_name (entity_name)
 Get the owning volume for an entity by its name.

 
 get_common_curve_id (surface_1_id, surface_2_id)
 Return a curve shared by two surfaces.

 
 get_common_vertex_id (curve_1_id, curve_2_id)
 Return a vertex shared by two curves.

 
 get_connected_surfaces (surf_ids)
 Find surfaces connected to a given set of surfaces.

 
 gather_surfaces_by_orientation (seed_surf_ids, all_surf_ids)
 Gathers surfaces connected across shared edges, forming a surface enclosure.

 
Geometry Attribute Support
 is_visible (geometry_type, entity_id)
 Query visibility for a specific geometry entity.

 
 is_virtual (geometry_type, entity_id)
 Query whether a specified geometry entity is virtual.

 
 contains_virtual (geometry_type, entity_id)
 Query whether any child entities of a specified geometry entity are virtual.

 
 is_merged (geometry_type, entity_id)
 Check if a specified geometry entity has been merged into another.

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

 
 get_source_surfaces (volume_id)
 Retrieve the list of sweep source surfaces for a specified volume.

 
 get_target_surfaces (volume_id)
 Retrieve the list of sweep target surfaces for a specified volume.

 
 get_entity_modeler_engine (geometry_type, entity_id)
 Get the modeler engine type for a specified entity.

 
 get_entity_name (entity_type, entity_id, no_default=False)
 Get the name of a specified entity.

 
 get_entity_names (entity_type, entity_id, no_default=False, first_name_only=False)
 Get all names associated with a specified entity.

 
 set_entity_name (entity_type, entity_id, new_name)
 Set the name of a specified entity.

 
 get_id_from_name (name)
 Retrieve the integer ID of an entity by its name.

 
 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.

 
 get_namespace_list ()
 
 get_entity_color (entity_type, entity_id)
 Get the color of a specified entity.

 
 get_entity_color_index (entity_type, entity_id)
 Get the color index of a specified entity.

 
 is_multi_volume (body_id)
 Check if a body contains multiple volumes.

 
 is_sheet_body (volume_id)
 Determine if a volume is a sheet body (zero thickness).

 
Geometry Query Support
 get_vertex_coordinates (entityID)
 Get the 3D coordinates of a vertex.

 
 get_distance_between (vertex_id_1, vertex_id_2)
 Get the Euclidean distance between two vertices.

 
 get_curve_type (curve_id)
 Get the curve type for a specified curve.

 
 get_curve_length (curve_id)
 Get the 3D length of a specified curve.

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

 
 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.

 
 get_curve_radius (curve_id)
 Compute the radius of a specified curve.

 
 get_curve_center (curve_id)
 Retrieve the center point of a specified curve.

 
 get_arc_center_radius (curve_id)
 Get the center point and radius of a specified arc curve.

 
 evaluate_exterior_angle_at_curve (curve_id, volume_id)
 Return the exterior angle at a single curve with respect to a volume.

 
 evaluate_exterior_angle (curve_list, test_angle)
 Find curves whose exterior angle between adjacent surfaces is less than a given threshold.

 
 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.

 
 get_surface_type (surface_id)
 Get the surface type for a specified surface.

 
 get_surface_normal (surface_id)
 Get the unit normal vector at the center of a specified surface.

 
 get_surface_normal_at_coord (surface_id, coord)
 Get the unit normal vector at a specified point on a surface.

 
 get_u_v_from_surface_position (surface_id, position)
 Get the parametric location u, v of a given point on the surface :type surface_id: int.

 
 get_surface_position_from_u_v (surface_id, u, v)
 Get the XYZ position for a specified surface at the given parametric (u, v) :type surface_id: int.

 
 get_surface_centroid (surface_id)
 Get the approximate centroid of a specified surface based on graphics faceting.

 
 get_surface_sense (surface_id)
 Get the orientation ("sense") of a specified surface.

 
 is_surface_planer (surface_id)
 Query whether a specified surface is planar.

 
 is_surface_planar (surface_id)
 
 get_surface_area (surface_id)
 Get the area of a specified surface.

 
 get_hydraulic_radius_surface_area (surface_id)
 Compute the hydraulic radius of a specified surface.

 
 get_surface_principal_curvatures (surface_id)
 Get the principal curvatures of a surface at its midpoint.

 
 evaluate_surface_angle_at_vertex (surf_id, vert_id)
 Return the interior angle at a vertex on a specified surface.

 
 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.

 
 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.

 
 print_surface_summary_stats ()
 Print summary statistics for all surfaces in the model.

 
 get_volume_area (volume_id)
 Get the total surface area of a specified volume.

 
 get_volume_volume (vol_id)
 Get the enclosed volume of a specified volume.

 
 get_hydraulic_radius_volume_area (volume_id)
 Compute the hydraulic radius of a specified volume.

 
 get_similar_volumes (volume_ids, tol=1e-3, use_percent_tol=True)
 Find volumes with similar size and face count to given volumes.

 
 get_bounding_box (geometry_type, entity_id)
 Get the axis-aligned bounding box for a specified entity.

 
 get_total_bounding_box (geometry_type, entity_list)
 Get the combined bounding box for a list of entities.

 
 get_tight_bounding_box (geometry_type, entity_list)
 Get the tight bounding box for a list of entities.

 
 get_total_volume (volume_list)
 Get the total volume for a list of volumes.

 
 print_volume_summary_stats ()
 Print summary statistics for all volumes in the model.

 
 get_center_point (entity_type, entity_id)
 Get the 3D center or coordinates of a specified entity.

 
 is_periodic (geometry_type, entity_id)
 Query whether a specified surface or curve is periodic.

 
 get_geometry_type (geom_type, ent_ids)
 Return the analytic geometry type for a list of surfaces or curves.

 
 get_distance_between_entities (geom_type_1, entity_id_1, geom_type_2, entity_id_2)
 Get the minimum distance between two geometry entities.

 
 is_point_contained (geometry_type, entity_id, xyz_point)
 Determine if a point is inside, outside, on, or unknown relative to a given entity.

 
 snap_locations_to_geometry (locations, entity_type, entity_id, tol)
 Snaps given XYZ locations to nearest points on specified entity.

 
 measure_between_entities (entity_type1, entity_id1, entity_type2, entity_id2)
 Returns the shortest distance between two geometry entities and their closest points.

 
 fire_ray (origin, direction, target_type, target_ids, max_hits=0, ray_radius=0.0)
 Fire a ray at a list of target entities and return the hit locations and entity ids.

 
 get_coordinate_systems_id_list ()
 Returns a list of coordinate system IDs.

 
Geometry-Mesh Entity Support
 get_geometry_node_count (entity_type, entity_id)
 Get the number of mesh nodes on a geometric entity.

 
 get_vertex_node (vertex_id)
 Get the node ID owned by a vertex.

 
 get_curve_nodes (curve_id)
 Get the list of node IDs owned by a curve.

 
 get_curve_edges (curve_id)
 Get the list of edge element IDs on a curve.

 
 get_surface_nodes (surface_id)
 Get the list of node IDs owned by a surface.

 
 get_surface_quads (surface_id)
 Get the list of quadrilateral (quad) element IDs on a surface.

 
 get_surface_tris (surface_id)
 Get the list of triangle (tri) element IDs on a surface.

 
 get_volume_nodes (volume_id)
 Get the list of node IDs owned by a volume.

 
 get_volume_hexes (volume_id)
 Get the list of hexahedron (hex) IDs contained in a volume.

 
 get_volume_tets (volume_id)
 Get the list of tetrahedron (tet) IDs contained in a volume.

 
 get_volume_wedges (volume_id)
 Get the list of wedge IDs contained in a volume.

 
 get_volume_pyramids (volume_id)
 Get the list of pyramid IDs contained in a volume.

 
 get_surface_num_loops (surface_id)
 Get the number of loops on a surface.

 
 get_surface_loop_curves (surface_id)
 Get the curve IDs for each loop on a surface.

 
 get_surface_loop_nodes (surface_id)
 Get the ordered list of node IDs on the loops of a surface.

 
 get_entity_sense (source_type, source_id, sideset_id)
 Get the sense of an entity in a sideset.

 
 get_wrt_entity (source_type, source_id, sideset_id)
 Get the 'with-respect-to' entity of an item in a sideset.

 
 get_geometric_owner (mesh_entity_type, mesh_entity_list)
 Get geometric owners for a set of mesh entities.

 
 get_geometry_owner (entity_type, entity_id)
 Get the geometric owner of a mesh element.

 
 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.

 
Mesh Element Queries
 get_connectivity (entity_type, entity_id)
 Get the list of node IDs comprising a mesh element.

 
 get_expanded_connectivity (entity_type, entity_id)
 Get the list of node IDs for a mesh element, including interior nodes.

 
 get_sub_elements (entity_type, entity_id, dimension)
 Get the lower-dimensional entities of a higher-dimensional mesh element.

 
 get_node_exists (node_id)
 Check whether a node exists in the model.

 
 get_exodus_id (entity_type, entity_id)
 Get the Global Element ID for a mesh entity.

 
 get_element_exists (element_id)
 Check whether a global mesh element ID exists in the model.

 
 get_element_type (element_id)
 Get the specific mesh element type for a global element ID.

 
 get_element_type_id (element_id)
 Map a Global Element ID back to its local mesh entity ID.

 
 get_element_block (element_id)
 Get the block ID containing a given global element.

 
 get_global_element_id (element_type, id)
 Alias for get_exodus_id: get the Global Element ID for a local mesh entity.

 
 get_hex_global_element_id (hex_id)
 Get the Global Element ID for a specific hexahedral element.

 
 get_tet_global_element_id (tet_id)
 Get the Global Element ID for a specific tetrahedral element.

 
 get_wedge_global_element_id (wedge_id)
 Get the Global Element ID for a specific wedge element.

 
 get_pyramid_global_element_id (pyramid_id)
 Get the Global Element ID for a specific pyramid element.

 
 get_tri_global_element_id (tri_id)
 Get the Global Element ID for a specific triangular element.

 
 get_quad_global_element_id (quad_id)
 Get the Global Element ID for a specific quadrilateral element.

 
 get_edge_global_element_id (edge_id)
 Get the Global Element ID for a specific edge element.

 
 get_sphere_global_element_id (sphere_id)
 Get the Global Element ID for a specific node (SPHERE element).

 
 get_node_global_id (node_id)
 Get the global node ID assigned in the Exodus file for a mesh node.

 
 get_closest_node (x_coordinate, y_coordinate, z_coordinate)
 Find the mesh node closest to a given point.

 
 get_nodal_coordinates (node_id)
 Get the coordinates of a mesh node.

 
 get_node_faces (node_id)
 Get the IDs of all quadrilateral elements (faces) adjacent to a node.

 
 get_node_tris (node_id)
 Get the IDs of all triangular elements adjacent to a node.

 
 get_node_edges (node_id)
 Get the IDs of all edge elements adjacent to a node.

 
 get_node_position_fixed (node_id)
 Query whether a mesh node is fixed (constrained against smoothing).

 
 get_mesh_element_type (entity_type, entity_id)
 Get the mesh element type applied to a geometric entity.

 
Geometry Defeaturing Support
 get_small_curves (target_volume_ids, mesh_size)
 Find curves with edge length below a threshold within given volumes.

 
 get_smallest_curves (target_volume_ids, number_to_return)
 Return IDs of the smallest curves in the specified volumes.

 
 get_small_surfaces (target_volume_ids, area_threshold)
 Find surfaces with area below a given threshold.

 
 get_small_surfaces_HR (target_volume_ids, mesh_size)
 Python-callable version: identify small hydraulic-radius surfaces.

 
 is_narrow_surface (surface_id, mesh_size)
 Determine if any two non-adjacent edges on the surface form a narrow region.

 
 get_narrow_surfaces (target_volume_ids, mesh_size)
 Find surfaces with narrow regions in specified volumes.

 
 get_small_and_narrow_surfaces (target_ids, small_area, small_curve_size)
 Find surfaces that are either small in area or contain narrow regions.

 
 get_closed_narrow_surfaces (target_ids, narrow_size)
 Find faces on closed surfaces whose two boundary edges remain within a distance threshold.

 
 get_narrow_regions (target_ids, narrow_size)
 Find faces containing narrow regions within specified volumes.

 
 get_surfs_with_narrow_regions (target_ids, narrow_size)
 Find surfaces with narrow regions based on edge-pair orientation and proximity.

 
 is_close_loop_surface (surface_id, mesh_size)
 Check if a surface has multiple loops closer than a given threshold.

 
 get_close_loops (target_volume_ids, mesh_size)
 Find faces with multiple loops closer than a given threshold.

 
 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.

 
 get_close_loop_thickness (surface_id)
 Compute the minimum separation distance between loops on a surface.

 
 get_small_volumes (target_volume_ids, mesh_size)
 Find volumes whose size is below a threshold based on mesh size.

 
 is_chamfer_surface (surface_id, thickness_threshold)
 Determine if a face's underlying surface is a chamfer.

 
 get_chamfer_surfaces (target_volume_ids, thickness_threshold)
 Get the list of chamfer surfaces for a list of volumes.

 
 get_chamfer_chains (surface_id)
 Returns the chamfer chains for a given surface.

 
 get_chamfer_chain_collections (volume_list, thickness_threshold)
 Return collections of surfaces that form chamfer chains in the specified volumes.

 
 is_cylinder_surface (surface_id)
 Determine if a given face's underlying surface is a circular cylinder.

 
 is_blend_surface (surface_id)
 Determine if a face's underlying surface is a blend (fillet).

 
 get_blend_surfaces (target_volume_ids)
 Find blend (fillet) surfaces within specified volumes.

 
 get_small_radius_blend_surfaces (target_volume_ids, max_radius)
 Find blend surfaces with radius of curvature <= max_radius.

 
 get_blend_chains (surface_id)
 Returns the blend chains for a given surface.

 
 get_blend_chain_collections (volume_list, radius_threshold)
 Return collections of surfaces that form blend chains in the specified volumes.

 
 is_cone_surface (surface_id)
 Determine whether a surface is a cone.

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

 
 get_cone_surfaces (target_volume_ids)
 Identify full conical surfaces in given volumes.

 
 get_surface_cone_collections (volume_list, radius_threshold=0.0)
 Identify collections of surfaces that comprise cones in specified volumes.

 
 is_cavity_surface (surface_id)
 Return whether the specified surface is part of a cavity.

 
 get_cavity_surfaces (surface_id)
 Return the surfaces in the cavity adjacent to the specified surface.

 
 get_protrusion_surfaces (surface_id)
 Return the surfaces in the protrusion connected to the specified surface.

 
 is_protrusion_surface (surface_id)
 Return whether the specified surface is part of a protrusion.

 
 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.

 
 get_surface_protrusion_collections (volume_list, area_threshold=-1, angle_tolerance=-1, combine_protrusions=True)
 Return collections of surfaces that form protrusions in the specified volumes.

 
 is_hole_surface (surface_id, radius_threshold)
 Return whether the specified surface is part of a hole.

 
 get_hole_surfaces (surface_id)
 Return the surfaces in the hole adjacent to the specified surface.

 
 get_surface_hole_collections (volume_list, radius_threshold)
 Return collections of surfaces that form holes in the specified volumes.

 
 is_continuous_surface (surface_id, angle_tol)
 Return whether the surface has any adjacent continuous surfaces.

 
 get_continuous_surfaces (surface_id, angle_tol)
 Return the list of adjacent continuous surfaces.

 
 get_continuous_curves (curve_id, angle_tol, require_two_valent=False)
 Return the list of adjacent continuous curves.

 
 get_continuous_curve_collections (volume_list, angle_tolerance=-1)
 Returns collections of continuous curves in the given volumes.

 
 get_continuous_surface_collections (volume_list, angle_tolerance=-1)
 Returns collections of continuous surfaces in the given volumes.

 
 get_sharp_angle_vertices (target_volume_ids, upper_bound, lower_bound)
 Identify vertices at sharp curve angles in a set of volumes.

 
 get_blunt_tangency_default_depth (vert_id, angle, add_material)
 Computes the default depth used to blunt a tangency at a vertex.

 
 get_tangential_intersections (target_volume_ids, upper_bound, lower_bound)
 Find surfaces with tangential intersection angles outside specified bounds.

 
 get_coincident_vertices (target_volume_ids, high_tolerance)
 Find vertex pairs within a specified tolerance across given volumes.

 
 get_close_vertex_curve_pairs (target_volume_ids, high_tolerance)
 Find pairs of vertices and curves within a specified tolerance across given volumes.

 
 get_overlapping_surfaces_in_bodies (body_ids, filter_slivers=False)
 Identify overlapping surfaces between different volumes in a set of bodies.

 
 find_overlapping_curves (curve_ids)
 Identify overlapping curves in a specified list of curves.

 
 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.

 
 get_overlapping_volumes (target_volume_ids)
 Identify overlapping volumes in a list of volumes.

 
 get_overlapping_volumes_at_volume (volume_id, compare_volumes)
 Identify volumes in the model that overlap a single target volume.

 
 get_overlapping_surfaces_at_surface (surface_id, compare_volumes, cache_overlaps=0)
 Identify surfaces in the model that overlap a single target surface.

 
 get_overlap_max_gap ()
 Get the current maximum gap tolerance used for calculating surface overlaps.

 
 set_overlap_max_gap (maximum_gap)
 Set the maximum gap tolerance for calculating surface overlaps.

 
 get_overlap_min_gap ()
 Get the current minimum gap tolerance used for calculating surface overlaps.

 
 set_overlap_min_gap (min_gap)
 Set the minimum gap tolerance for calculating surface overlaps.

 
 get_overlap_max_angle ()
 Get the current maximum angle tolerance used for calculating surface overlaps.

 
 set_overlap_max_angle (maximum_angle)
 Set the maximum angle tolerance for calculating surface overlaps.

 
 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.

 
 get_nearby_volumes_at_volume (volume_id, compare_volumes, distance)
 Get the list of nearby volumes from the model for a single volume :type volume_id: int.

 
 get_unmerged_curves_on_shells (shell_vols, thickness)
 Identify unmerged curves between sheet (shell) volumes for use in shell construction workflows.

 
 get_mergeable_vertices (target_volume_ids)
 Get the list of mergeable vertices from a list of volumes or bodies.

 
 get_mergeable_curves (target_volume_ids)
 Get the list of mergeable curves from a list of volumes or bodies.

 
 get_mergeable_surfaces (target_volume_ids)
 Get the list of mergeable surfaces from a list of volumes or bodies.

 
 get_merge_tolerance ()
 Return the current merge tolerance value.

 
Geometry ITEM Solutions
 get_solutions_for_close_loop (surface_id, mesh_size)
 Retrieve recommended remedies for a close-loop surface to resolve narrow regions.

 
 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.

 
 get_solutions_for_bad_geometry (geom_type, geom_id)
 Provide remedy for bad geometry via ACIS healing (deprecated).

 
 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.

 
 get_solutions_for_overlapping_surfaces (surface_id_1, surface_id_2)
 Suggests remedies for two overlapping surfaces on different volumes.

 
 get_volume_gap_solutions (surface_id_1, surface_id_2)
 Suggests remedies for a gap between two surfaces on different volumes.

 
 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.

 
 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.

 
 get_solutions_for_imprint_merge (surface_id1, surface_id2)
 Suggests remedies for imprint/merge when two overlapping surfaces are on different volumes.

 
 get_solutions_for_volumes (vol_id, small_curve_size, mesh_size)
 Recommend remediation operations for volumes with features below a size threshold.

 
 get_solutions_for_classified_volume (classification, vol_id)
 Suggests geometry fixes or feature operations for a volume based on its classification.

 
 get_solutions_for_bolt (bolt_id, insert_id, threaded_vol_id)
 Suggests operations for a volume classified as a bolt using known subcomponent IDs.

 
 get_solutions_for_bolt_hole (bearing_hole, threaded_holes)
 Suggests repair or modification options for a set of concentric fastener pilot holes.

 
 get_solutions_for_classified_surface (classification, surf_id)
 Suggests remedies or modifications for a classified surface.

 
 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.

 
 get_solutions_for_sheet_volumes (vol_ids, thickness)
 Propose surface-extension and imprint/merge operations to connect sheet bodies.

 
 get_solutions_for_sheet_volume_connection (*args, **kwargs)
 Propose surface-tweak, imprint, and merge operations to bridge two sheet-volume sets.

 
 get_solutions_for_small_surfaces (surface_id, small_curve_size, mesh_size)
 Recommend remedial operations on a surface already flagged as small.

 
 get_solutions_for_connected_surfaces (surf_ids, common_surface_type)
 Propose two operations for a connected set of surfaces.

 
 get_solutions_for_small_curves (curve_id, small_curve_size, mesh_size)
 Recommend remedial operations on a curve already flagged as small.

 
 get_solutions_for_sharp_angle_vertex (vertex_id, small_curve_size, mesh_size)
 Retrieve recommended remedies for a sharp angle at a vertex.

 
 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.

 
 get_solutions_for_cone_surface (surface_id)
 Suggests remedies for a surface classified as a cone.

 
 get_solutions_for_decomposition (volume_list, exterior_angle, do_imprint_merge, tolerant_imprint)
 Provide possible decomposition solutions for volumes based on exterior angle criteria.

 
 get_solutions_for_blends (surface_id)
 Provide possible blend removal solutions for a given surface (and its blend chain if applicable).

 
 get_solutions_for_chamfers (surface_id)
 Provide possible chamfer removal solutions for a given surface (and its chamfer chain if applicable).

 
 get_solutions_for_cavity_surface (surface_id)
 Provide possible cavity removal or adjustment solutions for a given surface (and its cavity if applicable).

 
 get_solutions_for_protrusion_surface (surface_id)
 Provide possible protrusion removal or adjustment solutions for a given surface (and its protrusion if applicable).

 
 get_mesh_error_solutions (error_code)
 Retrieve recommended solutions and context cues for a mesh error.

 
Geometry Idealization Support
 get_reduce_bolt_core_default_dimensions (vol_id)
 Computes default core dimensions for a bolt volume in reduce bolt core operation.

 
 get_bolt_diameters (vol_ids)
 Get the shank diameters of specified bolt volumes.

 
 get_bolt_axis (vol_id)
 Get the normalized axis vector of a bolt volume.

 
 get_bolt_shigley_radius (bolt_id, angle, washer_id=0)
 Get the equivalent Shigley frustum radius at the bolt interface.

 
 get_bolt_washer (bolt_id)
 Get the washer volume ID associated with a given bolt.

 
 get_bolt_coordinate_system (geom_type, id)
 Get local coordinate system for a bolt or bolt hole.

 
 get_bolt_clamped_members (vol_ids, nearby_vols, progress=None)
 Identify clamped members associated with a bolt.

 
 get_bolts_in_clamped_members (geo_type, clamped_vols, candidate_bolts)
 Identify bolts clamping the given volumes or blocks.

 
 get_bolt_holes_info (geo_type, clamped_members, radius_threshold, gap_threshold)
 Identify concentric pilot holes across clamped members.

 
 get_bolt_holes (geo_type, clamped_members, radius_threshold, gap_threshold)
 Identify upper and lower pilot hole surfaces from clamped members.

 
 get_2D_sheet_volumes (vol_id)
 Get associated 2D sheet volumes from a reduced 3D thin volume.

 
 get_3D_thin_volume (vol_id)
 Get the original 3D thin volume associated with a 2D sheet volume.

 
Blocks, Sidesets, and Nodesets
 get_block_count ()
 Get the current number of element blocks in the model.

 
 get_block_id (entity_type, entity_id)
 Get the element block ID associated with a geometric entity.

 
 get_block_name (block_id)
 Get the block name for a given block id.

 
 get_block_ids (mesh_geometry_file_name)
 Get list of block IDs from a mesh geometry file.

 
 get_block_id_list ()
 Get a list of all active block IDs.

 
 get_next_block_id ()
 Get the next available block ID.

 
 get_block_volumes (block_id)
 Get the list of volume IDs contained in a block.

 
 get_block_surfaces (block_id)
 Get the list of surface IDs contained in a block.

 
 get_block_curves (block_id)
 Get the list of curve IDs contained in a block.

 
 get_block_vertices (block_id)
 Get the list of vertex IDs contained in a block.

 
 get_block_nodes (block_id)
 Get the list of node IDs contained in a block.

 
 get_block_edges (block_id)
 Get the list of edge IDs contained in a block.

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

 
 get_block_faces (block_id)
 Get the list of face IDs contained in a block.

 
 get_block_pyramids (block_id)
 Get the list of pyramid IDs contained in a block.

 
 get_block_wedges (block_id)
 Get the list of wedge IDs contained in a block.

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

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

 
 get_block_element_type (block_id)
 Get the element type associated with a block.

 
 get_block_attribute_count (block_id)
 Get the number of attributes assigned to a block.

 
 get_block_element_attribute_count (block_id)
 Get the number of attributes defined for elements in the specified block.

 
 get_block_attribute_value (block_id, attribute_index)
 Get the value of a specific attribute for a block.

 
 get_block_attribute_name (block_id, attribute_index)
 Get the name of a specific attribute for a block.

 
 get_block_element_attribute_names (block_id)
 Get the list of attribute names associated with block elements.

 
 get_valid_block_element_types (block_id)
 Get a list of valid element types for the specified block.

 
 get_block_material (block_id)
 Get the ID of the material assigned to the specified block.

 
 get_blocks_with_materials ()
 Get all block IDs and their associated material IDs.

 
 get_sideset_count ()
 Get the current number of sidesets in the model.

 
 get_sideset_id_list ()
 Get a list of all active sideset IDs.

 
 get_next_sideset_id ()
 Get the next available sideset ID.

 
 get_sideset_curves (sideset_id)
 Get the list of curve IDs associated with a sideset.

 
 get_sideset_edges (sideset_id)
 Get the list of edge IDs contained in a sideset.

 
 get_sideset_surfaces (sideset_id)
 Get the list of surface IDs contained in a sideset.

 
 get_sideset_quads (sideset_id)
 Get the list of quadrilateral (quad) element IDs contained in a sideset.

 
 get_sideset_tris (sideset_id)
 Get the list of triangle (tri) element IDs contained in a sideset.

 
 get_sideset_area (sideset_id)
 Get the total area of a sideset.

 
 get_sideset_element_type (sideset_id)
 Get the element type of a sideset.

 
 get_sideset_contact_pairs (geom_type, ent_list, geom_tol=-1.0)
 Identify sideset-based contact interfaces and return compact integer interaction records.

 
 get_nodeset_count ()
 Get the current number of nodesets in the model.

 
 get_nodeset_id_list ()
 Get a list of all active nodeset IDs.

 
 get_next_nodeset_id ()
 Get the next available nodeset ID.

 
 get_nodeset_volumes (nodeset_id)
 Get the list of volume IDs associated with a nodeset.

 
 get_nodeset_surfaces (nodeset_id)
 Get the list of surface IDs associated with a nodeset.

 
 get_nodeset_curves (nodeset_id)
 Get the list of curve IDs associated with a nodeset.

 
 get_nodeset_vertices (nodeset_id)
 Get the list of vertex IDs associated with a nodeset.

 
 get_nodeset_nodes (nodeset_id)
 Get the list of node IDs explicitly assigned to a nodeset.

 
 get_nodeset_nodes_inclusive (nodeset_id)
 Get the list of node IDs associated with a nodeset (inclusive).

 
 get_nodeset_node_count (nodeset_id)
 Get the number of nodes in a nodeset.

 
 get_exodus_element_count (entity_id, entity_type)
 Get the number of elements in a Exodus entity.

 
 get_exodus_entity_name (entity_type, entity_id)
 Get the name of an Exodus entity.

 
 get_exodus_entity_type (entity_type, entity_id)
 Get the Exodus type of an entity.

 
 get_exodus_entity_description (entity_type, entity_id)
 Get the description of an Exodus entity.

 
 get_all_exodus_times (filename)
 Get all available time steps from an Exodus file.

 
 get_exodus_variable_names (container_type, container_id)
 Get the names of Exodus variables in a nodeset, sideset, or block.

 
 get_all_exodus_variable_names (filename, variable_type)
 Get all variable names of a given type from an Exodus file.

 
 get_exodus_variable_count (container_type, container_id)
 Get the number of Exodus variables in a nodeset, sideset, or block.

 
 get_copy_nodeset_on_geometry_copy_setting ()
 Get the current nodeset behavior setting for geometry copy.

 
 get_copy_sideset_on_geometry_copy_setting ()
 Get the current sideset behavior setting for geometry copy.

 
 get_copy_block_on_geometry_copy_setting ()
 Get the current block behavior setting for geometry copy.

 
 set_copy_nodeset_on_geometry_copy_setting (val)
 Set the behavior for nodeset propagation during geometry copy.

 
 set_copy_sideset_on_geometry_copy_setting (val)
 Set the behavior for sideset propagation during geometry copy.

 
 set_copy_block_on_geometry_copy_setting (val)
 Set the behavior for block propagation during geometry copy.

 
Group Support
 get_group_groups (group_id)
 Retrieve direct child group IDs for a specified parent group, if any.

 
 get_group_volumes (group_id)
 Return direct child volume IDs for a specified group, if any.

 
 get_group_bodies (group_id)
 Return direct child body IDs for a specified group, if any.

 
 get_group_surfaces (group_id)
 Return direct child surface IDs for a specified group, if any.

 
 get_group_curves (group_id)
 Return direct child curve IDs for a specified group, if any.

 
 get_group_vertices (group_id)
 Return direct child vertex IDs for a specified group, if any.

 
 get_group_nodes (group_id)
 Return direct child node IDs for a specified group, if any.

 
 get_group_edges (group_id)
 Return direct child edge IDs for a specified group, if any.

 
 get_group_quads (group_id)
 Return direct child quad IDs for a specified group, if any.

 
 get_group_tris (group_id)
 Return direct child triangle IDs for a specified group, if any.

 
 get_group_tets (group_id)
 Return direct child tetrahedron IDs for a specified group, if any.

 
 get_group_wedges (group_id)
 Return direct child wedge element IDs for a specified group, if any.

 
 get_group_pyramids (group_id)
 Return direct child pyramid element IDs for a specified group, if any.

 
 get_group_spheres (group_id)
 Return direct child sphere element IDs for a specified group, if any.

 
 get_group_hexes (group_id)
 Return direct child hexahedral element IDs for a specified group, if any.

 
 get_next_group_id ()
 Return the next available group ID from Cubit.

 
 delete_all_groups ()
 Remove all groups from the current Cubit session.

 
 delete_group (group_id)
 Delete a specific group by ID.

 
 set_max_group_id (maximum_group_id)
 Reset Cubit's internal maximum group ID to a specified value.

 
 create_new_group ()
 Create a new, empty group and return its ID.

 
 remove_entity_from_group (group_id, entity_id, entity_type)
 Remove a specific entity from a given group.

 
 add_entity_to_group (group_id, entity_id, entity_type)
 Add a specific entity to a given group.

 
 add_entities_to_group (group_id, entity_ids, entity_type)
 Add a list of entities to a specified group.

 
 group_names_ids ()
 Retrieve names and IDs of all defined groups (excluding the pick group).

 
 get_mesh_group_parent_ids (element_type, element_id)
 Retrieve parent group IDs for a specific mesh element.

 
 is_mesh_element_in_group (element_type, element_id)
 Check if a specific mesh element belongs to any group.

 
Metadata Support
 get_assembly_classification_level ()
 Get classification level metadata.

 
 get_assembly_classification_category ()
 Get classification category metadata.

 
 get_assembly_weapons_category ()
 Get weapons category metadata.

 
 get_assembly_metadata (volume_id, data_type)
 Get metadata for a specified volume.

 
 is_assembly_metadata_attached (volume_id)
 Check if metadata is attached to a volume.

 
 get_assembly_name (assembly_id)
 Get the name of an assembly node.

 
 get_assembly_path (assembly_id)
 Get the full path of an assembly node, identifying its hierarchy.

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

 
 get_parent_assembly_path (assembly_id)
 Get the path of an assembly node's parent.

 
 get_assembly_level (assembly_id)
 Get the hierarchy level of an assembly node.

 
 get_assembly_description (assembly_id)
 Get the description of an assembly node.

 
 get_assembly_instance (assembly_id)
 Get the instance number of an assembly node.

 
 get_parent_assembly_instance (assembly_id)
 Get the instance number of the parent of an assembly node.

 
 get_assembly_file_format (assembly_id)
 Get the file format from which the assembly node was imported.

 
 get_assembly_units (assembly_id)
 Get the units of measurement used in the assembly node.

 
 get_assembly_material_description (assembly_id)
 Get the material description for a part.

 
 get_assembly_material_specification (assembly_id)
 Get the material specification for a part.

 
Non-Exodus Boundary Condition Support
 get_bc_id_list (bc_type_enum)
 Get active boundary condition (BC) IDs of a specified type.

 
 get_bc_name (bc_type_enum, bc_id)
 Get the name of a specific boundary condition (BC).

 
 get_nodeset_id_list_for_bc (bc_type_enum, bc_id)
 Get list of nodeset IDs associated with a boundary condition.

 
 get_sideset_id_list_for_bc (bc_type_enum, bc_id)
 Get list of sideset IDs associated with a boundary condition.

 
 is_on_thin_shell (bc_type_enum, entity_id)
 Check if a boundary condition is applied to a thin shell.

 
 temperature_is_on_solid (bc_type_enum, entity_id)
 Check if a temperature BC is applied to a solid region.

 
 convection_is_on_solid (entity_id)
 Check if a convection BC is on a solid.

 
 convection_is_on_shell_area (entity_id, shell_area_enum)
 Check if a convection BC is on a shell top or bottom.

 
 get_convection_coefficient (entity_id, bc_type_enum)
 Get convection coefficient from a convection BC.

 
 get_bc_temperature (bc_type_enum, entity_id, temp_type_enum)
 Get the temperature value for a specified BC area.

 
 temperature_is_on_shell_area (bc_type_enum, bc_area_enum, entity_id)
 Check if a temperature BC is on a shell area.

 
 heatflux_is_on_shell_area (bc_area_enum, entity_id)
 Check if a heatflux BC is on a shell area.

 
 get_heatflux_on_area (bc_area_enum, entity_id)
 Get the heatflux value on a specified area.

 
 get_cfd_type (entity_id)
 Get the CFD boundary condition subtype.

 
 get_contact_pair_friction_value (entity_id)
 Get the friction value for a contact pair.

 
 get_contact_pair_tolerance_value (entity_id)
 Get the upper bound tolerance for a contact pair.

 
 get_contact_pair_tol_lower_value (entity_id)
 Get the lower bound tolerance for a contact pair.

 
 get_contact_pair_tied_state (entity_id)
 Get the tied state of a contact pair.

 
 get_contact_pair_general_state (entity_id)
 Get the general contact state.

 
 get_contact_pair_exterior_state (entity_id)
 Get the exterior state of a contact pair.

 
 get_velocity_combine_type (entity_id)
 Get the velocity's combine type.

 
 get_acceleration_combine_type (entity_id)
 Get the combine method for an acceleration BC.

 
 get_displacement_combine_type (entity_id)
 Get the combine method for a displacement BC.

 
 get_pressure_value (entity_id)
 Get the magnitude value of a pressure BC.

 
 get_pressure_function (entity_id)
 Get the function expression associated with a pressure BC.

 
 get_force_magnitude (entity_id)
 Get the force magnitude of a force BC.

 
 get_moment_magnitude (entity_id)
 Get the moment magnitude of a force BC.

 
 get_force_direction_vector (entity_id)
 Get the direction vector of a force BC.

 
 get_force_moment_vector (entity_id)
 Get the moment vector of a force BC.

 
 get_constraint_type (constraint_id)
 Get the type of a specified constraint.

 
 get_constraint_reference_point (constraint_id)
 Get the reference point of a specified constraint.

 
 get_constraint_dependent_entity_point (constraint_id)
 Get the dependent entity of a specified constraint.

 
 get_material_property (material_property_enum, entity_id)
 Get the value of a material property.

 
 get_media_property (entity_id)
 Get the media classification of a material.

 
 get_media_name_list ()
 Get list of all CFD media names.

 
 get_material_name_list ()
 Get list of all material names.

 
 get_material_name (material_id)
 Get the name of a material or CFD media by ID.

 
Boundary Layer Support
 get_next_boundary_layer_id ()
 Get the next available boundary layer ID.

 
 is_boundary_layer_id_available (boundary_layer_id)
 Check if a boundary layer ID is currently available.

 
 get_boundary_layer_algorithm (boundary_layer_id)
 Get the algorithm type used by the specified boundary layer.

 
 get_boundary_layers_by_base (base_type, base_id)
 Get all boundary layers associated with a specified base entity.

 
 get_boundary_layers_by_pair (base_type, base_id, parent_id)
 Get all boundary layers associated with a base-parent pair.

 
 get_boundary_layer_continuity (boundary_layer_id)
 Get the continuity setting of a boundary layer.

 
 get_boundary_layer_id_list ()
 Get a list of all defined boundary layer IDs.

 
Machine Learning Support
 load_ML (*args, **kwargs)
 Load machine learning training data into memory.

 
 unload_ML (*args, **kwargs)
 Unload machine learning training data from memory.

 
 get_ML_operation_features (ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
 Compute ML feature vectors for a list of Cubit operations.

 
 get_ML_features (ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
 Compute ML feature vectors for operations permitting multiple entities.

 
 get_ML_predictions (ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
 Compute ML predictions for a list of operations on single-entity pairs.

 
 do_ML_predictions (ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
 Compute ML predictions for a list of operations with multiple entities.

 
 get_ML_classification (geom_type, ent_id)
 Get the top classification label for a single volume or surface.

 
 get_ML_classifications (geom_type, ent_ids)
 Classify multiple volumes or surfaces in a single batch operation.

 
 get_ML_classification_categories (geom_type)
 Retrieve all available classification categories for a geometry type.

 
 ML_train (geom_type)
 Force retraining of the ML classification model for a specific geometry type.

 
 get_ML_operation_feature_types (ml_op_name, reduced_features=False)
 Get the data-type descriptor for each feature of a specified ML operation.

 
 get_ML_operation_feature_names (ml_op_name, reduced_features=False)
 Retrieve the list of feature names for a specified ML operation.

 
 get_ML_operation_feature_size (ml_op_name, reduced_features=False)
 Retrieve the expected feature-vector length for a given ML operation.

 
 get_ML_operation_label_size (ml_op_name)
 Retrieve the expected label vector length for a given ML operation.

 
 get_ML_classification_models ()
 Retrieve the list of supported classification ML model names.

 
 get_ML_regression_models ()
 Retrieve the list of supported regression ML model names.

 
 get_ML_model_name (model_ID)
 Retrieve the name of an ML model based on its ID.

 
 get_ML_model_ID (model_name)
 Retrieve the unique numeric ID for a given ML model or operation name.

 
 get_ML_operation (op_name, entity_id1, entity_id2, params, user_configs, small_curve_size, mesh_size)
 Generate the command, display label, and preview text for an ML operation.

 
 get_ML_feature_importances (op_name)
 Retrieve feature importance scores for a given ML operation.

 
 get_ML_feature_distance (op_name, f1, f2)
 Compute the weighted distance between two feature vectors.

 
 set_ML_base_user_dir (path, print_info=False)
 Set the root directory for user-provided ML training data (classification only).

 
 get_ML_initialize_surviving_entities (op_name, ent1, ent2)
 Capture entities for survival tracking before a CAD operation.

 
 get_ML_surviving_entities (op_name, begin_ents)
 Identify which entities survive after a CAD operation.

 

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
 
 WEDGE12 = _cubit3.WEDGE12
 
 WEDGE15 = _cubit3.WEDGE15
 
 WEDGE16 = _cubit3.WEDGE16
 
 WEDGE20 = _cubit3.WEDGE20
 
 WEDGE21 = _cubit3.WEDGE21
 
 WEDGE6 = _cubit3.WEDGE6
 

Function Documentation

◆ _decr_acis()

_decr_acis ( )
protected

◆ _incr_acis()

_incr_acis ( )
protected

◆ add_entities_to_group()

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.
# 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]
get_group_vertices(group_id)
Return direct child vertex IDs for a specified group, if any.
Definition cubit.py:21564
cmd(input_string)
Execute a raw Cubit command string immediately (modifies model state).
Definition cubit.py:5275
add_entities_to_group(group_id, entity_ids, entity_type)
Add a list of entities to a specified group.
Definition cubit.py:22113
create_new_group()
Create a new, empty group and return its ID.
Definition cubit.py:22006
 @n type of group_id:  int
Parameters
group_idID of the group to which entities will be added.

type of entity_ids: std::vector< int,std::allocator< int > >
entity_idsVector of entity IDs to add.

type of entity_type: string
entity_typeType of the entities (e.g., "vertex", "curve", "surface", "volume"). Only geometric entities are supported.

return type of : void
Returns
None.

◆ add_entity_to_group()

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.
# 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]"
add_entity_to_group(group_id, entity_id, entity_type)
Add a specific entity to a given group.
Definition cubit.py:22076
 @n type of group_id:  int
Parameters
group_idID of the group to which the entity will be added.

type of entity_id: int
entity_idID of the entity to add.

type of entity_type: string
entity_typeType 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()

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"
add_filename_to_recent_file_list(filename)
Add a filename to Cubit's recent-file list in the GUI File menu.
Definition cubit.py:4306
 @n type of filename:  string
Parameters
filenameReference to the file path string to add to the recent-file list.

◆ add_filter_type()

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
add_filter_type(filter_type)
Add an entity type to the graphics pick filter.
Definition cubit.py:6776
 @n type of filter_type:  string
Parameters
filter_typeEntity type to add to the pickable set (e.g., "vertex", "curve", "surface", "volume", "node", "edge", "face").

◆ app_util()

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'])
cml = cubitml.CubitML(util)
ml = cubitml.MLUtil(cml, geom)
ml.load_ML()
cgm_iface()
Return the CGM-based geometry interface for Cubit.
Definition cubit.py:5228
app_util()
Return Cubit's AppUtil interface for global services.
Definition cubit.py:5199
init(argv)
Initialize the Cubit engine with optional startup arguments.
Definition cubit.py:3811

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()

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")
# 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
are_adjacent_curves(curve_ids)
Return whether two or more curves share at least one manifold vertex.
Definition cubit.py:10709
 @n type of curve_ids:  std::vector< int,std::allocator< int > >
Parameters
curve_idsIDs 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()

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")
# Expected output:
# True
# Expected output:
# False
are_adjacent_surfaces(surface_ids)
Return whether two or more surfaces share at least one manifold curve.
Definition cubit.py:10671
 @n type of surface_ids:  std::vector< int,std::allocator< int > >
Parameters
surface_idsIDs 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()

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()

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.
best_edge_to_collapse_interior_node(node_id)
Find the best edge to collapse to remove an interior node in a triangular mesh.
Definition cubit.py:10273

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_idID 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()

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())
body(id_in)
Retrieve a body by its ID.
Definition cubit.py:23911
  @n type of id_in:  int
Parameters
id_inID of the body to retrieve.

return type of : :py:class: Body
Returns
Body object corresponding to the specified ID.

◆ brick()

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
brick(width, depth=-1, height=-1)
Create a brick of specified width, depth, and height.
Definition cubit.py:24090
  @n type of width:  float, in
Parameters
widthWidth of the brick (or cube side length if only this argument is supplied).

type of depth: float, in, optional
depthDepth of the brick (default = -1, uses width).

type of height: float, in, optional
heightHeight 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()

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.
print(f"Estimated time step: {dt}")
calculate_timestep_estimate(entity_type, entity_ids)
Estimate the time step based on element sizes and material properties.
Definition cubit.py:10131
 @n type of entity_type:  string
Parameters
entity_typeMesh element type string ("tet", "hex", "volume", "block", "group").

type of entity_ids: std::vector< int,std::allocator< int > >
entity_idsList 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()

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}")
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.
Definition cubit.py:10171
 @n type of entity_type:  string
Parameters
entity_typeMesh element type ("tet", "hex", "volume", "block", "group").

type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_listVector of element IDs to include.

type of density: float
densityMaterial density.

type of youngs_modulus: float
youngs_modulusYoung's modulus.

type of poissons_ratio: float
poissons_ratioPoisson's ratio.

return type of : float
Returns
Smallest stable time step estimate.

◆ cgm()

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()

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'])
cml = cubitml.CubitML(util)
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()

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")
clear_drawing_set(set_name)
Clear all geometry in a named drawing set (e.g., mesh preview).
Definition cubit.py:6406
 @n type of set_name:  string
Parameters
set_nameName of the drawing set to clear.

◆ clear_highlight()

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_highlight()
Clear all entity highlights.
Definition cubit.py:6502

◆ clear_picked_list()

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_picked_list()
Clear the list of currently picked entities.
Definition cubit.py:6872

◆ clear_preview()

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
clear_preview()
Clear preview graphics without affecting other display settings.
Definition cubit.py:6526

◆ cmd()

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_stringNull-terminated C string containing the complete Cubit command.

return type of : boolean
Returns
true if the command executed successfully; false otherwise.

◆ contains_virtual()

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)
contains_virtual(geometry_type, entity_id)
Query whether any child entities of a specified geometry entity are virtual.
Definition cubit.py:11183
 @n type of geometry_type:  string
Parameters
geometry_typeThe type of geometry ("curve", "surface", "volume", etc.).

type of entity_id: int
entity_idThe 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()

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_idID of the BC.

type of shell_area_enum: int
shell_area_enumUse 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()

convection_is_on_solid ( entity_id)

Check if a convection BC is on a solid.



type of entity_id: int

Parameters
entity_idID of the convection boundary condition.

return type of : boolean
Returns
True if the BC is applied to a solid region.

◆ copy_body()

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
copy_body(init_body)
Create a duplicate of the specified body.
Definition cubit.py:24600
  @n type of init_body:  :py:class:`Body`, in
Parameters
init_bodyBody object to duplicate.

type of init_body: :py:class:Body, in
init_bodyBody 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()

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
create_vertex(x, y, z)
Create a vertex at specified coordinates.
Definition cubit.py:24340
create_arc_curve(v0, v1, intermediate_point)
Create an arc curve using end vertices and an intermediate point.
Definition cubit.py:24417
  @n type of v0:  :py:class:`Vertex`, in
Parameters
v0The start vertex of the arc.

type of v1: :py:class:Vertex, in
v1The end vertex of the arc.

type of intermediate_point: std::array< double,3 >, in
intermediate_pointArray of three coordinates representing a point on the arc.

return type of : :py:class: Curve
Returns
Curve object representing the created arc.

◆ create_curve()

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
create_curve(v0, v1)
Create a curve between two vertices.
Definition cubit.py:24377
  @n type of v0:  :py:class:`Vertex`, in
Parameters
v0The start vertex of the curve.

type of v1: :py:class:Vertex, in
v1The end vertex of the curve.

return type of : :py:class: Curve
Returns
Curve object representing the connection between the vertices.

◆ create_new_group()

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_nurbs_curve()

create_nurbs_curve ( degree,
ctrl_pts,
weights,
knot_vec )

Creates a NURBS curve... code-block:: c++.

   // Create a degree 2 NURBS curve std::vector<double> pts = { 0.0,  2.0, 0.0,                             1.0,  1.0, 0.0,                            -1.0,  0.0, 0.0,                             0.0, -1.0, 0.0}; std::vector<double> weights = {1.0, 0.5, 1.0, 1.0}; std::vector<double> knot_vec = {0.0, 0.0, 0.5, 1.0, 1.0}; int curve_id = CubitInterface::create_nurbs_curve(2, pts, weights, knot_vec); .. code-block:: c++

Create a degree 2 NURBS curve pts = [] pts.extend([ 0.0, 2.0, 0.0]) pts.extend([ 1.0, 1.0, 0.0]) pts.extend([-1.0, 0.0, 0.0]) pts.extend([ 0.0, -1.0, 0.0]) weights = [1.0, 0.5, 1.0, 1.0] knot_vec = [0.0, 0.0, 0.5, 1.0, 1.0] curve_id = cubit.create_nurbs_curve(2, pts, weights, knot_vec) :type degree: int, in

Parameters
degreeThe degree of the NURBS curve. :type ctrl_pts: std::vector< double,std::allocator< double > >, in
ctrl_ptsA list of x, y, z coordinates representing the control points. The list should be of the form [x0, y0, z0, x1, y1, z1, ... , xn, yn, zn]. The minimum size of this list must be degree + 1. :type weights: std::vector< double,std::allocator< double > >, in
weightsA list of weights for each control point. The size of this list should be equal to the number of control points. :type knot_vec: std::vector< double,std::allocator< double > >, in
knot_vecThe knot vector for the curve. This size of this list should be (num_ctrl_pts + degree - 1) or (num_ctrl_pts + degree + 1). If the former, end knot multiplicity should be the same as degree. If the latter, end knot multiplicity should be degree + 1. :rtype: int
Returns
The ID of the newly created curve. If curve creation was unsuccessful, returns -1.

◆ create_spline()

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
surface(id_in)
Retrieve a surface object by its ID.
Definition cubit.py:23968
create_spline(points, surface_id)
Create a spline curve through a sequence of 3D points on a surface.
Definition cubit.py:24460
  @n type of points:  std::vector< std::array< double,3 >,std::allocator< std::array< double,3 > > >, in
Parameters
pointsOrdered list of 3D coordinates (each array length = 3); must contain at least two points.

type of surface_id: int, in
surface_idID 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()

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
create_surface(curves)
Create a sheet body from boundary curves.
Definition cubit.py:24506
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curvesList 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()

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).
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
xX-coordinate of the vertex (default = 0).

type of y: float, in
yY-coordinate of the vertex (default = 0).

type of z: float, in
zZ-coordinate of the vertex (default = 0).

return type of : :py:class: Vertex
Returns
Vertex object located at the specified coordinates.

◆ create_window()

create_window ( )

◆ current_selection_count()

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)
current_selection_count()
Get the number of entities in the current selection list.
Definition cubit.py:6973
 @n return type of :  int
Returns
Number of entities currently selected.

◆ curve()

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())
curve(id_in)
Retrieve a curve object by its ID.
Definition cubit.py:23996
  @n type of id_in:  int
Parameters
id_inID of the curve to retrieve.

return type of : :py:class: Curve
Returns
Curve object corresponding to the specified ID.

◆ cylinder()

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())
cylinder(height, x_radius, y_radius, top_radius)
Create a cylinder or truncated cone of specified dimensions.
Definition cubit.py:24260
  @n type of height:  float, in
Parameters
heightHeight of the cylinder.

type of x_radius: float, in
x_radiusRadius in the x direction (base ellipse x-axis).

type of y_radius: float, in
y_radiusRadius in the y direction (base ellipse y-axis).

type of top_radius: float, in
top_radiusRadius 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()

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"
get_entities(entity_type)
Retrieve IDs of all current entities of a specified type (geometry and mesh).
Definition cubit.py:10428
delete_all_groups()
Remove all groups from the current Cubit session.
Definition cubit.py:21932
 @n return type of :  void
Returns
None.

◆ delete_group()

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.
# Verify deletion: remaining groups should not include g1.
groups = cubit.get_entities("group")
print("Remaining groups:", groups) # prints list containing only g2's ID
delete_group(group_id)
Delete a specific group by ID.
Definition cubit.py:21963
get_id_from_name(name)
Retrieve the integer ID of an entity by its name.
Definition cubit.py:11497
 @n type of group_id:  int
Parameters
group_idID of the group to delete.

return type of : void
Returns
None.

◆ delete_window()

delete_window ( id)

◆ destroy()

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()
destroy()
Shut down Cubit and close the active journal file.
Definition cubit.py:3835



return type of : int

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

◆ developer_commands_are_enabled()

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()

do_ML_predictions ( ml_op_names,
entity1_ids,
entity2_ids,
params,
user_configs,
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.

  @n type of ml_op_names:  std::vector< std::string,std::allocator< std::string > >
Parameters
ml_op_namesVector 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_idsVector 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_idsVector 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 > > > >
paramsVector of parameter lists for each operation.

type of user_configs: std::vector< double,std::allocator< double > >
user_configsVector of user configurable settings (geometry sizing and regularize).

type of mesh_size: float
mesh_sizeTarget mesh size used in feature calculation.

type of reduced_features: boolean, optional
reduced_featuresIf 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]]
user_configs = [1, 0]
mesh_size = 1.5
ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size)
do_ML_predictions(ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
Compute ML predictions for a list of operations with multiple entities.
Definition cubit.py:23365

◆ entity_exists()

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'}")
entity_exists(entity_type, id)
Check whether an entity of the specified type and ID exists.
Definition cubit.py:5696
 @n type of entity_type:  string
Parameters
entity_typeType of the entity being queried (e.g. "surface", "curve", "volume").

type of id: int
idID of the entity.

return type of : boolean
Returns
true if the entity exists, false otherwise.

◆ evaluate_exterior_angle()

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,)
evaluate_exterior_angle(curve_list, test_angle)
Find curves whose exterior angle between adjacent surfaces is less than a given threshold.
Definition cubit.py:12036
get_current_ids(entity_type)
Retrieve IDs of all current geometry entities of a specified type.
Definition cubit.py:10460
 @n type of curve_list:  std::vector< int,std::allocator< int > >
Parameters
curve_listVector of curve IDs to test.

type of test_angle: float
test_angleExterior 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()

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
evaluate_exterior_angle_at_curve(curve_id, volume_id)
Return the exterior angle at a single curve with respect to a volume.
Definition cubit.py:11997
 @n type of curve_id:  int
Parameters
curve_idID of the curve.

type of volume_id: int
volume_idID 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()

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
evaluate_surface_angle_at_vertex(surf_id, vert_id)
Return the interior angle at a vertex on a specified surface.
Definition cubit.py:12390
 @n type of surf_id:  int
Parameters
surf_idID of the surface.

type of vert_id: int
vert_idID 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()

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)
exodus_sizing_function_file_exists()
Check if the Exodus sizing function file currently exists.
Definition cubit.py:9387
 @n return type of :  boolean
Returns
True if the imported Exodus II sizing file still exists on disk; false otherwise.

◆ find_cone_surfaces()

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(7)
print("Cone surfaces starting from 7:", [int(sid) for sid in cone_surfaces1])
# Expected output:
# Cone surfaces starting from 7: [7,8]
find_cone_surfaces(surface_id)
Identify cone surface(s) starting from a candidate surface.
Definition cubit.py:15686
 @n type of surface_id:  int
Parameters
surface_idSurface 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()

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:")
find_overlapping_curves(curve_ids)
Identify overlapping curves in a specified list of curves.
Definition cubit.py:16608

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_idsList 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.

◆ fire_ray()

fire_ray ( origin,
direction,
target_type,
target_ids,
max_hits = 0,
ray_radius = 0.0 )

Fire a ray at a list of target entities and return the hit locations and entity ids.

:type origin: std::array< double,3 >

Parameters
originxyz coordinate of ray start point :type direction: std::array< double,3 >
directionxyz vector defining ray orientation :type target_type: string
target_typeone of vertex, curve, surface, volume, or body :type target_ids: std::vector< int,std::allocator< int > >
target_idsone or more entity ids for targets :type max_hits: int, optional
max_hits[optional] the number of intersection hits to find. If 0 get all intersections. :type ray_radius: float, optional
ray_radius[optional] a tolerance on the ray for intersection calculations :rtype: std::pair< std::vector< std::array< double,3 >,std::allocator< std::array< double,3 > > >,std::vector< int,std::allocator< int > > >
Returns
a pair of a vector of hit locations and a vector of ids of the type specified in target_type. No ids are returned if the intersections are not of the specified type.

◆ flush_graphics()

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")
flush_graphics()
Force immediate rendering of pending graphics operations.
Definition cubit.py:6079

◆ gather_surfaces_by_orientation()

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.
gather_surfaces_by_orientation(seed_surf_ids, all_surf_ids)
Gathers surfaces connected across shared edges, forming a surface enclosure.
Definition cubit.py:11084
 @n type of seed_surf_ids:  std::vector< int,std::allocator< int > >
Parameters
seed_surf_idsList of starting surface IDs to grow from.

type of all_surf_ids: std::vector< int,std::allocator< int > >
all_surf_idsOptional 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()

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)
get_2D_sheet_volumes(vol_id)
Get associated 2D sheet volumes from a reduced 3D thin volume.
Definition cubit.py:19138
 @n type of vol_id:  int
Parameters
vol_idVolume 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()

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)
get_3D_thin_volume(vol_id)
Get the original 3D thin volume associated with a 2D sheet volume.
Definition cubit.py:19164
 @n type of vol_id:  int
Parameters
vol_idVolume ID representing a 2D sheet volume.

return type of : int
Returns
ID of the associated 3D thin volume.

◆ get_acceleration_combine_type()

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_idID of the acceleration BC.

return type of : string
Returns
Combine method as a string.

◆ get_acis_version()

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)
get_acis_version()
Retrieve the ACIS kernel version string.
Definition cubit.py:4403
 @n return type of :  string
Returns
A string containing the ACIS version number.

◆ get_acis_version_as_int()

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)
get_acis_version_as_int()
Retrieve the ACIS kernel version as an integer.
Definition cubit.py:4428
 @n return type of :  int
Returns
An integer representing the ACIS version.

◆ get_adjacent_surfaces()

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)
get_adjacent_surfaces(geometry_type, entity_id)
Get a list of surfaces adjacent to a specified surface (including the surface itself).
Definition cubit.py:10741
 @n type of geometry_type:  string
Parameters
geometry_typeThe type of the entity ("surface" for this function).

type of entity_id: int
entity_idID 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()

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)
get_adjacent_volumes(geometry_type, entity_id)
Get a list of adjacent volumes to a specified entity.
Definition cubit.py:10767
Parameters
geom_typeSpecifies the geometry type of the entity

type of entity_id: int
entity_idSpecifies 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()

get_all_cfd_bcs ( )

◆ get_all_exodus_times()

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:")
get_all_exodus_times(filename)
Get all available time steps from an Exodus file.
Definition cubit.py:21011

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
filenameFully 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()

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:")
get_all_exodus_variable_names(filename, variable_type)
Get all variable names of a given type from an Exodus file.
Definition cubit.py:21073

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
filenameFully qualified Exodus II file name.

type of variable_type: string
variable_typeVariable 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()

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', ...]
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.
Definition cubit.py:13799
 @n type of mesh_entity_type:  string
Parameters
mesh_entity_typeMesh entity type: quad, face, tri, hex, tet, edge, or node.

type of mesh_entity_list: string
mesh_entity_listSpace-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()

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]"
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.
Definition cubit.py:11526
 @n type of geo_type:  string
Parameters
geo_typeGeometry entity type ("vertex", "curve", "surface", or "volume").

type of name: string
namePrefix 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()

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}")
print("test_var =", val) # prints 3.14
get_aprepro_numeric_value(variable_name)
Get the numeric value of a specified Aprepro variable.
Definition cubit.py:5898
 @n type of variable_name:  string
Parameters
variable_nameName 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()

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'}")
print("mesh_scheme =", val) # prints "pave"
get_aprepro_value_as_string(variable_name)
Get the string value of an Aprepro variable.
Definition cubit.py:5870
 @n type of variable_name:  string
Parameters
variable_nameName of the Aprepro variable to query.

return type of : string
Returns
The string value of the specified Aprepro variable.

◆ get_aprepro_vars()

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')
get_aprepro_vars()
Retrieve the current Aprepro variable names.
Definition cubit.py:5842
 @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()

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
get_arc_center_radius(curve_id)
Get the center point and radius of a specified arc curve.
Definition cubit.py:11963
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_arc_length(curve_id)
Get the parametric (arc) length of a specified curve.
Definition cubit.py:11822
 @n type of curve_id:  int
Parameters
curve_idID of the curve to query.

return type of : float
Returns
The parametric (arc) length of the curve in model units.

◆ get_assembly_children()

get_assembly_children ( assembly_id)

◆ get_assembly_classification_category()

get_assembly_classification_category ( )

Get classification category metadata.



return type of : string

Returns
Classification category as a string.

◆ get_assembly_classification_level()

get_assembly_classification_level ( )

Get classification level metadata.



return type of : string

Returns
Classification level as a string.

◆ get_assembly_description()

get_assembly_description ( assembly_id)

Get the description of an assembly node.



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Description string.

◆ get_assembly_file_format()

get_assembly_file_format ( assembly_id)

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



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
File format string, e.g., "ACIS" or "STEP".

◆ get_assembly_instance()

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_idID of the assembly node.

return type of : int
Returns
Instance number.

◆ get_assembly_items()

get_assembly_items ( )

◆ get_assembly_level()

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_idID of the assembly node.

return type of : int
Returns
Integer hierarchy level.

◆ get_assembly_material_description()

get_assembly_material_description ( assembly_id)

Get the material description for a part.



type of assembly_id: int

Parameters
assembly_idID of the part node.

return type of : string
Returns
Material description string.

◆ get_assembly_material_specification()

get_assembly_material_specification ( assembly_id)

Get the material specification for a part.



type of assembly_id: int

Parameters
assembly_idID of the part node.

return type of : string
Returns
Material specification string.

◆ get_assembly_metadata()

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_idID of the volume.

type of data_type: int
data_typeInteger 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()

get_assembly_name ( assembly_id)

Get the name of an assembly node.



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Name string of the node.

◆ get_assembly_path()

get_assembly_path ( assembly_id)

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



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Full path string, e.g., "/root/subassembly/part".

◆ get_assembly_type()

get_assembly_type ( assembly_id)

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



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Type string.

◆ get_assembly_units()

get_assembly_units ( assembly_id)

Get the units of measurement used in the assembly node.



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Units string, e.g., "mm", "inch".

◆ get_assembly_weapons_category()

get_assembly_weapons_category ( )

Get weapons category metadata.



return type of : string

Returns
Weapons category as a string.

◆ get_auto_size()

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)
get_auto_size(geometry_type, entity_id_list, auto_factor)
Predict the automatic mesh size for a set of entities.
Definition cubit.py:9217
 @n type of geometry_type:  string
Parameters
geometry_typeEntity type: "curve", "surface", or "volume".

type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_listVector of IDs for the specified entities.

type of auto_factor: float
auto_factorThe 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()

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_enumBoundary 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()

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_enumBC type enum (CI_BCTypes).

type of bc_id: int
bc_idID of the boundary condition.

return type of : string
Returns
Name string of the specified BC.

◆ get_bc_temperature()

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_enumBC type (temperature = 4, convection = 7).

type of entity_id: int
entity_idID of the BC.

type of temp_type_enum: int
temp_type_enumCI_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()

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)
get_blend_chain_collections(volume_list, radius_threshold)
Return collections of surfaces that form blend chains in the specified volumes.
Definition cubit.py:15596

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_listList of volume IDs to query.

type of radius_threshold: float
radius_thresholdReturn 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()

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)
get_blend_chains(surface_id)
Returns the blend chains for a given surface.
Definition cubit.py:15552

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_idSurface 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()

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.
print(blends) # expect [7]
get_blend_surfaces(target_volume_ids)
Find blend (fillet) surfaces within specified volumes.
Definition cubit.py:15482
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsVector 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()

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
get_block_attribute_count(block_id)
Get the number of attributes assigned to a block.
Definition cubit.py:19855
 @n type of block_id:  int
Parameters
block_idThe ID of the block to query.

return type of : int
Returns
The number of attributes currently assigned to the block.

◆ get_block_attribute_name()

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'")
print("Attribute name at index 1:", attr_name)
# Expected output: Attribute name at index 1: thickness
get_block_attribute_name(block_id, attribute_index)
Get the name of a specific attribute for a block.
Definition cubit.py:19957
 @n type of block_id:  int
Parameters
block_idID of the block.

type of attribute_index: int
attribute_indexIndex of the attribute (1-based).

return type of : string
Returns
Name of the attribute at the specified index.

◆ get_block_attribute_value()

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")
print("Attribute value at index 2:", attr_value)
# Expected output: Attribute value at index 2: 5.5
get_block_attribute_value(block_id, attribute_index)
Get the value of a specific attribute for a block.
Definition cubit.py:19921
 @n type of block_id:  int
Parameters
block_idID of the block.

type of attribute_index: int
attribute_indexIndex of the attribute (1-based).

return type of : float
Returns
Value of the attribute at the specified index.

◆ get_block_cad_material()

get_block_cad_material ( block_id)

◆ get_block_count()

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
get_block_count()
Get the current number of element blocks in the model.
Definition cubit.py:19202
 @n return type of :  int
Returns
The number of element blocks currently defined in the model.

◆ get_block_curves()

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).")
get_block_curves(block_id)
Get the list of curve IDs contained in a block.
Definition cubit.py:19464

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_edges(block_id)
Get the list of edge IDs contained in a block.
Definition cubit.py:19565

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

  @n type of block_id:  int
Parameters
block_idID 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()

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
get_block_element_attribute_count(block_id)
Get the number of attributes defined for elements in the specified block.
Definition cubit.py:19886
 @n type of block_id:  int
Parameters
block_idThe ID of the block.

return type of : int
Returns
Number of element-level attributes defined in the block.

◆ get_block_element_attribute_names()

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'")
get_block_element_attribute_names(block_id)
Get the list of attribute names associated with block elements.
Definition cubit.py:19997

for name in names: print(name)

# Expected output:
# thickness
# density
 @n type of block_id:  int
Parameters
block_idID 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()

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
get_block_element_type(block_id)
Get the element type associated with a block.
Definition cubit.py:19825
 @n type of block_id:  int
Parameters
block_idID of the block to query.

return type of : string
Returns
A string indicating the element type used in the block.

◆ get_block_faces()

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).")
get_block_faces(block_id)
Get the list of face IDs contained in a block.
Definition cubit.py:19636

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_hexes(block_id)
Get the list of hexahedron (hex) IDs contained in a block.
Definition cubit.py:19794

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

  @n type of block_id:  int
Parameters
block_idID 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()

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
get_block_id(entity_type, entity_id)
Get the element block ID associated with a geometric entity.
Definition cubit.py:19240
 @n type of entity_type:  string
Parameters
entity_typeType of the entity: "curve", "surface", or "volume".

type of entity_id: int
entity_idID of the entity.

return type of : int
Returns
Block ID associated with the entity, or zero (0) if none.

◆ get_block_id_list()

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
# Print the block IDs
print("Active block IDs:")
get_block_id_list()
Get a list of all active block IDs.
Definition cubit.py:19336

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()

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:")
get_block_ids(mesh_geometry_file_name)
Get list of block IDs from a mesh geometry file.
Definition cubit.py:19291

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_nameFully 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()

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)
get_block_material(block_id)
Get the ID of the material assigned to the specified block.
Definition cubit.py:20057
 @n type of block_id:  int
Parameters
block_idID of the block.

return type of : int
Returns
Material ID assigned to the block, or 0 if none.

◆ get_block_name()

get_block_name ( block_id)

Get the block name for a given block id.

. code-block:: c++

   std::string block_name = CubitInterface::get_block_name(1); .. code-block:: c++

   block_name = cubit.get_block_name(1) :type block_id: int
Parameters
block_idId of block in question :rtype: string
Returns
Block name associated with this block or "" if none

◆ get_block_nodes()

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).")
get_block_nodes(block_id)
Get the list of node IDs contained in a block.
Definition cubit.py:19531

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_pyramids(block_id)
Get the list of pyramid IDs contained in a block.
Definition cubit.py:19683

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

  @n type of block_id:  int
Parameters
block_idID 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_string_attributes()

get_block_string_attributes ( block_id)

◆ get_block_surfaces()

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).")
get_block_surfaces(block_id)
Get the list of surface IDs contained in a block.
Definition cubit.py:19432

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_tets(block_id)
Get the list of tetrahedron (tet) IDs contained in a block.
Definition cubit.py:19759

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_tris(block_id)
Get the list of triangle (tri) IDs contained in a block.
Definition cubit.py:19601

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_vertices(block_id)
Get the list of vertex IDs contained in a block.
Definition cubit.py:19496

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_volumes(block_id)
Get the list of volume IDs contained in a block.
Definition cubit.py:19400

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

  @n type of block_id:  int
Parameters
block_idID 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()

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).")
get_block_wedges(block_id)
Get the list of wedge IDs contained in a block.
Definition cubit.py:19723

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

  @n type of block_id:  int
Parameters
block_idID 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()

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")
get_blocks_with_materials()
Get all block IDs and their associated material IDs.
Definition cubit.py:20087

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()

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")
print("Default depth:", depth)
get_blunt_tangency_default_depth(vert_id, angle, add_material)
Computes the default depth used to blunt a tangency at a vertex.
Definition cubit.py:16432
 @n type of vert_id:  int
Parameters
vert_idID of the vertex to modify.

type of angle: float
angleDesired target angle after blunting.

type of add_material: boolean
add_materialIf true, material is added; if false, material is removed.
 @n return type of :  float
Returns
Suggested depth value for the operation.

◆ get_body_count()

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)
get_body_count()
Get the current number of bodies in the model.
Definition cubit.py:10484
 @n return type of :  int
Returns
The number of bodies currently defined in the model.

◆ get_bolt_axis()

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
print("Bolt axis:", axis)
get_bolt_axis(vol_id)
Get the normalized axis vector of a bolt volume.
Definition cubit.py:18863



type of vol_id: int

Parameters
vol_idVolume 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()

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], [])
get_bolt_clamped_members(vol_ids, nearby_vols, progress=None)
Identify clamped members associated with a bolt.
Definition cubit.py:19004

for group in clamped: print(group)

   @n type of vol_ids:  std::vector< int,std::allocator< int > >
Parameters
vol_idsList 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_volsOptional list of nearby volume IDs for each bolt. Leave empty to compute automatically.

type of progress: :py:class:CubitProgressHandler, optional
progressOptional 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()

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]
get_bolt_coordinate_system(geom_type, id)
Get local coordinate system for a bolt or bolt hole.
Definition cubit.py:18970
  @n type of geom_type:  string
Parameters
geom_type"bolt" for bolt volume or "hole" for hole surface.

type of id: int
idVolume 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()

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])
get_bolt_diameters(vol_ids)
Get the shank diameters of specified bolt volumes.
Definition cubit.py:18836



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

Parameters
vol_idsVolume 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()

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)
get_bolt_holes(geo_type, clamped_members, radius_threshold, gap_threshold)
Identify upper and lower pilot hole surfaces from clamped members.
Definition cubit.py:19112
 @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_membersIDs of volumes or blocks with candidate pilot holes.

type of radius_threshold: float
radius_thresholdMaximum radius for a hole to be considered.

type of gap_threshold: float
gap_thresholdMaximum 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()

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)
get_bolt_holes_info(geo_type, clamped_members, radius_threshold, gap_threshold)
Identify concentric pilot holes across clamped members.
Definition cubit.py:19075

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_membersIDs of volumes or blocks potentially containing pilot holes.

type of radius_threshold: float
radius_thresholdMaximum hole radius to be considered a pilot hole.

type of gap_threshold: float
gap_thresholdMaximum 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()

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)
get_bolt_shigley_radius(bolt_id, angle, washer_id=0)
Get the equivalent Shigley frustum radius at the bolt interface.
Definition cubit.py:18902



type of bolt_id: int

Parameters
bolt_idID of the bolt volume entity.

type of washer_id: int, optional
washer_idOptional ID of the washer entity in the bolt-washer mechanism (use 0 if none).

type of angle: float
angleCone 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()

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)
get_bolt_washer(bolt_id)
Get the washer volume ID associated with a given bolt.
Definition cubit.py:18929
  @n type of bolt_id:  int
Parameters
bolt_idThe 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()

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)
get_bolts_in_clamped_members(geo_type, clamped_vols, candidate_bolts)
Identify bolts clamping the given volumes or blocks.
Definition cubit.py:19036
 @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_volsList of volume or block IDs that are clamped by one or more bolts.

type of candidate_bolts: std::vector< int,std::allocator< int > >
candidate_boltsVolumes 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()

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
variableName of the sculpt parameter substring.

return type of : boolean
Returns
Default boolean value for the specified parameter.

◆ get_boundary_layer_algorithm()

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_idID of the boundary layer.

return type of : string
Returns
Algorithm name as a string.

◆ get_boundary_layer_continuity()

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_idID of the boundary layer.

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

◆ get_boundary_layer_id_list()

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()

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_typeType of base entity (e.g., "surface", "volume").

type of base_id: int
base_idID 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()

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_typeType of base entity (e.g., "surface", "volume").

type of base_id: int
base_idID of the base entity.

type of parent_id: int
parent_idID 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()

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
get_bounding_box(geometry_type, entity_id)
Get the axis-aligned bounding box for a specified entity.
Definition cubit.py:12666
 @n type of geometry_type:  string
Parameters
geometry_typeSpecifies the geometry type ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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)
get_build_number()
Retrieve the Cubit build number.
Definition cubit.py:4379
 @n return type of :  string
Returns
A string containing the current Cubit build number.

◆ get_cavity_surfaces()

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)
get_cavity_surfaces(surface_id)
Return the surfaces in the cavity adjacent to the specified surface.
Definition cubit.py:15851
 @n type of surface_id:  int
Parameters
surface_idSurface 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()

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)
get_center_point(entity_type, entity_id)
Get the 3D center or coordinates of a specified entity.
Definition cubit.py:12836
 @n type of entity_type:  string
Parameters
entity_typeEntity type: "body", "volume", "surface", "curve", "vertex", "node", "edge", "face", "tri", "quad", "hex", "tet", "wedge", "pyramid", or "sphere".

type of entity_id: int
entity_idID 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()

get_cfd_type ( entity_id)

Get the CFD boundary condition subtype.



type of entity_id: int

Parameters
entity_idID of the CFD boundary condition.

return type of : int
Returns
CFD type as defined in CI_BCTypes.

◆ get_chamfer_chain_collections()

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)
get_chamfer_chain_collections(volume_list, thickness_threshold)
Return collections of surfaces that form chamfer chains in the specified volumes.
Definition cubit.py:15396

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_listList of volume IDs to query.

type of thickness_threshold: float
thickness_thresholdReturn 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()

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)
get_chamfer_chains(surface_id)
Returns the chamfer chains for a given surface.
Definition cubit.py:15352

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_idSurface 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()

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_idsList of volume ids to examine.

type of thickness_threshold: float
thickness_thresholdmax 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()

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
get_close_loop_thickness(surface_id)
Compute the minimum separation distance between loops on a surface.
Definition cubit.py:15237
 @n type of surface_id:  int
Parameters
surface_idID 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()

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]
get_close_loops(target_volume_ids, mesh_size)
Find faces with multiple loops closer than a given threshold.
Definition cubit.py:15165
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeDistance 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()

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)
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.
Definition cubit.py:15206

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_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeDistance threshold for loop separation.

type of genus: int
genusNumber 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()

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.
# Expected output: (15, 5, 12, 1, 5, 19, 2, 15)
get_close_vertex_curve_pairs(target_volume_ids, high_tolerance)
Find pairs of vertices and curves within a specified tolerance across given volumes.
Definition cubit.py:16520

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_idsVector of volume IDs to examine.

type of high_tolerance: float
high_toleranceDistance 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()

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
get_closed_narrow_surfaces(target_ids, narrow_size)
Find faces on closed surfaces whose two boundary edges remain within a distance threshold.
Definition cubit.py:15018
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_idsVector of volume IDs whose faces are checked.

type of narrow_size: float
narrow_sizeDistance 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()

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)
get_closest_node(x_coordinate, y_coordinate, z_coordinate)
Find the mesh node closest to a given point.
Definition cubit.py:14545
 @n type of x_coordinate:  float
Parameters
x_coordinateX coordinate of the query point.

type of y_coordinate: float
y_coordinateY coordinate of the query point.

type of z_coordinate: float
z_coordinateZ 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()

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)
get_coincident_vertices(target_volume_ids, high_tolerance)
Find vertex pairs within a specified tolerance across given volumes.
Definition cubit.py:16485

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_idsVector of volume IDs to examine.

type of high_tolerance: float
high_toleranceDistance 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()

get_command_from_history ( command_number)

Retrieve a specific command from Cubit's history buffer.

.. code-block:: python
import cubit
get_command_history_count()
Get the number of commands in Cubit's history buffer.
Definition cubit.py:4982

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

  @n type of command_number:  int
Parameters
command_numberZero-based index into the history buffer.

return type of : string
Returns
The command string at the given index.

◆ get_command_history_count()

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()

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)
get_common_curve_id(surface_1_id, surface_2_id)
Return a curve shared by two surfaces.
Definition cubit.py:10970
 @n type of surface_1_id:  int
Parameters
surface_1_idID of the first surface.

type of surface_2_id: int
surface_2_idID of the second surface.

return type of : int
Returns
ID of the shared curve, or -1 if none exists.

◆ get_common_vertex_id()

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_idID of the first curve.

type of curve_2_id: int
curve_2_idID of the second curve.

return type of : int
Returns
ID of the shared vertex, or 0 if none exists.

◆ get_cone_surfaces()

get_cone_surfaces ( target_volume_ids)

Identify full conical surfaces in given volumes.

Detects conical surfaces within the specified volumes that are represented by a single, unsplit surface. Cones that are split into mirrored surface pairs are intentionally not identified by this function. Use get_surface_cone_collections() if detection of both full and split (mirrored) cones is required.

.. code-block:: python
# Create a blind hole with a single conical end
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 3 mov z 3')
cubit.cmd('unite vol 2 3')
cubit.cmd('vol 2 mov z -3')
cubit.cmd('subtract vol 2 from vol 1')
cone_surfaces = cubit.get_cone_surfaces([1])
print("Cone surfaces:", [int(sid) for sid in cone_surfaces])
# Expected output:
# Cone surfaces: [12]
get_cone_surfaces(target_volume_ids)
Identify full conical surfaces in given volumes.
Definition cubit.py:15727



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

Parameters
target_volume_idsList of volume IDs to analyze.

return type of : std::vector< int,std:: allocator< int > >
Returns
List of surface IDs corresponding to full, unsplit cone surfaces.

◆ get_connected_surfaces()

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)
get_connected_surfaces(surf_ids)
Find surfaces connected to a given set of surfaces.
Definition cubit.py:11036
Parameters
surface_idsIDs 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()

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)
get_connectivity(entity_type, entity_id)
Get the list of node IDs comprising a mesh element.
Definition cubit.py:13838
 @n type of entity_type:  string
Parameters
entity_typeMesh element type (e.g., "hex", "tet", "tri", "quad").

type of entity_id: int
entity_idID 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()

get_constraint_dependent_entity_point ( constraint_id)

Get the dependent entity of a specified constraint.



type of constraint_id: int

Parameters
constraint_idID of the constraint.

return type of : string
Returns
Dependent entity as a string.

◆ get_constraint_reference_point()

get_constraint_reference_point ( constraint_id)

Get the reference point of a specified constraint.



type of constraint_id: int

Parameters
constraint_idID of the constraint.

return type of : string
Returns
Reference point as a string.

◆ get_constraint_type()

get_constraint_type ( constraint_id)

Get the type of a specified constraint.



type of constraint_id: int

Parameters
constraint_idID of the constraint.

return type of : string
Returns
: Constraint type "Kinematic", "Distributing", or "Rigidbody".

◆ get_contact_pair_exterior_state()

get_contact_pair_exterior_state ( entity_id)

Get the exterior state of a contact pair.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : boolean
Returns
True if contact is considered exterior.

◆ get_contact_pair_friction_value()

get_contact_pair_friction_value ( entity_id)

Get the friction value for a contact pair.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : float
Returns
Friction value.

◆ get_contact_pair_general_state()

get_contact_pair_general_state ( entity_id)

Get the general contact state.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : boolean
Returns
True if general contact is active.

◆ get_contact_pair_tied_state()

get_contact_pair_tied_state ( entity_id)

Get the tied state of a contact pair.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : boolean
Returns
True if tied state is active.

◆ get_contact_pair_tol_lower_value()

get_contact_pair_tol_lower_value ( entity_id)

Get the lower bound tolerance for a contact pair.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : float
Returns
Lower tolerance value.

◆ get_contact_pair_tolerance_value()

get_contact_pair_tolerance_value ( entity_id)

Get the upper bound tolerance for a contact pair.



type of entity_id: int

Parameters
entity_idID of the contact pair.

return type of : float
Returns
Upper tolerance value.

◆ get_continuous_curve_collections()

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)
get_continuous_curve_collections(volume_list, angle_tolerance=-1)
Returns collections of continuous curves in the given volumes.
Definition cubit.py:16308

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_listList of volume IDs to query.

type of angle_tolerance: float, optional
angle_toleranceTangent 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()

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)
get_continuous_curves(curve_id, angle_tol, require_two_valent=False)
Return the list of adjacent continuous curves.
Definition cubit.py:16276
 @n type of curve_id:  int
Parameters
curve_idCurve ID to query.

type of angle_tol: float
angle_tolAngle tolerance for continuity (degrees).

type of require_two_valent: boolean, optional
require_two_valentIf 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_surface_collections()

get_continuous_surface_collections ( volume_list,
angle_tolerance = -1 )

Returns collections of continuous surfaces in the given volumes.

Continuous surfaces are defined as surfaces connected at 2-valent curves, where the surface normals at the common curve 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_surface_collections(volume_ids, angle_tol_deg)
get_continuous_surface_collections(volume_list, angle_tolerance=-1)
Returns collections of continuous surfaces in the given volumes.
Definition cubit.py:16340

for surface_ids, total_area in collections: print("Surface IDs:", surface_ids, "Area:", total_area)

@n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_listList of volume IDs to query.

type of angle_tolerance: float, optional
angle_toleranceNormal angle tolerance in degrees. Continuous surfaces must have normals 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 surface IDs forming a continuous patch, (2) total area of the surfaces. The list is ordered from smallest to largest total area.

◆ get_continuous_surfaces()

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)
get_continuous_surfaces(surface_id, angle_tol)
Return the list of adjacent continuous surfaces.
Definition cubit.py:16235
 @n type of surface_id:  int
Parameters
surface_idSurface ID to query.

type of angle_tol: float
angle_tolAngle 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()

get_convection_coefficient ( entity_id,
bc_type_enum )

Get convection coefficient from a convection BC.



type of entity_id: int

Parameters
entity_idID of the convection BC.

type of bc_type_enum: int
bc_type_enumCI_BCEntityTypes: 1 (normal), 5 (shell top), 6 (shell bottom).

return type of : float
Returns
Convection coefficient value.

◆ get_coordinate_systems_id_list()

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)
get_coordinate_systems_id_list()
Returns a list of coordinate system IDs.
Definition cubit.py:13109
 @n return type of : std::vector< int,std:: allocator< int > >
Returns
List of coordinate system IDs.

◆ get_copy_block_on_geometry_copy_setting()

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)
set_copy_block_on_geometry_copy_setting(val)
Set the behavior for block propagation during geometry copy.
Definition cubit.py:21369
get_copy_block_on_geometry_copy_setting()
Get the current block behavior setting for geometry copy.
Definition cubit.py:21258
 @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()

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)
get_copy_nodeset_on_geometry_copy_setting()
Get the current nodeset behavior setting for geometry copy.
Definition cubit.py:21144
set_copy_nodeset_on_geometry_copy_setting(val)
Set the behavior for nodeset propagation during geometry copy.
Definition cubit.py:21295
 @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()

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)
get_copy_sideset_on_geometry_copy_setting()
Get the current sideset behavior setting for geometry copy.
Definition cubit.py:21201
set_copy_sideset_on_geometry_copy_setting(val)
Set the behavior for sideset propagation during geometry copy.
Definition cubit.py:21332
 @n return type of :  string
Returns
Current copy sideset on geometry copy setting ("on", "OFF", or "use_original").

◆ get_cubit_digits_setting()

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
get_cubit_digits_setting()
Retrieve the current Cubit "digits" setting.
Definition cubit.py:5598
 @n return type of :  float
Returns
The number of decimal digits Cubit will print, or -1 if no setting exists.

◆ get_cubit_message_handler()

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")
get_cubit_message_handler()
Retrieve the current Cubit message handler.
Definition cubit.py:3902
 @n return type of : :py:class: `CubitMessageHandler`
Returns
Shared pointer to the active CubitMessageHandler.

◆ get_current_ids()

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_typeGeometry 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()

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())
get_current_journal_file()
Get the filename of the current journal file.
Definition cubit.py:5145
 @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()

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
get_curve_bias_coarse_size(curve_id)
Get the "coarse size" parameter for a biased curve, if set.
Definition cubit.py:7349
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_bias_fine_size(curve_id)
Get the "fine size" parameter for a biased curve, if set.
Definition cubit.py:7314
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_bias_first_interval_fraction(curve_id)
Retrieve the fraction of curve length used as the first interval size.
Definition cubit.py:7280
 @n type of curve_id:  int
Parameters
curve_idID 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()

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.

 @n type of curve_id:  int
Parameters
curve_idID 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_interval_length(curve_id)
Query the length of the first interval on a biased curve.
Definition cubit.py:7246

◆ get_curve_bias_first_last_ratio1()

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)
get_curve_bias_first_last_ratio1(curve_id)
Retrieve the ratio of first-to-last interval at the start of a biased curve.
Definition cubit.py:7383
 @n type of curve_id:  int
Parameters
curve_idID 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()

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)
get_curve_bias_first_last_ratio2(curve_id)
Retrieve the ratio of first-to-last interval at the end of a biased curve.
Definition cubit.py:7417
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_bias_from_start(curve_id, value)
Determine if the bias is measured from the curve's start vertex.
Definition cubit.py:7528
 @n type of curve_id:  int
Parameters
curve_idID of the curve to query.

type of value: boolean, out
valueSet 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()

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
get_curve_bias_from_start_set(curve_id)
Check if the "bias from start" flag has been explicitly set on a curve.
Definition cubit.py:7567
 @n type of curve_id:  int
Parameters
curve_idID 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()

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.

 @n type of curve_id:  int
Parameters
curve_idID 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_factor(curve_id)
Get the primary geometric progression factor used for biasing a curve.
Definition cubit.py:7182

◆ get_curve_bias_geometric_factor2()

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).

 @n type of curve_id:  int
Parameters
curve_idID 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_geometric_factor2(curve_id)
Get the secondary geometric progression factor for a dual-bias curve.
Definition cubit.py:7214

◆ get_curve_bias_last_first_ratio1()

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)
get_curve_bias_last_first_ratio1(curve_id)
Retrieve the ratio of last-to-first interval at the start of a biased curve.
Definition cubit.py:7451
 @n type of curve_id:  int
Parameters
curve_idID 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()

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)
get_curve_bias_last_first_ratio2(curve_id)
Retrieve the ratio of last-to-first interval at the end of a biased curve.
Definition cubit.py:7485
 @n type of curve_id:  int
Parameters
curve_idID 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()

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.
get_curve_bias_start_vertex_id(curve_id)
Retrieve the vertex ID designated as the start of bias on a curve.
Definition cubit.py:7603

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

  @n type of curve_id:  int
Parameters
curve_idID 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()

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".

 @n type of curve_id:  int
Parameters
curve_idID 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.
print("Curve 1 bias type:", bias_type) # Should print "Bias"
get_curve_bias_type(curve_id)
Retrieve the bias scheme type applied to a curve.
Definition cubit.py:7150

◆ get_curve_center()

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)
get_curve_center(curve_id)
Retrieve the center point of a specified curve.
Definition cubit.py:11926
 @n type of curve_id:  int
Parameters
curve_idID 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()

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)
get_curve_count()
Get the current number of curves in the model.
Definition cubit.py:10553
 @n return type of :  int
Returns
The number of curves currently defined in the model.

◆ get_curve_count_in_volumes()

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)
get_curve_count_in_volumes(target_volume_ids)
Get the current number of curves in the specified volumes.
Definition cubit.py:10605
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsList of volume IDs to query.

return type of : int
Returns
The total number of curves contained in the specified volumes.

◆ get_curve_edges()

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).")
get_curve_edges(curve_id)
Get the list of edge element IDs on a curve.
Definition cubit.py:13242

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

  @n type of curve_id:  int
Parameters
curve_idID 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()

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.
print("Curve 1 length:", length) # prints approximately 6.28319
get_curve_length(curve_id)
Get the 3D length of a specified curve.
Definition cubit.py:11792
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_mesh_scheme_curvature(curve_id)
Retrieve the curvature mesh scheme adaptation value for a curve.
Definition cubit.py:7641
 @n type of curve_id:  int
Parameters
curve_idID 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()

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]
get_curve_mesh_scheme_pinpoint_locations(curve_id)
Retrieve the pinpoint mesh scheme locations for a curve.
Definition cubit.py:7677
 @n type of curve_id:  int
Parameters
curve_idID 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()

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).")
get_curve_nodes(curve_id)
Get the list of node IDs owned by a curve.
Definition cubit.py:13210

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

  @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_radius(curve_id)
Compute the radius of a specified curve.
Definition cubit.py:11894
 @n type of curve_id:  int
Parameters
curve_idID 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()

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
get_curve_type(curve_id)
Get the curve type for a specified curve.
Definition cubit.py:11763
 @n type of curve_id:  int
Parameters
curve_idID of the curve to query.

return type of : string
Returns
Descriptive string of the curve's geometry type.

◆ get_dbl_sculpt_default()

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
variableSubstring 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()

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)
get_default_auto_size()
Compute Cubit's heuristic default automatic mesh size for the current model.
Definition cubit.py:9121
 @n return type of :  float
Returns
Target edge length computed by Cubit's auto-sizing algorithm.

◆ get_default_element_type()

get_default_element_type ( )

Retrieve the current default element type for meshing.

.. code-block:: python
print("Default element type:", default_type)
get_default_element_type()
Retrieve the current default element type for meshing.
Definition cubit.py:7002
 @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()

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
get_default_geometry_engine()
Get the name of the default modeler engine.
Definition cubit.py:4573
 @n return type of :  string
Returns
: The name of the default modeler engine ACIS, CATIA, OCC, or facet.

◆ get_displacement_combine_type()

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_idID of the displacement BC.

return type of : string
Returns
Combine method as a string.

◆ get_distance_between()

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
get_distance_between(vertex_id_1, vertex_id_2)
Get the Euclidean distance between two vertices.
Definition cubit.py:11726
 @n type of vertex_id_1:  int
Parameters
vertex_id_1ID of the first vertex.

type of vertex_id_2: int
vertex_id_2ID of the second vertex.

return type of : float
Returns
The straight-line distance between the two vertices.

◆ get_distance_between_entities()

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
get_distance_between_entities(geom_type_1, entity_id_1, geom_type_2, entity_id_2)
Get the minimum distance between two geometry entities.
Definition cubit.py:12935
 @n type of geom_type_1:  string
Parameters
geom_type_1Type of the first entity ("vertex", "curve", "surface", or "volume").

type of entity_id_1: int
entity_id_1ID of the first entity.

type of geom_type_2: string
geom_type_2Type of the second entity ("vertex", "curve", "surface", or "volume").

type of entity_id_2: int
entity_id_2ID of the second entity.

return type of : float
Returns
The minimum straight-line distance between the two specified entities.

◆ get_distance_from_curve_start()

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
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.
Definition cubit.py:11857
 @n type of x_coordinate:  float
Parameters
x_coordinateX coordinate of the query point.

type of y_coordinate: float
y_coordinateY coordinate of the query point.

type of z_coordinate: float
z_coordinateZ coordinate of the query point.

type of curve_id: int
curve_idID 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()

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)
get_edge_count()
Retrieve the count of edges between surface elements in the current model.
Definition cubit.py:9581
 @n return type of :  int
Returns
Number of edges between surface elements in the current model's mesh.

◆ get_edge_global_element_id()

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
get_edge_global_element_id(edge_id)
Get the Global Element ID for a specific edge element.
Definition cubit.py:14436
 @n type of edge_id:  int
Parameters
edge_idLocal 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()

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
print(f"Curve 12 has {len(edge_ids)} candidate edge(s) to swap.")
get_edges_to_swap(curve_id)
Get edges on triangles at a knife-edge curve that are candidates for swapping.
Definition cubit.py:10319

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_idID 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()

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
"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]]
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.
Definition cubit.py:9936
 @n type of entity_type:  string
Parameters
entity_typeGeometry type ("edge", "tri", "quad", "tet", "hex").

type of id_list: std::vector< int,std::allocator< int > >
id_listList of element IDs to evaluate.

type of metric_name: string
metric_nameQuality metric name (e.g., "scaled jacobian").

type of single_threshold: float
single_thresholdThreshold when using a single bound.

type of use_low_threshold: boolean
use_low_thresholdIf true, apply [low_threshold, high_threshold]; otherwise use single_threshold.

type of low_threshold: float
low_thresholdLower bound for quality range.

type of high_threshold: float
high_thresholdUpper bound for quality range.

type of make_group: boolean
make_groupIf 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()

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)
print(f"Element 1001 is in block {block2}") # prints 2
get_element_block(element_id)
Get the block ID containing a given global element.
Definition cubit.py:14151
 @n type of element_id:  int
Parameters
element_idGlobal Element ID to query.

return type of : int
Returns
ID of the block containing the element, or 0 if none.

◆ get_element_budget()

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)
get_element_budget(element_type, entity_id_list, auto_factor)
Estimate the total element count for a set of volumes given size settings.
Definition cubit.py:9275
 @n type of element_type:  string
Parameters
element_typeElement 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_listVector of volume IDs over which to compute the total model volume.

type of auto_factor: int
auto_factorThe "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()

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)
get_element_count()
Retrieve the count of exportable elements in the current model.
Definition cubit.py:9688
 @n return type of :  int
Returns
Number of exportable elements in the current model's mesh.

◆ get_element_exists()

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
get_element_exists(element_id)
Check whether a global mesh element ID exists in the model.
Definition cubit.py:14037
 @n type of element_id:  int
Parameters
element_idGlobal 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()

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)
get_element_type(element_id)
Get the specific mesh element type for a global element ID.
Definition cubit.py:14071

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

  @n type of element_id:  int
Parameters
element_idGlobal 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()

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
get_element_type_id(element_id)
Map a Global Element ID back to its local mesh entity ID.
Definition cubit.py:14110
 @n type of element_id:  int
Parameters
element_idGlobal 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()

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_typeType 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()

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]}")
get_entity_color(entity_type, entity_id)
Get the color of a specified entity.
Definition cubit.py:11557
 @n type of entity_type:  string
Parameters
entity_typeType of the entity ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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
get_entity_color_index(entity_type, entity_id)
Get the color index of a specified entity.
Definition cubit.py:11606
 @n type of entity_type:  string
Parameters
entity_typeType of the entity ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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')
get_entity_modeler_engine(geometry_type, entity_id)
Get the modeler engine type for a specified entity.
Definition cubit.py:11357
Parameters
geom_typeSpecifies the geometry type ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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"
get_entity_name(entity_type, entity_id, no_default=False)
Get the name of a specified entity.
Definition cubit.py:11390
 @n type of entity_type:  string
Parameters
entity_typeType of the entity ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID of the entity.

type of no_default: boolean, optional
no_defaultIf 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()

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"
get_entity_names(entity_type, entity_id, no_default=False, first_name_only=False)
Get all names associated with a specified entity.
Definition cubit.py:11432
 @n type of entity_type:  string
Parameters
entity_typeType of the entity ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID of the entity.

type of no_default: boolean, optional
no_defaultIf true, excludes default names from the returned list.

type of first_name_only: boolean, optional
first_name_onlyIf 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()

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}")
get_entity_sense(source_type, source_id, sideset_id)
Get the sense of an entity in a sideset.
Definition cubit.py:13659
 @n type of source_type:  string
Parameters
source_typeItem type: "face", "quad", or "tri".

type of source_id: int
source_idID of the entity.

type of sideset_id: int
sideset_idID of the sideset.

return type of : string
Returns
Sense of the specified entity in the sideset.

◆ get_error_count()

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...
print("Number of errors:", errors)
# Reset errors
cubit.cmd("reset error")
print("Number of errors after reset:", cubit.get_error_count())
get_error_count()
Retrieve the total number of errors in the current Cubit session.
Definition cubit.py:5570
 @n return type of :  int
Returns
Integer count of errors recorded in this Cubit session.

◆ get_exodus_element_count()

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")
get_exodus_element_count(entity_id, entity_type)
Get the number of elements in a Exodus entity.
Definition cubit.py:20855
 @n type of entity_id:  int
Parameters
entity_idThe id of the entity

type of entity_type: string
entity_typeThe type of the entity

return type of : int
Returns
Number of Elements

◆ get_exodus_entity_description()

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
get_exodus_entity_description(entity_type, entity_id)
Get the description of an Exodus entity.
Definition cubit.py:20970
 @n type of entity_type:  string
Parameters
entity_typeType of the entity: "block", "sideset", or "nodeset".

type of entity_id: int
entity_idID of the entity.

return type of : string
Returns
Description of the entity, or an empty string if none is assigned.

◆ get_exodus_entity_name()

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
get_exodus_entity_name(entity_type, entity_id)
Get the name of an Exodus entity.
Definition cubit.py:20893
 @n type of entity_type:  string
Parameters
entity_typeType of the entity: "block", "sideset", or "nodeset".

type of entity_id: int
entity_idID of the entity.

return type of : string
Returns
Name of the entity, or an empty string if none is assigned.

◆ get_exodus_entity_type()

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
get_exodus_entity_type(entity_type, entity_id)
Get the Exodus type of an entity.
Definition cubit.py:20931
 @n type of entity_type:  string
Parameters
entity_typeType of the entity: "block", "sideset", or "nodeset".

type of entity_id: int
entity_idID 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()

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)
get_exodus_id(entity_type, entity_id)
Get the Global Element ID for a mesh entity.
Definition cubit.py:13998
 @n type of entity_type:  string
Parameters
entity_typeMesh element type ("hex", "tet", "quad", "tri", "face", etc.).

type of entity_id: int
entity_idLocal 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()

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)
get_exodus_sizing_function_file_name()
Retrieve the Exodus sizing function file name.
Definition cubit.py:9329
 @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()

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)
get_exodus_sizing_function_variable_name()
Retrieve the Exodus-based sizing function variable name.
Definition cubit.py:9302
 @n return type of :  string
Returns
The name of the Exodus variable used for sizing.

◆ get_exodus_variable_count()

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_idThe block id

return type of : int
Returns
Number of Exodus variables

◆ get_exodus_variable_names()

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_idThe block id

return type of : std::vector< std::string,std::allocator< std:: string > >
Returns
Names of Exodus variables

◆ get_exodus_version()

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)
get_exodus_version()
Retrieve the Exodus mesh library version.
Definition cubit.py:4476
 @n return type of :  string
Returns
A string containing the Exodus library version.

◆ get_expanded_connectivity()

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)
get_expanded_connectivity(entity_type, entity_id)
Get the list of node IDs for a mesh element, including interior nodes.
Definition cubit.py:13876
 @n type of entity_type:  string
Parameters
entity_typeMesh element type (e.g., "hex", "tet", "tri", "quad", "hex20").

type of entity_id: int
entity_idID 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()

get_force_direction_vector ( entity_id)

Get the direction vector of a force BC.



type of entity_id: int

Parameters
entity_idID of the force BC.

return type of : std:: array< double,3 >
Returns
Direction vector as [x, y, z].

◆ get_force_magnitude()

get_force_magnitude ( entity_id)

Get the force magnitude of a force BC.



type of entity_id: int

Parameters
entity_idID of the force BC.

return type of : float
Returns
Force magnitude.

◆ get_force_moment_vector()

get_force_moment_vector ( entity_id)

Get the moment vector of a force BC.



type of entity_id: int

Parameters
entity_idID of the force BC.

return type of : std:: array< double,3 >
Returns
Moment vector as [x, y, z].

◆ get_gaps_between_volumes()

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:")
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.
Definition cubit.py:16673

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_idsList of volume IDs to examine.

type of maximum_gap_tolerance: float
maximum_gap_toleranceMaximum distance between surfaces to be considered a gap.

type of maximum_gap_angle: float
maximum_gap_angleMaximum angle between surfaces to be considered a gap.

type of cache_overlaps: int, optional
cache_overlapsCaching 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()

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', ...]
get_geometric_owner(mesh_entity_type, mesh_entity_list)
Get geometric owners for a set of mesh entities.
Definition cubit.py:13729
 @n type of mesh_entity_type:  string
Parameters
mesh_entity_typeMesh entity type: "quad", "face", "tri", "hex", "tet", "edge", or "node".

type of mesh_entity_list: string
mesh_entity_listSpace-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()

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).")
get_geometry_node_count(entity_type, entity_id)
Get the number of mesh nodes on a geometric entity.
Definition cubit.py:13146
 @n type of entity_type:  string
Parameters
entity_typeType of the geometric entity ("surface", "curve", "volume", etc.).

type of entity_id: int
entity_idID of the geometric entity.

return type of : int
Returns
Number of mesh nodes on the entity.

◆ get_geometry_owner()

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}")
get_geometry_owner(entity_type, entity_id)
Get the geometric owner of a mesh element.
Definition cubit.py:13762
 @n type of entity_type:  string
Parameters
entity_typeMesh element type (e.g., "hex", "tet", "tri", "quad", etc.).

type of entity_id: int
entity_idID of the mesh element.

return type of : string
Returns
Geometric owner of the element (e.g., "surface 3").

◆ get_geometry_type()

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']
get_geometry_type(geom_type, ent_ids)
Return the analytic geometry type for a list of surfaces or curves.
Definition cubit.py:12896
 @n type of geom_type:  string
Parameters
geom_typeSpecifies the entity type: "curve" or "surface".

type of ent_ids: std::vector< int,std::allocator< int > >
ent_idsList 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()

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
print("Global Element ID of hex 22:", gid)
get_global_element_id(element_type, id)
Alias for get_exodus_id: get the Global Element ID for a local mesh entity.
Definition cubit.py:14185
 @n type of element_type:  string
Parameters
element_typeType of the mesh entity ("hex", "tet", "wedge", "pyramid", "tri", "quad", "face", "edge", or "sphere").

type of id: int
idLocal mesh entity ID within its type.

return type of : int
Returns
Global Element ID corresponding to the specified local entity.

◆ get_graphics_version()

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
print("VTK version:", vtk_version)
get_graphics_version()
Retrieve the VTK (Visualization Toolkit) version used by Cubit.
Definition cubit.py:4524
 @n return type of :  string
Returns
A string containing the VTK version number.

◆ get_group_bodies()

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)"
get_group_bodies(group_id)
Return direct child body IDs for a specified group, if any.
Definition cubit.py:21472
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_curves(group_id)
Return direct child curve IDs for a specified group, if any.
Definition cubit.py:21533
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_edges(group_id)
Return direct child edge IDs for a specified group, if any.
Definition cubit.py:21627
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_groups(group_id)
Retrieve direct child group IDs for a specified parent group, if any.
Definition cubit.py:21408
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_hexes(group_id)
Return direct child hexahedral element IDs for a specified group, if any.
Definition cubit.py:21875
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_nodes(group_id)
Return direct child node IDs for a specified group, if any.
Definition cubit.py:21595
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_pyramids(group_id)
Return direct child pyramid element IDs for a specified group, if any.
Definition cubit.py:21795
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_quads(group_id)
Return direct child quad IDs for a specified group, if any.
Definition cubit.py:21659
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_spheres(group_id)
Return direct child sphere element IDs for a specified group, if any.
Definition cubit.py:21840
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_surfaces(group_id)
Return direct child surface IDs for a specified group, if any.
Definition cubit.py:21503
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_tets(group_id)
Return direct child tetrahedron IDs for a specified group, if any.
Definition cubit.py:21724
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_tris(group_id)
Return direct child triangle IDs for a specified group, if any.
Definition cubit.py:21691
 @n type of group_id:  int
Parameters
group_idID 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()

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_idID 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()

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)"
get_group_volumes(group_id)
Return direct child volume IDs for a specified group, if any.
Definition cubit.py:21440
 @n type of group_id:  int
Parameters
group_idID 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()

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)"
get_group_wedges(group_id)
Return direct child wedge element IDs for a specified group, if any.
Definition cubit.py:21758
 @n type of group_id:  int
Parameters
group_idID 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()

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_enumCI_BCEntityTypes: 4 (solid), 7 (shell top), 8 (shell bottom).

type of entity_id: int
entity_idID of the heatflux BC.

return type of : float
Returns
Heatflux value.

◆ get_hex_column()

get_hex_column ( quad_id)

Get the list of hex elements forming a hex column through the given quad/face.

Note that quad elements normally only exist on surfaces, so the starting face and the column start will exist on a surface. Free mesh must be skinned to have a starting quad. :rtype: std::vector< int,std::allocator< int > >

Returns
A list (python tuple) of hex ids in the hex column

◆ get_hex_count()

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)
get_hex_count()
Retrieve the count of hexahedral elements in the current model.
Definition cubit.py:9450
 @n return type of :  int
Returns
Number of hexahedral elements in the current model's mesh.

◆ get_hex_global_element_id()

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)
get_hex_global_element_id(hex_id)
Get the Global Element ID for a specific hexahedral element.
Definition cubit.py:14217
 @n type of hex_id:  int
Parameters
hex_idLocal hexahedral element ID.

return type of : int
Returns
Global Element ID for the specified hex.

◆ get_hex_sheet()

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)
get_hex_sheet(node_id_1, node_id_2)
Retrieve the IDs of all hexahedral elements forming a hex sheet through two nodes.
Definition cubit.py:9802
 @n type of node_id_1:  int
Parameters
node_id_1First node ID defining the edge perpendicular to the hex layer.

type of node_id_2: int
node_id_2Second 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()

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)
get_hole_surfaces(surface_id)
Return the surfaces in the hole adjacent to the specified surface.
Definition cubit.py:16117
 @n type of surface_id:  int
Parameters
surface_idSurface 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()

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
get_hydraulic_radius_surface_area(surface_id)
Compute the hydraulic radius of a specified surface.
Definition cubit.py:12325
 @n type of surface_id:  int
Parameters
surface_idID 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()

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
get_hydraulic_radius_volume_area(volume_id)
Compute the hydraulic radius of a specified volume.
Definition cubit.py:12592
 @n type of volume_id:  int
Parameters
volume_idID 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()

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
nameName of the entity whose ID is requested.

return type of : int
Returns
Integer ID of the named entity.

◆ get_id_string()

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"
get_id_string(entity_ids, sort=True)
Convert a list of integers into a compact Cubit-style ID range string.
Definition cubit.py:5506
 @n type of entity_ids:  std::vector< int,std::allocator< int > >
Parameters
entity_idsVector of integer IDs to format.

type of sort: boolean, optional
sortIf 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()

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}")
get_idless_signature(entity_type, entity_id)
Get the idless signature of a geometric or mesh entity.
Definition cubit.py:5743
 @n type of entity_type:  string
Parameters
entity_typeType of the entity (e.g. "curve", "surface", "vertex", "volume", "face", etc.).

type of entity_id: int
entity_idID 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()

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}")
get_idless_signatures(entity_type, entity_id_list)
Get the idless signatures of a range of geometric or mesh entities.
Definition cubit.py:5790



type of entity_type: string

Parameters
entity_typeType of the entities (e.g. "curve", "surface", "vertex", "volume", "face", etc.).

type of entity_id_list: std::vector< int,std::allocator< int > >
entity_id_listList 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()

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
variableName of the sculpt parameter substring.

return type of : int
Returns
Default integer value for the specified parameter.

◆ get_interface()

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")
get_interface(interface_name)
Retrieve a Cubit interface by name.
Definition cubit.py:4252

if iface is not None:

use iface ...

cubit.release_interface(iface)

  @n type of interface_name:  string
Parameters
interface_nameName of the interface to retrieve.

return type of : CubitBaseInterface
Returns
Pointer to the CubitBaseInterface, or nullptr if not found.

◆ get_label_type()

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)
get_label_type(entity_type)
Gets the current label display type for a given entity type.
Definition cubit.py:6374
 @n type of entity_type:  string
Parameters
entity_typeEntity type to query.

return type of : int
Returns
Label display type (see list above).

◆ get_last_id()

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}")
get_last_id(entity_type)
Get the ID of the last created entity of the given type.
Definition cubit.py:5665
 @n type of entity_type:  string
Parameters
entity_typeType 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()

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,)
get_list_of_free_ref_entities(geometry_type)
Get all free (unattached) entities of a given geometry type.
Definition cubit.py:10852
 @n type of geometry_type:  string
Parameters
geometry_typeSpecifies 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()

get_material_name ( material_id)

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



type of material_id: int

Parameters
material_idID of the material or media.

return type of : string
Returns
Material or media name.

◆ get_material_name_list()

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()

get_material_property ( material_property_enum,
entity_id )

Get the value of a material property.



type of material_property_enum: int

Parameters
material_property_enumProperty type (e.g., 0 = Elastic Modulus, 1 = Shear Modulus, etc.).

type of entity_id: int
entity_idID of the material.

return type of : float
Returns
Value of the specified material property.

◆ get_media_name_list()

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()

get_media_property ( entity_id)

Get the media classification of a material.



type of entity_id: int

Parameters
entity_idID of the media.

return type of : int
Returns
: Media type 0 = FLUID, 1 = POROUS, 2 = SOLID.

◆ get_merge_setting()

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"
get_merge_setting(geometry_type, entity_id)
Get merge mode ("on", "off", or "auto") for a given entity.
Definition cubit.py:11261
Parameters
geom_typeGeometry type ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID of the entity.

return type of : string
Returns
: The merge setting "on", "off", or "auto".

◆ get_merge_tolerance()

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
get_merge_tolerance()
Return the current merge tolerance value.
Definition cubit.py:17271
 @n return type of :  float
Returns
The current merge tolerance value.

◆ get_mergeable_curves()

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:")
get_mergeable_curves(target_volume_ids)
Get the list of mergeable curves from a list of volumes or bodies.
Definition cubit.py:17192

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_idsList 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()

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:")
get_mergeable_surfaces(target_volume_ids)
Get the list of mergeable surfaces from a list of volumes or bodies.
Definition cubit.py:17237

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_idsList 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()

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:")
get_mergeable_vertices(target_volume_ids)
Get the list of mergeable vertices from a list of volumes or bodies.
Definition cubit.py:17144

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_idsList 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()

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)
get_mesh_edge_length(edge_id)
Compute the length of a specified mesh edge.
Definition cubit.py:9836
 @n type of edge_id:  int
Parameters
edge_idID of the mesh edge whose length is requested.

return type of : float
Returns
The length of the specified mesh edge.

◆ get_mesh_element_type()

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"
get_mesh_element_type(entity_type, entity_id)
Get the mesh element type applied to a geometric entity.
Definition cubit.py:14754
 @n type of entity_type:  string
Parameters
entity_typeType of the geometry ("surface", "curve", "volume", etc.).

type of entity_id: int
entity_idID 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()

get_mesh_error_count ( )

◆ get_mesh_error_solutions()

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])
get_mesh_error_solutions(error_code)
Retrieve recommended solutions and context cues for a mesh error.
Definition cubit.py:18777
 @n type of error_code:  int
Parameters
error_codeInteger 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()

get_mesh_errors ( )

◆ get_mesh_geometry_approximation_angle()

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
get_mesh_geometry_approximation_angle(geometry_type, entity_id)
Get the geometry approximation angle for TriMesh/TetMesh on a given entity.
Definition cubit.py:8178
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type ("curve", "surface", or "volume").

type of entity_id: int
entity_idID 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()

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)
get_mesh_group_parent_ids(element_type, element_id)
Retrieve parent group IDs for a specific mesh element.
Definition cubit.py:22169
 @n type of element_type:  string
Parameters
element_typeMesh element type (e.g., "node", "edge", "face"/"tri"/"quad", "volume"/"tet"/"hex").

type of element_id: int
element_idID 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()

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"
get_mesh_interval_firmness(geometry_type, entity_id)
Retrieve the interval firmness for a specified geometry entity.
Definition cubit.py:8918
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry 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_idID of the entity whose interval firmness is queried.

return type of : string
Returns
: The current interval firmness "HARD", "SOFT", or "LIMP".

◆ get_mesh_intervals()

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)
get_mesh_intervals(geometry_type, entity_id)
Get the mesh interval count for a specified entity.
Definition cubit.py:8773
 @n type of geometry_type:  string
Parameters
geometry_typeEntity type: "curve", "surface", or "volume".

type of entity_id: int
entity_idID 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()

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)
get_mesh_scheme(geometry_type, entity_id)
Retrieve the meshing scheme applied to a geometric entity.
Definition cubit.py:7707
 @n type of geometry_type:  string
Parameters
geometry_typeType of geometry ("curve", "surface", "volume").

type of entity_id: int
entity_idID 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()

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"
get_mesh_scheme_firmness(geometry_type, entity_id)
Retrieve the meshing scheme firmness for a specified surface or volume.
Definition cubit.py:7771
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type ("surface" or "volume").

type of entity_id: int
entity_idID of the entity whose scheme firmness is queried.

return type of : string
Returns
The current scheme firmness ("Default", "Soft", or "Hard").

◆ get_mesh_size()

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)
get_mesh_size(geometry_type, entity_id)
Retrieve the effective target edge length for meshing an entity.
Definition cubit.py:8803
 @n type of geometry_type:  string
Parameters
geometry_typeEntity type: "curve", "surface", or "volume".

type of entity_id: int
entity_idID of the entity to query.

return type of : float
Returns
Effective mesh edge length (inherited or default auto size).

◆ get_mesh_size_type()

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".
get_mesh_size_type(geometry_type, entity_id)
Retrieve the mesh size setting type for a specified entity.
Definition cubit.py:9011
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type ("curve", "surface", or "volume").

type of entity_id: int
entity_idID 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()

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])
get_meshed_volume_or_area(geometry_type, entity_ids)
Sum mesh volumes or surface areas for CAD entities or mesh elements.
Definition cubit.py:9867
 @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_idsVector of IDs for the specified type.

return type of : float
Returns
Total mesh volume (3D) or area (2D).

◆ get_meshgems_version()

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)
get_meshgems_version()
Retrieve the MeshGems library version.
Definition cubit.py:4500
 @n return type of :  string
Returns
A string containing the MeshGems library version.

◆ get_ML_classification()

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.

  @n type of geom_type:  string
Parameters
geom_typeGeometry type indicator: "volume" or "surface".

type of ent_id: int
ent_idID 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(geom_type, ent_id)
Get the top classification label for a single volume or surface.
Definition cubit.py:23393

◆ get_ML_classification_categories()

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".

  @n type of geom_type:  string
Parameters
geom_typeGeometry 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
print("Classification categories for surface:", categories)
get_ML_classification_categories(geom_type)
Retrieve all available classification categories for a geometry type.
Definition cubit.py:23434

◆ get_ML_classification_models()

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.

  @n 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_classification_models()
Retrieve the list of supported classification ML model names.
Definition cubit.py:23598

◆ get_ML_classifications()

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.

  @n type of geom_type:  string
Parameters
geom_typeGeometry type to classify ("volume" or "surface").

type of ent_ids: std::vector< size_t,std::allocator< size_t > >
ent_idsVector 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()

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.

  @n type of op_name:  string
Parameters
op_nameML operation name (see get_ML_operation_features()).

type of f1: std::vector< double,std::allocator< double > >
f1First feature vector; must match f2 in length.

type of f2: std::vector< double,std::allocator< double > >
f2Second 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]]
user_configs = [1, 0] # geometry sizing and regularize
mesh_size = 1.5
op_names, entity1_ids, entity2_ids, params, user_configs, 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_operation_features(ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
Compute ML feature vectors for a list of Cubit operations.
Definition cubit.py:23225
get_ML_feature_distance(op_name, f1, f2)
Compute the weighted distance between two feature vectors.
Definition cubit.py:23784

◆ get_ML_feature_importances()

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_nameML 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:")
get_ML_operation_feature_names(ml_op_name, reduced_features=False)
Retrieve the list of feature names for a specified ML operation.
Definition cubit.py:23526
get_ML_feature_importances(op_name)
Retrieve feature importance scores for a given ML operation.
Definition cubit.py:23741

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

◆ get_ML_features()

get_ML_features ( ml_op_names,
entity1_ids,
entity2_ids,
params,
user_configs,
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.

  @n type of ml_op_names:  std::vector< std::string,std::allocator< std::string > >
Parameters
ml_op_namesVector 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_idsVector 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_idsVector 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 > > > >
paramsVector of parameter lists for each operation.

type of user_configs: std::vector< double,std::allocator< double > >
user_configsVector of user configurable settings (geometry sizing and regularize).

type of mesh_size: float
mesh_sizeTarget mesh size for feature calculations.

type of reduced_features: boolean, optional
reduced_featuresIf 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]]
user_configs = [1, 0]
mesh_size = 1.5924
ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size)
get_ML_features(ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
Compute ML feature vectors for operations permitting multiple entities.
Definition cubit.py:23269

◆ get_ML_initialize_surviving_entities()

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.

  @n type of op_name:  string
Parameters
op_nameML operation name (e.g., "remove_cone").

type of ent1: std::vector< int,std::allocator< int > >
ent1List of primary entity IDs involved in the operation.

type of ent2: std::vector< int,std::allocator< int > >
ent2List 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_initialize_surviving_entities(op_name, ent1, ent2)
Capture entities for survival tracking before a CAD operation.
Definition cubit.py:23839

◆ get_ML_model_ID()

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.

  @n type of model_name:  string
Parameters
model_nameName 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_ID(model_name)
Retrieve the unique numeric ID for a given ML model or operation name.
Definition cubit.py:23668

◆ get_ML_model_name()

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.

  @n type of model_ID:  int
Parameters
model_IDThe 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_model_name(model_ID)
Retrieve the name of an ML model based on its ID.
Definition cubit.py:23645

◆ get_ML_operation()

get_ML_operation ( op_name,
entity_id1,
entity_id2,
params,
user_configs,
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.

  @n type of op_name:  string
Parameters
op_nameName of the ML operation (see get_ML_operation_features).

type of entity_id1: int
entity_id1ID of the primary entity involved in the operation.

type of entity_id2: int
entity_id2ID of the secondary entity involved in the operation.

type of params: std::vector< double,std::allocator< double > >
paramsOptional vector of parameter values for the operation.

type of user_configs: std::vector< double,std::allocator< double > >
user_configsVector of user configurable settings (geometry sizing and regularize).

type of small_curve_size: float
small_curve_sizeThreshold below which a curve is considered "small." Used for tailoring command generation.

type of mesh_size: float
mesh_sizeTarget 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
"surface_no_op", 5, 0, [-1, -1, -1], [1, 0], 0.1, 1.5)
print("Command:", operation[0])
print("Label:", operation[1])
print("Preview:", operation[2])
get_ML_operation(op_name, entity_id1, entity_id2, params, user_configs, small_curve_size, mesh_size)
Generate the command, display label, and preview text for an ML operation.
Definition cubit.py:23713

◆ get_ML_operation_feature_names()

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_nameName of the ML operation or model (as defined by get_ML_operation_features()).

type of reduced_features: boolean, optional
reduced_featuresIf 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:")
get_ML_operation_feature_types(ml_op_name, reduced_features=False)
Get the data-type descriptor for each feature of a specified ML operation.
Definition cubit.py:23492

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()

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.

  @n type of ml_op_name:  string
Parameters
ml_op_nameName of the ML operation or model.

type of reduced_features: boolean, optional
reduced_featuresIf 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_size(ml_op_name, reduced_features=False)
Retrieve the expected feature-vector length for a given ML operation.
Definition cubit.py:23554

◆ get_ML_operation_feature_types()

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)

  @n type of ml_op_name:  string
Parameters
ml_op_nameName of the ML model or operation (see get_ML_operation_features()).

type of reduced_features: boolean, optional
reduced_featuresIf 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()

get_ML_operation_features ( ml_op_names,
entity1_ids,
entity2_ids,
params,
user_configs,
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]]
user_configs = [1, 0] # geom_sizing ON, regularize OFF
mesh_size = 1.5924
ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size)

Supported operations: ### Outdated ###

.. 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_namesVector of ML operation/model names.

type of entity1_ids: std::vector< size_t,std::allocator< size_t > >
entity1_idsVector of primary entity IDs for each operation.

type of entity2_ids: std::vector< size_t,std::allocator< size_t > >
entity2_idsVector 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 > > > >
paramsVector of parameter lists for each operation.

type of user_configs: std::vector< double,std::allocator< double > >
user_configsVector of user configurable settings (geometry sizing and regularize).

type of mesh_size: float
mesh_sizeTarget mesh size for feature calculations.

type of reduced_features: boolean, optional
reduced_featuresIf 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()

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.

  @n type of ml_op_name:  string
Parameters
ml_op_nameName 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_operation_label_size(ml_op_name)
Retrieve the expected label vector length for a given ML operation.
Definition cubit.py:23577

◆ get_ML_predictions()

get_ML_predictions ( ml_op_names,
entity1_ids,
entity2_ids,
params,
user_configs,
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.

  @n type of ml_op_names:  std::vector< std::string,std::allocator< std::string > >
Parameters
ml_op_namesVector of ML operation or model names.
Classification"volume_no_op", "classify_surface" (returns confidence per category).
Regressionvarious operation IDs (returns one or more quality metrics).

type of entity1_ids: std::vector< size_t,std::allocator< size_t > >
entity1_idsVector of primary entity IDs for each operation.

type of entity2_ids: std::vector< size_t,std::allocator< size_t > >
entity2_idsVector 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 > > > >
paramsVector of parameter lists for each operation.

type of user_configs: std::vector< double,std::allocator< double > >
user_configsVector of user configurable settings (geometry sizing and regularize).

type of mesh_size: float
mesh_sizeTarget mesh size used in feature calculation.

type of reduced_features: boolean, optional
reduced_featuresIf 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]]
user_configs = [1, 0]
mesh_size = 1.5
ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size)
get_ML_predictions(ml_op_names, entity1_ids, entity2_ids, params, user_configs, mesh_size, reduced_features=False)
Compute ML predictions for a list of operations on single-entity pairs.
Definition cubit.py:23320

◆ get_ML_regression_models()

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.

  @n 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_regression_models()
Retrieve the list of supported regression ML model names.
Definition cubit.py:23619

◆ get_ML_surviving_entities()

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.

@n type of op_name:  string
Parameters
op_nameName of the ML operation.

type of begin_ents: std::vector< int,std::allocator< int > >
begin_entsEntity 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
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])
get_ML_surviving_entities(op_name, begin_ents)
Identify which entities survive after a CAD operation.
Definition cubit.py:23880

for id in result[1]: print("Surviving entity ID:", id)

◆ get_moment_magnitude()

get_moment_magnitude ( entity_id)

Get the moment magnitude of a force BC.



type of entity_id: int

Parameters
entity_idID of the force BC.

return type of : float
Returns
Moment magnitude.

◆ get_n_largest_distances_between_meshes()

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)
get_n_largest_distances_between_meshes(n, entity_type1, ids1, entity_type2, ids2)
Finds the N largest node-to-element distances between two meshes.
Definition cubit.py:10390

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
nNumber of largest distances to return.

type of entity_type1: string
entity_type1Entity type for first mesh (e.g., "surface").

type of ids1: std::vector< int,std::allocator< int > >
ids1IDs of entities to use for nodes.

type of entity_type2: string
entity_type2Entity type for second mesh (e.g., "surface").

type of ids2: std::vector< int,std::allocator< int > >
ids2IDs 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_namespace_list()

get_namespace_list ( )

◆ get_narrow_regions()

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)
get_narrow_regions(target_ids, narrow_size)
Find faces containing narrow regions within specified volumes.
Definition cubit.py:15056
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_idsVector of volume IDs to examine.

type of narrow_size: float
narrow_sizeDistance 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()

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)
get_narrow_surfaces(target_volume_ids, mesh_size)
Find surfaces with narrow regions in specified volumes.
Definition cubit.py:14940

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_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeDistance 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()

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:")
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.
Definition cubit.py:17031

for id in nearby_ents: print(id)

# Expected output:
# 2
 @n type of gtype:  string
Parameters
gtypeEntity type to query: "curve", "surface", or "volume".

type of ent_ids: std::vector< int,std::allocator< int > >
ent_idsEntities of type gtype to check.

type of compare_ents: std::vector< int,std::allocator< int > >
compare_entsEntities of type gtype to check against. If empty, checks against all entities of type gtype in the model.

type of distance: float
distanceMaximum 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()

get_nearby_volumes_at_volume ( volume_id,
compare_volumes,
distance )

Get the list of nearby volumes from the model for a single volume :type volume_id: int.

Parameters
volume_idvolume to check. :param volumes: to check against. If empty, will check against all volumes in model :param maximum: distance betwen volumes. Optional. Use -1 to compute default tolerance :rtype: std::vector< int,std::allocator< int > >
Returns
list of volumes that are nearby to volume_id from compare_volumes list

◆ get_next_block_id()

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
get_next_block_id()
Get the next available block ID.
Definition cubit.py:19368
 @n return type of :  int
Returns
Next available block ID.

◆ get_next_boundary_layer_id()

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()

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)
get_next_command_from_history()
Get the next command from the history buffer.
Definition cubit.py:5006
 @n return type of :  string
Returns
The next command in the history sequence.

◆ get_next_group_id()

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"
get_next_group_id()
Return the next available group ID from Cubit.
Definition cubit.py:21904
 @n return type of :  int
Returns
Next unused integer ID for a new group.

◆ get_next_nodeset_id()

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
get_next_nodeset_id()
Get the next available nodeset ID.
Definition cubit.py:20608
 @n return type of :  int
Returns
Next available nodeset ID.

◆ get_next_sideset_id()

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
get_next_sideset_id()
Get the next available sideset ID.
Definition cubit.py:20189
 @n return type of :  int
Returns
Next available sideset ID.

◆ get_nodal_coordinates()

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]})")
get_nodal_coordinates(node_id)
Get the coordinates of a mesh node.
Definition cubit.py:14577
 @n type of node_id:  int
Parameters
node_idID 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()

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)
get_node_constraint()
Query whether node constraint is enabled (move mid-nodes to geometry).
Definition cubit.py:8513
 @n return type of :  boolean
Returns
True if node constraint is "on" or "smart"; otherwise false.

◆ get_node_constraint_smart_metric()

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)
get_node_constraint_smart_metric()
Query the current quality metric for smart node constraint.
Definition cubit.py:8591
 @n return type of :  string
Returns
The quality metric name for smart mode ("distortion" or "normalized inradius").

◆ get_node_constraint_smart_threshold()

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)
get_node_constraint_smart_threshold()
Query the current quality threshold for smart node constraint.
Definition cubit.py:8565
 @n return type of :  float
Returns
The quality threshold used for smart mode (double).

◆ get_node_constraint_value()

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)
get_node_constraint_value()
Query the numeric value of the node constraint setting.
Definition cubit.py:8539
 @n return type of :  int
Returns
0 if off, 1 if on, or 2 if smart.

◆ get_node_count()

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)
get_node_count()
Retrieve the count of nodes in the current model.
Definition cubit.py:9656
 @n return type of :  int
Returns
Number of nodes in the current model's mesh.

◆ get_node_edges()

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
print(f"Node 1 is adjacent to {len(edges)} edge(s):", edges)
get_node_edges(node_id)
Get the IDs of all edge elements adjacent to a node.
Definition cubit.py:14678
 @n type of node_id:  int
Parameters
node_idID 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()

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
print(f"Node 1 exists? {'Yes' if exists else 'No'}")
get_node_exists(node_id)
Check whether a node exists in the model.
Definition cubit.py:13948
 @n type of node_id:  int
Parameters
node_idID of the node to check.

return type of : boolean
Returns
true if the node exists, false otherwise.

◆ get_node_faces()

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
print(f"Node 1 is adjacent to {len(quads)} quad(s).") # likely 0
# Mesh the surface and query again
cubit.cmd("surface 1 mesh")
print(f"After surface mesh, Node 1 is adjacent to {len(quads)} quad(s):", quads)
get_node_faces(node_id)
Get the IDs of all quadrilateral elements (faces) adjacent to a node.
Definition cubit.py:14613
 @n type of node_id:  int
Parameters
node_idID 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()

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
get_node_global_id(node_id)
Get the global node ID assigned in the Exodus file for a mesh node.
Definition cubit.py:14510
 @n type of node_id:  int
Parameters
node_idLocal 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()

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
get_node_position_fixed(node_id)
Query whether a mesh node is fixed (constrained against smoothing).
Definition cubit.py:14719
 @n type of node_id:  int
Parameters
node_idID 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()

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
print(f"Node 1 is adjacent to {len(tris)} tri(s):", tris)
get_node_tris(node_id)
Get the IDs of all triangular elements adjacent to a node.
Definition cubit.py:14645
 @n type of node_id:  int
Parameters
node_idID 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()

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
get_nodeset_count()
Get the current number of nodesets in the model.
Definition cubit.py:20538
 @n return type of :  int
Returns
The number of nodesets currently defined in the model.

◆ get_nodeset_curves()

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).")
get_nodeset_curves(nodeset_id)
Get the list of curve IDs associated with a nodeset.
Definition cubit.py:20704

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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
# Print the nodeset IDs
print("Active nodeset IDs:")
get_nodeset_id_list()
Get a list of all active nodeset IDs.
Definition cubit.py:20580

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()

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_enumBC type enum (CI_BCTypes).

type of bc_id: int
bc_idID of the boundary condition.

return type of : std::vector< int,std:: allocator< int > >
Returns
List of associated nodeset IDs.

◆ get_nodeset_node_count()

get_nodeset_node_count ( nodeset_id)

Get the number of nodes in a nodeset.



type of nodeset_id: int

Parameters
nodeset_idThe nodeset id

return type of : int
Returns
Number of nodes in the nodeset

◆ get_nodeset_nodes()

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
print(f"Nodeset 50 contains {len(node_ids)} node(s).")
get_nodeset_nodes(nodeset_id)
Get the list of node IDs explicitly assigned to a nodeset.
Definition cubit.py:20775

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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).")
get_nodeset_nodes_inclusive(nodeset_id)
Get the list of node IDs associated with a nodeset (inclusive).
Definition cubit.py:20819

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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).")
get_nodeset_surfaces(nodeset_id)
Get the list of surface IDs associated with a nodeset.
Definition cubit.py:20672

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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
print(f"Nodeset 40 contains {len(vertex_ids)} vertex(s).")
get_nodeset_vertices(nodeset_id)
Get the list of vertex IDs associated with a nodeset.
Definition cubit.py:20736

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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
print(f"Nodeset 1 contains {len(volume_ids)} volume(s).")
get_nodeset_volumes(nodeset_id)
Get the list of volume IDs associated with a nodeset.
Definition cubit.py:20640

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

  @n type of nodeset_id:  int
Parameters
nodeset_idID 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()

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)
get_num_volume_shells(volume_id)
Get the number of shells in a volume.
Definition cubit.py:10800
 @n type of volume_id:  int
Parameters
volume_idID 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()

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.

 @n type of volumes:  std::vector< int,std::allocator< int > >
Parameters
volumesVector 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]
get_overconstrained_tets_in_volumes(volumes)
Retrieve IDs of overconstrained tetrahedra within specified volumes.
Definition cubit.py:10241

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()

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)
get_overlap_max_angle()
Get the current maximum angle tolerance used for calculating surface overlaps.
Definition cubit.py:16949
 @n return type of :  float
Returns
The current maximum angle tolerance (in degrees) used for surface overlap calculations.

◆ get_overlap_max_gap()

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)
get_overlap_max_gap()
Get the current maximum gap tolerance used for calculating surface overlaps.
Definition cubit.py:16833
 @n return type of :  float
Returns
The current maximum gap tolerance (in model units) used for surface overlap calculations.

◆ get_overlap_min_gap()

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)
get_overlap_min_gap()
Get the current minimum gap tolerance used for calculating surface overlaps.
Definition cubit.py:16891
 @n return type of :  float
Returns
The current minimum gap tolerance (in model units) used for surface overlap calculations.

◆ get_overlapping_surfaces_at_surface()

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}:")
get_overlapping_surfaces_at_surface(surface_id, compare_volumes, cache_overlaps=0)
Identify surfaces in the model that overlap a single target surface.
Definition cubit.py:16805

for s_id in overlapping_surfaces: print(s_id)

# Expected output:
# 10
 @n type of surface_id:  int
Parameters
surface_idSurface ID to check.

type of compare_volumes: std::vector< int,std::allocator< int > >
compare_volumesList of volumes to check against. If empty, checks against all volumes in the model.

type of cache_overlaps: int, optional
cache_overlapsCaching 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()

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:")
get_overlapping_surfaces_in_bodies(body_ids, filter_slivers=False)
Identify overlapping surfaces between different volumes in a set of bodies.
Definition cubit.py:16564

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_idsList of body IDs to search for surface overlaps.

type of filter_slivers: boolean, optional
filter_sliversOptional 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()

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:")
get_overlapping_volumes(target_volume_ids)
Identify overlapping volumes in a list of volumes.
Definition cubit.py:16713

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_idsList 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()

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}:")
get_overlapping_volumes_at_volume(volume_id, compare_volumes)
Identify volumes in the model that overlap a single target volume.
Definition cubit.py:16755

for v_id in overlapping_volumes: print(v_id)

# Expected output:
# 2
 @n type of volume_id:  int
Parameters
volume_idVolume ID to check.

type of compare_volumes: std::vector< int,std::allocator< int > >
compare_volumesList 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()

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)
get_owning_body(geometry_type, entity_id)
Get the owning body for a specified entity.
Definition cubit.py:10883
 @n type of geometry_type:  string
Parameters
geometry_typeSpecifies the entity type ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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)
get_owning_volume(geometry_type, entity_id)
Get the owning volume for a specified entity.
Definition cubit.py:10914
 @n type of geometry_type:  string
Parameters
geometry_typeSpecifies the entity type ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID 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()

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
get_owning_volume_by_name(entity_name)
Get the owning volume for an entity by its name.
Definition cubit.py:10940
 @n type of entity_name:  string
Parameters
entity_nameThe 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()

get_parent_assembly_instance ( assembly_id)

Get the instance number of the parent of an assembly node.



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : int
Returns
Parent instance number.

◆ get_parent_assembly_path()

get_parent_assembly_path ( assembly_id)

Get the path of an assembly node's parent.



type of assembly_id: int

Parameters
assembly_idID of the assembly node.

return type of : string
Returns
Parent path string.

◆ get_pick_filters()

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
get_pick_filters()
Retrieve the list of entity types currently allowed for picking.
Definition cubit.py:6853

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()

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
get_selected_ids()
Retrieve all currently selected entity IDs in pick order.
Definition cubit.py:6594
get_pick_type()
Get the current pick mode for entity selection.
Definition cubit.py:6691

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()

get_pressure_function ( entity_id)

Get the function expression associated with a pressure BC.



type of entity_id: int

Parameters
entity_idID of the pressure BC.

return type of : string
Returns
Pressure function as a string.

◆ get_pressure_value()

get_pressure_value ( entity_id)

Get the magnitude value of a pressure BC.



type of entity_id: int

Parameters
entity_idID of the pressure BC.

return type of : float
Returns
Pressure magnitude.

◆ get_previous_command_from_history()

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)
get_previous_command_from_history()
Get the previous command from the history buffer.
Definition cubit.py:5030
 @n return type of :  string
Returns
The previous command in the history sequence.

◆ get_protrusion_surfaces()

get_protrusion_surfaces ( surface_id)

Return the surfaces in the protrusion connected to the specified surface.

The function returns a list of surface IDs that belong to the same protrusion feature as the given surface. The input surface_id must be part of a protrusion. 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("unite volume 1 2")
surf_id = 17
protrusion_surfs = cubit.get_protrusion_surfaces(surf_id)
print("Protrusion surfaces:", tuple(protrusion_surfs))
# Expected output (example):
# Protrusion surfaces: (17, 19, 20, 21, 22, 23)
get_protrusion_surfaces(surface_id)
Return the surfaces in the protrusion connected to the specified surface.
Definition cubit.py:15888



type of surface_id: int

Parameters
surface_idSurface ID that is part of a protrusion.

return type of : std::vector< int,std:: allocator< int > >
Returns
A list of surface IDs belonging to the protrusion (includes surface_id itself).

◆ get_pyramid_count()

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)
get_pyramid_count()
Retrieve the count of pyramid elements in the current model.
Definition cubit.py:9480
 @n return type of :  int
Returns
Number of pyramid elements in the current model's mesh.

◆ get_pyramid_global_element_id()

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)
get_pyramid_global_element_id(pyramid_id)
Get the Global Element ID for a specific pyramid element.
Definition cubit.py:14331
 @n type of pyramid_id:  int
Parameters
pyramid_idLocal 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()

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)
get_python_version()
Retrieve the Python interpreter version used by Cubit.
Definition cubit.py:4548
 @n return type of :  string
Returns
A string containing the Python version number.

◆ get_quad_count()

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)
get_quad_count()
Retrieve the count of quadrilateral elements in the current model.
Definition cubit.py:9530
 @n return type of :  int
Returns
Number of quadrilateral elements (surface faces of a hex mesh).

◆ get_quad_global_element_id()

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)
get_quad_global_element_id(quad_id)
Get the Global Element ID for a specific quadrilateral element.
Definition cubit.py:14400
 @n type of quad_id:  int
Parameters
quad_idLocal 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()

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]]
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.
Definition cubit.py:10026
 @n type of geom_type:  string
Parameters
geom_typeGeometry type ("curve", "surface", or "volume").

type of mesh_type: string
mesh_typeMesh-element type to evaluate ("edge", "tri", "quad", "tet", "hex").

type of geom_id_list: std::vector< int,std::allocator< int > >
geom_id_listVector of geometry IDs whose attached mesh elements are considered.

type of expand_levels: int
expand_levelsNumber of adjacency levels to include (0 = only directly attached elements).

type of metric_name: string
metric_nameName of the quality metric (e.g., "scaled jacobian", "skew").

type of single_threshold: float
single_thresholdThreshold when using a single bound.

type of use_low_threshold: boolean
use_low_thresholdIf true, apply [low_threshold, high_threshold]; otherwise use single_threshold.

type of low_threshold: float
low_thresholdLower bound of the acceptable quality range.

type of high_threshold: float
high_thresholdUpper bound of the acceptable quality range.

type of make_group: boolean
make_groupIf 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()

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
)
get_quality_value(mesh_type, mesh_id, metric_name)
Retrieve a specific quality metric value for a single mesh element.
Definition cubit.py:10058
 @n type of mesh_type:  string
Parameters
mesh_typeType of mesh element ("hex", "tet", "tri", "quad").

type of mesh_id: int
mesh_idIdentifier of the mesh element.

type of metric_name: string
metric_nameName 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()

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]
"hex", # mesh_type
mesh_ids, # list of element IDs
"skew" # metric_name
)
get_quality_values(mesh_type, mesh_ids, metric_name)
Retrieve quality metric values for multiple mesh elements.
Definition cubit.py:10093

for eid, val in zip(mesh_ids, skew_vals): print(f"Element {eid} skew: {val}")

  @n type of mesh_type:  string
Parameters
mesh_typeType of mesh element ("hex", "tet", "tri", "quad").

type of mesh_ids: std::vector< int,std::allocator< int > >
mesh_idsVector of mesh element IDs to query.

type of metric_name: string
metric_nameName 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()

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])
get_reduce_bolt_core_default_dimensions(vol_id)
Computes default core dimensions for a bolt volume in reduce bolt core operation.
Definition cubit.py:18808
 @n type of vol_id:  int
Parameters
vol_idVolume 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()

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)
get_relatives(source_geometry_type, source_id, target_geom_type)
Get the relatives (parents or children) of a specified entity.
Definition cubit.py:10637
 @n type of source_geometry_type:  string
Parameters
source_geometry_typeThe type of the source entity ("body", "volume", "surface", "curve", or "vertex").

type of source_id: int
source_idID of the source entity.

type of target_geom_type: string
target_geom_typeThe 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()

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
get_rendering_mode()
Get the current graphics rendering mode.
Definition cubit.py:6254
 @n return type of :  int
Returns
Integer code for the current rendering mode.

◆ get_requested_mesh_interval_firmness()

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:
print("Surface 12 requested interval firmness:", firmness) # Expected: "SOFT"
# 3) Query again (still "SOFT", unaffected by connected geometry).
print("Surface 12 requested interval firmness:", firmness) # Expected: "SOFT"
get_requested_mesh_interval_firmness(geometry_type, entity_id)
Retrieve the explicitly requested interval firmness for a specified entity.
Definition cubit.py:8962
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type of the entity ("curve", "surface", or "volume").

type of entity_id: int
entity_idID 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()

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
print("Mesh size on curve 7:", size)
get_requested_mesh_intervals(geometry_type, entity_id)
Retrieve the mesh interval count explicitly set on a geometry entity.
Definition cubit.py:9151
 @n type of geometry_type:  string
Parameters
geometry_typeEntity type: "curve", "surface", or "volume".

type of entity_id: int
entity_idID of the geometry entity.

return type of : int
Returns
Interval count set on that entity.

◆ get_requested_mesh_size()

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)
get_requested_mesh_size(geometry_type, id)
Retrieve the mesh size explicitly set on a geometry entity.
Definition cubit.py:8833
 @n type of geometry_type:  string
Parameters
geometry_typeEntity type: "curve", "surface", or "volume".

type of id: int
idID 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()

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"
get_requested_mesh_size_type(geometry_type, entity_id)
Retrieve the mesh size setting type explicitly requested on a specified entity.
Definition cubit.py:9057
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type ("curve", "surface", or "volume").

type of entity_id: int
entity_idID 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()

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
print("Revision date:", rev_date)
get_revision_date()
Retrieve the Cubit revision date.
Definition cubit.py:4355
 @n return type of :  string
Returns
A string containing Cubit's last revision date.

◆ get_rubberband_shape()

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)
get_rubberband_shape()
Get the current rubberband selection shape.
Definition cubit.py:6461
 @n return type of :  int
Returns
Integer code indicating the current rubberband selection shape.

◆ get_selected_id()

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)
get_selected_type(index)
Get the selected entity type by index.
Definition cubit.py:6662
 @n type of index:  int
Parameters
indexZero-based index into the current selection list.

return type of : int
Returns
Entity ID at the given index.

◆ get_selected_ids()

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()

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
indexZero-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()

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)
get_sgm_version()
Retrieve the SGM (Solid Geometry Manager) version.
Definition cubit.py:4452
 @n return type of :  string
Returns
A string containing the SGM version number.

◆ get_sharp_angle_vertices()

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:")
get_sharp_angle_vertices(target_volume_ids, upper_bound, lower_bound)
Identify vertices at sharp curve angles in a set of volumes.
Definition cubit.py:16394

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_idsList of volume IDs to analyze.

type of upper_bound: float
upper_boundUpper threshold angle, in degrees.

type of lower_bound: float
lower_boundLower 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()

get_sideset_area ( sideset_id)

Get the total area of a sideset.

 If the sideset contains triangle or quadrilateral elements, this function returns the sum of the
 areas of those elements. Otherwise, it finds the geometric faces associated with the sideset and
 returns the sum of the areas of the corresponding geometric surfaces.

.. 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}")
get_sideset_area(sideset_id)
Get the total area of a sideset.
Definition cubit.py:20394
 @n type of sideset_id:  int
Parameters
sideset_idID of the sideset to examine.

return type of : float
Returns
Sum of the areas of all tris or faces in the sideset.

◆ get_sideset_contact_pairs()

get_sideset_contact_pairs ( geom_type,
ent_list,
geom_tol = -1.0 )

Identify sideset-based contact interfaces and return compact integer interaction records.

This scans sidesets associated with the specified volumes or blocks, groups sidesets that represent a common contact interface (1-to-1, one-to-many, many-to-one, or many-to-many), and returns each interface as a compact integer record. Records may also represent "intent" where only one side has a named sideset but the opposite entity is known.

Each returned interaction record is encoded as:

[ status, A_id, B_id, bolt_id, n_A_to_B, A_to_B_ss..., n_B_to_A, B_to_A_ss... ]

Field meanings:

  • status:
    • 0 = both directions present (n_A_to_B >= 1 and n_B_to_A >= 1)
    • 1 = missing reverse direction (exactly one direction list is present)
    • 2 = ambiguous (multiple plausible neighbors; not uniquely resolvable)
    • 3 = unmatched (no inferred opposite entity)
  • A_id, B_id:
    • In geom_type=="volume" mode: volume IDs
    • In geom_type=="block" mode: block IDs
    • B_id is 0 when unknown/ambiguous/unmatched
  • bolt_id: parsed from naming convention (e.g. "<A>_to_<B>_<bolt_id>"); 0 if not present/unknown
  • n_A_to_B, n_B_to_A: number of grouped sidesets in each direction
  • A_to_B_ss, B_to_A_ss: sideset IDs grouped for each direction
Notes
  • The output list is sorted deterministically for reproducibility and testing.
  • In many models, only one direction is explicitly defined by naming conventions. Such cases return status==1 when the opposite entity is known.

Related helpers once you have sideset IDs:

- get_exodus_entity_name("sideset", sideset_id)
- get_sideset_area(sideset_id)

.. code-block:: python

pairs = cubit.get_sideset_contact_pairs("block", [12, 34])
get_sideset_contact_pairs(geom_type, ent_list, geom_tol=-1.0)
Identify sideset-based contact interfaces and return compact integer interaction records.
Definition cubit.py:20506

for rec in pairs: status, a_id, b_id, bolt_id = rec[0], rec[1], rec[2], rec[3]

i = 4
n_ab = rec[i]; i += 1
ab_ids = rec[i:i + n_ab]; i += n_ab
n_ba = rec[i]; i += 1
ba_ids = rec[i:i + n_ba]
print(f"status={status} A={a_id} B={b_id} bolt_id={bolt_id}")

for sid in ab_ids: name = cubit.get_exodus_entity_name("sideset", sid)

print(f" A->B sideset {sid}: name='{name}', area={area:g}")

for sid in ba_ids: name = cubit.get_exodus_entity_name("sideset", sid)

print(f" B->A sideset {sid}: name='{name}', area={area:g}")
  @n type of geom_type:  string
Parameters
geom_typeEntity type selector: "volume" (ent_list are volume IDs) or "block" (ent_list are block IDs). Only sidesets associated with the specified entities are considered. Case-insensitive.

type of ent_list: std::vector< int,std::allocator< int > >
ent_listList of entity IDs to inspect (volume IDs when geom_type=="volume"; block IDs when geom_type=="block").

type of geom_tol: float, optional
geom_tolGeometric tolerance for proximity fallback. If geom_tol < 0 (default -1.0), uses get_merge_tolerance(). If geom_tol == 0, disables proximity fallback. If geom_tol > 0, uses the provided tolerance.

return type of : std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std:: allocator< int > > > >
Returns
A list of interaction records as described above.

◆ get_sideset_count()

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
get_sideset_count()
Get the current number of sidesets in the model.
Definition cubit.py:20119
 @n return type of :  int
Returns
The number of sidesets currently defined in the model.

◆ get_sideset_curves()

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).")
get_sideset_curves(sideset_id)
Get the list of curve IDs associated with a sideset.
Definition cubit.py:20221

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

  @n type of sideset_id:  int
Parameters
sideset_idID 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()

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
print(f"Sideset 20 contains {len(edge_ids)} edge(s).")
get_sideset_edges(sideset_id)
Get the list of edge IDs contained in a sideset.
Definition cubit.py:20256

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

  @n type of sideset_id:  int
Parameters
sideset_idID 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()

get_sideset_element_type ( sideset_id)

Get the element type of a sideset.



type of sideset_id: int

Parameters
sideset_idThe id of the sideset to be queried

return type of : string
Returns
Element type

◆ get_sideset_id_list()

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
# Print the sideset IDs
print("Active sideset IDs:")
get_sideset_id_list()
Get a list of all active sideset IDs.
Definition cubit.py:20161

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()

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_enumBC type enum (CI_BCTypes).

type of bc_id: int
bc_idID of the boundary condition.

return type of : std::vector< int,std:: allocator< int > >
Returns
List of associated sideset IDs.

◆ get_sideset_quads()

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
print(f"Sideset 4 contains {len(quad_ids)} quad(s).")
get_sideset_quads(sideset_id)
Get the list of quadrilateral (quad) element IDs contained in a sideset.
Definition cubit.py:20325

for quad_id in quad_ids: print(f" Quad ID: {quad_id}")

  @n type of sideset_id:  int
Parameters
sideset_idID 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()

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
print(f"Sideset 3 contains {len(surface_ids)} surface(s).")
get_sideset_surfaces(sideset_id)
Get the list of surface IDs contained in a sideset.
Definition cubit.py:20290

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

  @n type of sideset_id:  int
Parameters
sideset_idID 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()

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
print(f"Sideset 6 contains {len(tri_ids)} tri(s).")
get_sideset_tris(sideset_id)
Get the list of triangle (tri) element IDs contained in a sideset.
Definition cubit.py:20361

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

  @n type of sideset_id:  int
Parameters
sideset_idID 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()

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.
print(matches) # prints (1, 2)
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.
Definition cubit.py:12074
 @n type of curve_ids:  std::vector< int,std::allocator< int > >
Parameters
curve_idsList of curve IDs to compare against.

type of tol: float, optional
tolTolerance for length comparison (fraction if use_percent_tol is true, otherwise absolute).

type of use_percent_tol: boolean, optional
use_percent_tolIf 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_volsIf 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()

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.
print(matches) # prints (2, 3)
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.
Definition cubit.py:12476
 @n type of surface_ids:  std::vector< int,std::allocator< int > >
Parameters
surface_idsList of surface IDs to compare against.

type of tol: float, optional
tolTolerance for area comparison (fraction if use_percent_tol is true, otherwise absolute).

type of use_percent_tol: boolean, optional
use_percent_tolIf 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_volsIf 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()

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.
print(matches) # prints (1, 2)
get_similar_volumes(volume_ids, tol=1e-3, use_percent_tol=True)
Find volumes with similar size and face count to given volumes.
Definition cubit.py:12629
 @n type of volume_ids:  std::vector< int,std::allocator< int > >
Parameters
volume_idsList of volume IDs to compare against.

type of tol: float, optional
tolTolerance for volume comparison (fraction if use_percent_tol is true, otherwise absolute).

type of use_percent_tol: boolean, optional
use_percent_tolIf 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()

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");
print("Volume 2 sizing function:", fn) # prints "curvature"
get_sizing_function_name(entity_type, entity_id)
Retrieve the meshing sizing function type for a surface or volume.
Definition cubit.py:9360
 @n type of entity_type:  string
Parameters
entity_typeEither "surface" or "volume".

type of entity_id: int
entity_idID of the surface or volume.

return type of : string
Returns
The sizing function name assigned to that entity.

◆ get_small_and_narrow_surfaces()

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)
get_small_and_narrow_surfaces(target_ids, small_area, small_curve_size)
Find surfaces that are either small in area or contain narrow regions.
Definition cubit.py:14976

for sid in results: print("Surface ID:", sid)

  @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_idsVector of volume IDs to examine.

type of small_area: float
small_areaArea threshold; faces with area <= small_area qualify as "small."

type of small_curve_size: float
small_curve_sizeDistance 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()

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)
get_small_curves(target_volume_ids, mesh_size)
Find curves with edge length below a threshold within given volumes.
Definition cubit.py:14789

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_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeEdge-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()

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]
get_small_radius_blend_surfaces(target_volume_ids, max_radius)
Find blend surfaces with radius of curvature <= max_radius.
Definition cubit.py:15516
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsVector of volume IDs to examine.

type of max_radius: float
max_radiusMaximum 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()

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)
get_small_surfaces(target_volume_ids, area_threshold)
Find surfaces with area below a given threshold.
Definition cubit.py:14849

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_idsVector of volume IDs to examine.

type of area_threshold: float
area_thresholdArea 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()

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)
get_small_surfaces_HR(target_volume_ids, mesh_size)
Python-callable version: identify small hydraulic-radius surfaces.
Definition cubit.py:14879

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_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeHydraulic 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()

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]
get_small_volumes(target_volume_ids, mesh_size)
Find volumes whose size is below a threshold based on mesh size.
Definition cubit.py:15269
 @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsVector of volume IDs to examine.

type of mesh_size: float
mesh_sizeThreshold 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()

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)
get_smallest_curves(target_volume_ids, number_to_return)
Return IDs of the smallest curves in the specified volumes.
Definition cubit.py:14819

for cid in smallest_curves: print("Curve ID:", cid)

  @n type of target_volume_ids:  std::vector< int,std::allocator< int > >
Parameters
target_volume_idsVector of volume IDs to examine.

type of number_to_return: int
number_to_returnNumber 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()

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)
get_smooth_scheme(geometry_type, entity_id)
Retrieve the smoothing scheme for a specified geometry entity.
Definition cubit.py:7736
 @n type of geometry_type:  string
Parameters
geometry_typeThe geometry type: "curve", "surface", or "volume".

type of entity_id: int
entity_idThe 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()

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_typeType of entity: "curve", "surface", "volume", or "body".

type of geom_id: int
geom_idID 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()

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)
get_solutions_for_blends(surface_id)
Provide possible blend removal solutions for a given surface (and its blend chain if applicable).
Definition cubit.py:18599

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_idThe 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()

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)
get_solutions_for_bolt(bolt_id, insert_id, threaded_vol_id)
Suggests operations for a volume classified as a bolt using known subcomponent IDs.
Definition cubit.py:17903

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_idID of the volume classified as a bolt.

type of insert_id: int
insert_idOptional ID of the insert volume at the bolt interface. Use 0 if absent.

type of threaded_vol_id: int
threaded_vol_idOptional 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()

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)
get_solutions_for_bolt_hole(bearing_hole, threaded_holes)
Suggests repair or modification options for a set of concentric fastener pilot holes.
Definition cubit.py:17961

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_holeID of the surface on the bearing hole (one per hole).

type of threaded_holes: std::vector< int,std::allocator< int > >
threaded_holesList 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()

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
get_solutions_for_cavity_surface(surface_id)
Provide possible cavity removal or adjustment solutions for a given surface (and its cavity if applic...
Definition cubit.py:18695

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_idThe 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_chamfers()

get_solutions_for_chamfers ( surface_id)

Provide possible chamfer removal solutions for a given surface (and its chamfer chain if applicable).

 Given a surface ID, this function returns possible solutions for removing or adjusting chamfers
 on that surface. If the surface is part of a chamfer chain, the solutions will include operations
 for the entire chamfer chain as well.

.. code-block:: python

cubit.cmd("brick x 10")
cubit.cmd("modify curve 12 2 8 11 chamfer radius 1") # Chamfer the four curves on surface 5
# Get chamfer removal solutions for surface 10:
surface_id = 10
solutions = cubit.get_solutions_for_chamfers(surface_id)
get_solutions_for_chamfers(surface_id)
Provide possible chamfer removal solutions for a given surface (and its chamfer chain if applicable).
Definition cubit.py:18648

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 Chamfer Chain at Surface 10
# Command: remove surface 10 chamfer_chain
# Preview: remove surface 10 chamfer_chain preview
# Shorthand: 15 10
 @n type of surface_id:  int
Parameters
surface_idThe surface being queried. If part of a chamfer 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_classified_surface()

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
get_solutions_for_classified_surface(classification, surf_id)
Suggests remedies or modifications for a classified surface.
Definition cubit.py:18001

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
classificationType assigned to the surface (e.g., "slot", "hole", "fillet").

type of surf_id: int
surf_idID 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()

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
get_solutions_for_classified_volume(classification, vol_id)
Suggests geometry fixes or feature operations for a volume based on its classification.
Definition cubit.py:17841

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
classificationClassification type: one of "bolt", "nut", "washer", "spring", "ball", "race", "pin", "gear", "insert", or "other".

type of vol_id: int
vol_idID 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()

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)
get_solutions_for_close_loop(surface_id, mesh_size)
Retrieve recommended remedies for a close-loop surface to resolve narrow regions.
Definition cubit.py:17327

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_idID of the close-loop surface being queried.

type of mesh_size: float
mesh_sizeDistance 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()

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
get_solutions_for_cone_surface(surface_id)
Suggests remedies for a surface classified as a cone.
Definition cubit.py:18489

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_idID 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_connected_surfaces()

get_solutions_for_connected_surfaces ( surf_ids,
common_surface_type )

Propose two operations for a connected set of surfaces.

Given a list of surface IDs that are mutually connected, this function returns exactly two candidate operations: (1) Removal of the connected region. (2) Composite of the surfaces into a single face.

Each solution is represented as a 4-element string list: [0] Display string for the operation. [1] Cubit command to execute it. [2] Cubit preview command. [3] ML shorthand string (includes operation + IDs).

The ML shorthand encodes the operation and surface IDs; its feature type is derived from the specified common_surface_type.

Note
The function does not verify whether the surfaces are actually connected or whether the specified surface type is valid. It assumes both are correct.
.. code-block:: python
import cubit
surf_ids = [12, 13, 14, 15]
solutions = cubit.get_solutions_for_connected_surfaces(surf_ids, "chamfer")
get_solutions_for_connected_surfaces(surf_ids, common_surface_type)
Propose two operations for a connected set of surfaces.
Definition cubit.py:18288

for disp, cmd, prev, shrt in zip(*solutions): print("Option:", disp)

print(" Command:", cmd)
print(" Preview:", prev)
print(" Shorthand:", shrt)



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

Parameters
surf_idsIDs of surfaces that must be mutually connected.



type of common_surface_type: string

Parameters
common_surface_typeKnown type of the connected surfaces.
One"chamfer", "blend", "cavity", "cone", or (default) "contiguous". This type is reflected in the ML shorthand string for each 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 of length 2: [0] Display strings for each operation, [1] Cubit commands, [2] Preview commands, [3] ML shorthand strings (feature type derived from input type). In Python, the result is a tuple of lists.

◆ get_solutions_for_decomposition()

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)
get_solutions_for_decomposition(volume_list, exterior_angle, do_imprint_merge, tolerant_imprint)
Provide possible decomposition solutions for volumes based on exterior angle criteria.
Definition cubit.py:18550

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_listList of volume IDs to query.

type of exterior_angle: float
exterior_angleThreshold value for the exterior angle (in degrees) used to determine decomposition faces.

type of do_imprint_merge: boolean
do_imprint_mergeIf true, perform imprint and merge operations to support decomposition.

type of tolerant_imprint: boolean
tolerant_imprintIf 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()

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")
get_solutions_for_imprint_merge(surface_id1, surface_id2)
Suggests remedies for imprint/merge when two overlapping surfaces are on different volumes.
Definition cubit.py:17735

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_id1ID of the first overlapping surface (must be on a different volume than surface_id2).

type of surface_id2: int
surface_id2ID 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()

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")
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.
Definition cubit.py:17626

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_idID of the vertex that is nearly coincident with the curve (must be on a different volume).

type of curve_id: int
curve_idID 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()

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")
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.
Definition cubit.py:17682

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_idID of the vertex that is nearly coincident with the surface (must be on a different volume).

type of surface_id: int
surface_idID 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()

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")
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 misalignm...
Definition cubit.py:17382

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_1ID of the first vertex (on volume 1).

type of vertex_id_2: int
vertex_id_2ID 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()

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")
get_solutions_for_overlapping_surfaces(surface_id_1, surface_id_2)
Suggests remedies for two overlapping surfaces on different volumes.
Definition cubit.py:17518

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_1ID of the first overlapping surface (must be on a different volume than surface_id_2).

type of surface_id_2: int
surface_id_2ID 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()

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")
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.
Definition cubit.py:17465

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_1ID of the first volume.

type of volume_id_2: int
volume_id_2ID of the second volume.

type of maximum_gap_tolerance: float
maximum_gap_toleranceMaximum allowed gap before volumes are considered overlapping.

type of maximum_gap_angle: float
maximum_gap_angleMaximum 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_protrusion_surface()

get_solutions_for_protrusion_surface ( surface_id)

Provide possible protrusion removal or adjustment solutions for a given surface (and its protrusion if applicable).

Given a surface ID, this function returns possible solutions for removing or adjusting protrusion geometry on that surface. If the surface is part of a protrusion, the solutions will include operations for the entire protrusion group as well.

.. code-block:: python
cubit.cmd("brick x 10")
cubit.cmd("brick x 5")
cubit.cmd("vol 5 move x 5")
cubit.cmd("unite volume 1 2")
# Get protrusion removal solutions for surface 12:
surface_id = 12
get_solutions_for_protrusion_surface(surface_id)
Provide possible protrusion removal or adjustment solutions for a given surface (and its protrusion i...
Definition cubit.py:18742

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 Protrusion at Surface 12
# Command: remove surface 12 protrusion
# Preview: remove surface 12 protrusion preview



type of surface_id: int

Parameters
surface_idThe surface being queried. If part of a protrusion, solutions will include the full protrusion group.

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 protrusion solution, [1] Cubit command strings to apply each protrusion solution, [2] Cubit preview command strings.

◆ get_solutions_for_sharp_angle_vertex()

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)
get_solutions_for_sharp_angle_vertex(vertex_id, small_curve_size, mesh_size)
Retrieve recommended remedies for a sharp angle at a vertex.
Definition cubit.py:18414

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_idID of the vertex with the sharp angle being queried.

type of small_curve_size: float
small_curve_sizeThreshold that defines what is considered a "small" curve.

type of mesh_size: float
mesh_sizeElement 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()

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
get_solutions_for_sheet_volume_connection(*args, **kwargs)
Propose surface-tweak, imprint, and merge operations to bridge two sheet-volume sets.
Definition cubit.py:18175
 @n type of vol1_sheets:  std::vector< int,std::allocator< int > >
Parameters
vol1_sheetsIDs of the first sheet-volume set (common parent).

type of vol2_sheets: std::vector< int,std::allocator< int > >
vol2_sheetsIDs of the second sheet-volume set (common parent).

type of thickness1: float
thickness1Thickness of sheets in vol1_sheets.

type of thickness2: float
thickness2Thickness of sheets in vol2_sheets.

type of close_type: string, optional
close_typeOptional entity type to focus near (e.g., "curve"). Default = "".

type of close_id: int, optional
close_idOptional 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()

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)
get_solutions_for_sheet_volumes(vol_ids, thickness)
Propose surface-extension and imprint/merge operations to connect sheet bodies.
Definition cubit.py:18117

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_idsIDs of the sheet bodies to connect.

type of thickness: std::vector< double,std::allocator< double > >
thicknessCorresponding 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()

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)
get_solutions_for_small_curves(curve_id, small_curve_size, mesh_size)
Recommend remedial operations on a curve already flagged as small.
Definition cubit.py:18353

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_idID of the small curve.

type of small_curve_size: float
small_curve_sizeCurve-length threshold defining "small" features.

type of mesh_size: float
mesh_sizeTarget 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()

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)
get_solutions_for_small_surfaces(surface_id, small_curve_size, mesh_size)
Recommend remedial operations on a surface already flagged as small.
Definition cubit.py:18225

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_idID of the surface to remediate.

type of small_curve_size: float
small_curve_sizeThreshold under which curves are deemed small.

type of mesh_size: float
mesh_sizeTarget 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()

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_idID of the surface to analyze.

type of small_curve_size: float
small_curve_sizeLength threshold defining narrow regions.

type of mesh_size: float
mesh_sizeTarget 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()

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)
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.
Definition cubit.py:18064

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_idID of the thin volume to convert to a sheet.

type of near_vols: std::vector< int,std::allocator< int > >
near_volsList of neighboring volume IDs to limit influence; empty uses all.

type of include_weights: boolean, optional
include_weightsIf true, prepend each operation string with heuristic weight (1=best ... 0=worst).

type of include_type: boolean, optional
include_typeIf 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()

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)
get_solutions_for_volumes(vol_id, small_curve_size, mesh_size)
Recommend remediation operations for volumes with features below a size threshold.
Definition cubit.py:17785

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_idID of the volume to inspect.

type of small_curve_size: float
small_curve_sizeMaximum curve length considered "small".

type of mesh_size: float
mesh_sizeTarget 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()

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)
get_source_surfaces(volume_id)
Retrieve the list of sweep source surfaces for a specified volume.
Definition cubit.py:11296
 @n type of volume_id:  int
Parameters
volume_idID 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()

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)
get_sphere_count()
Retrieve the count of sphere elements in the current model.
Definition cubit.py:9608
 @n return type of :  int
Returns
Number of sphere elements (nodes flagged as "sphere") in the current model.

◆ get_sphere_global_element_id()

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
get_sphere_global_element_id(sphere_id)
Get the Global Element ID for a specific node (SPHERE element).
Definition cubit.py:14471
 @n type of sphere_id:  int
Parameters
sphere_idLocal 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()

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
variableName of the sculpt parameter substring.

return type of : string
Returns
Default string value for the specified parameter.

◆ get_sub_elements()

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)
get_sub_elements(entity_type, entity_id, dimension)
Get the lower-dimensional entities of a higher-dimensional mesh element.
Definition cubit.py:13917
 @n type of entity_type:  string
Parameters
entity_typeMesh element type of the higher-dimensional entity (e.g., "hex", "tet", "tri", "quad").

type of entity_id: int
entity_idID of the mesh element.

type of dimension: int
dimensionDimension 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()

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_idID 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()

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
get_surface_area(surface_id)
Get the area of a specified surface.
Definition cubit.py:12292
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : float
Returns
The area of the specified surface.

◆ get_surface_cavity_collections()

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)
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.
Definition cubit.py:15983

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_listList of volume IDs to query.

type of area_threshold: float, optional
area_thresholdReturn 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_toleranceBounding 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_cavitiesIf 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()

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)
get_surface_centroid(surface_id)
Get the approximate centroid of a specified surface based on graphics faceting.
Definition cubit.py:12211
 @n type of surface_id:  int
Parameters
surface_idID 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()

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 blind hole with a conical end
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 3 mov z 3')
cubit.cmd('unite vol 2 3')
cubit.cmd('vol 2 mov z -3')
cubit.cmd('subtract vol 2 from vol 1')
# Split the cone surface into two mirrored surfaces
cubit.cmd('split period vol 1')
cone_collections = cubit.get_surface_cone_collections([1], 0.0)
print("Cone collections:")
get_surface_cone_collections(volume_list, radius_threshold=0.0)
Identify collections of surfaces that comprise cones in specified volumes.
Definition cubit.py:15777

for surfaces, radius in cone_collections: print("Radius:", radius, "Surfaces:", [int(sid) for sid in surfaces])

# Expected output:
# Radius: <value>, Surfaces: [12, 13]



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

Parameters
volume_listList of volume IDs to query.

type of radius_threshold: float, optional
radius_thresholdOptional 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()

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)
get_surface_count()
Get the current number of surfaces in the model.
Definition cubit.py:10530
 @n return type of :  int
Returns
The number of surfaces currently defined in the model.

◆ get_surface_element_count()

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)
get_surface_element_count(surface_id)
Retrieve the count of elements on a specified surface.
Definition cubit.py:9745
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : int
Returns
Number of quadrilateral and triangular elements on that surface.

◆ get_surface_hole_collections()

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)
get_surface_hole_collections(volume_list, radius_threshold)
Return collections of surfaces that form holes in the specified volumes.
Definition cubit.py:16163

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_listList of volume IDs to query.

type of radius_threshold: float
radius_thresholdReturn 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_curves()

get_surface_loop_curves ( surface_id)

Get the curve IDs for each loop on a surface.

This function returns the boundary curves for each closed loop on the specified surface. Each loop is represented as an ordered list of curve (RefEdge) IDs that form a closed boundary. Surfaces with holes or internal boundaries will have multiple loops.

If the surface ID is invalid, an error is printed and an empty list is returned.

.. 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 loop curves on surface 1
print(f"Surface 11 has {len(loops)} loop(s).")
get_surface_loop_curves(surface_id)
Get the curve IDs for each loop on a surface.
Definition cubit.py:13585

for i, loop in enumerate(loops): print(" loop %d curves: %s" % (i, " ".join(str(c) for c in loop)))

@n type of surface_id:  int
Parameters
surface_idID 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 loops on the surface; each loop is a list of curve IDs. Returns an empty list on error.

◆ get_surface_loop_nodes()

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
print(f"Surface 1 has {len(loop_nodes)} loop(s).")
get_surface_loop_nodes(surface_id)
Get the ordered list of node IDs on the loops of a surface.
Definition cubit.py:13627

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_idID 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()

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).")
get_surface_nodes(surface_id)
Get the list of node IDs owned by a surface.
Definition cubit.py:13275

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

  @n type of surface_id:  int
Parameters
surface_idID 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()

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)
get_surface_normal(surface_id)
Get the unit normal vector at the center of a specified surface.
Definition cubit.py:12135
 @n type of surface_id:  int
Parameters
surface_idID 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()

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)
print("Normal:", normal) # Expected output: (0.0, 0.0, 1.0)
get_surface_normal_at_coord(surface_id, coord)
Get the unit normal vector at a specified point on a surface.
Definition cubit.py:12165
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

type of coord: std::array< double,3 >
coordA 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()

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
print(f"Surface 1 has {num_loops} loop(s).")
get_surface_num_loops(surface_id)
Get the number of loops on a surface.
Definition cubit.py:13548
 @n type of surface_id:  int
Parameters
surface_idID of the surface.

return type of : int
Returns
Number of loops on the surface.

◆ get_surface_position_from_u_v()

get_surface_position_from_u_v ( surface_id,
u,
v )

Get the XYZ position for a specified surface at the given parametric (u, v) :type surface_id: int.

Parameters
surface_idID of the surface :type u: float
uparametric u coordinate :type v: float
vparametric v coordinate :rtype: std::array< double,3 >
Returns
surface position at parametric (u, v)

◆ get_surface_principal_curvatures()

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)
get_surface_principal_curvatures(surface_id)
Get the principal curvatures of a surface at its midpoint.
Definition cubit.py:12359
 @n type of surface_id:  int
Parameters
surface_idID 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_protrusion_collections()

get_surface_protrusion_collections ( volume_list,
area_threshold = -1,
angle_tolerance = -1,
combine_protrusions = True )

Return collections of surfaces that form protrusions in the specified volumes.

A protrusion is a collection of contiguous surfaces, bounded by curves where the exterior angle is greater than or equal to (180 + angle_tolerance). Protrusions are filtered by their total surface area.

If combine_protrusions is true, small adjacent protrusions are merged after initial detection.

If area_threshold < 0.0, all protrusions 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("unite volume 1 2")
volume_ids = [1]
area_thresh = -1.0 # return all protrusions
angle_tol_deg = 0.1
combine = False
protrusion_collections = cubit.get_surface_protrusion_collections(volume_ids, area_thresh, angle_tol_deg, combine)
get_surface_protrusion_collections(volume_list, area_threshold=-1, angle_tolerance=-1, combine_protrusions=True)
Return collections of surfaces that form protrusions in the specified volumes.
Definition cubit.py:16040

for surfaces, area in protrusion_collections: print("Protrusion surfaces:", tuple(surfaces), "Area:", area)

# Expected output:
# Protrusion surfaces: (17, 19, 20, 21, 22, 23), Area: <value>



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

Parameters
volume_listList of volume IDs to query.

type of area_threshold: float, optional
area_thresholdReturn protrusions whose total surface area is less than this value. If less than 0.0, return all protrusions.

type of angle_tolerance: float, optional
angle_toleranceBounding curves must 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_protrusions: boolean, optional
combine_protrusionsIf true, small adjacent protrusions are combined after initial 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 protrusion, and (2) the total surface area of that protrusion (ordered from smallest to largest area).

◆ get_surface_quads()

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
print(f"Surface 1 contains {len(quad_ids)} quad(s).")
get_surface_quads(surface_id)
Get the list of quadrilateral (quad) element IDs on a surface.
Definition cubit.py:13307

for quad_id in quad_ids: print(f" Quad ID: {quad_id}")

  @n type of surface_id:  int
Parameters
surface_idID 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()

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)
get_surface_sense(surface_id)
Get the orientation ("sense") of a specified surface.
Definition cubit.py:12235
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : string
Returns
: The surface sense "Reversed", "Forward", or "Both".

◆ get_surface_tris()

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
print(f"Surface 1 contains {len(tri_ids)} tri(s).")
get_surface_tris(surface_id)
Get the list of triangle (tri) element IDs on a surface.
Definition cubit.py:13340

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

  @n type of surface_id:  int
Parameters
surface_idID 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()

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
get_surface_type(surface_id)
Get the surface type for a specified surface.
Definition cubit.py:12108
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : string
Returns
Descriptive string indicating the surface's geometry type.

◆ get_surfs_with_narrow_regions()

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)
get_surfs_with_narrow_regions(target_ids, narrow_size)
Find surfaces with narrow regions based on edge-pair orientation and proximity.
Definition cubit.py:15095
 @n type of target_ids:  std::vector< int,std::allocator< int > >
Parameters
target_idsVector of volume IDs to examine.

type of narrow_size: float
narrow_sizeDistance 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()

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_idsVector of volume IDs to examine.

type of upper_bound: float
upper_boundUpper threshold for acceptable tangential angle.

type of lower_bound: float
lower_boundLower 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()

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)
get_target_surfaces(volume_id)
Retrieve the list of sweep target surfaces for a specified volume.
Definition cubit.py:11331
 @n type of volume_id:  int
Parameters
volume_idID 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()

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
get_target_timestep()
Return the current target time step threshold used in the density multiplier metric.
Definition cubit.py:10196
 @n return type of :  float
Returns
The currently configured target time step threshold.

◆ get_tet_count()

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)
get_tet_count()
Retrieve the count of tetrahedral elements in the current model.
Definition cubit.py:9504
 @n return type of :  int
Returns
Number of tetrahedral elements in the current model.

◆ get_tet_global_element_id()

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)
get_tet_global_element_id(tet_id)
Get the Global Element ID for a specific tetrahedral element.
Definition cubit.py:14251
 @n type of tet_id:  int
Parameters
tet_idLocal 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()

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
get_tetmesh_growth_factor(volume_id)
Get the growth factor for tet meshing on a volume.
Definition cubit.py:7863
 @n type of volume_id:  int
Parameters
volume_idID of the volume to query.

return type of : float
Returns
Growth factor (double) currently set on the volume.

◆ get_tetmesh_insert_mid_nodes()

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}")
get_tetmesh_insert_mid_nodes()
Get the global flag indicating insertion of mid-edge (quadratic) nodes during tet meshing.
Definition cubit.py:7976
 @n return type of :  boolean
Returns
True if mid-edge nodes are inserted during meshing; false otherwise.

◆ get_tetmesh_minimize_interior_points()

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}")
get_tetmesh_minimize_interior_points()
Get the global flag indicating minimization of interior points in tet meshing.
Definition cubit.py:8117
 @n return type of :  boolean
Returns
True if minimizing interior points is ON; false otherwise.

◆ get_tetmesh_minimize_slivers()

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}")
get_tetmesh_minimize_slivers()
Get the global flag indicating minimization of sliver tetrahedra.
Definition cubit.py:8088
 @n return type of :  boolean
Returns
True if sliver minimization is ON; false otherwise.

◆ get_tetmesh_num_anisotropic_layers()

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
get_tetmesh_num_anisotropic_layers()
Get the global number of anisotropic tet layers setting.
Definition cubit.py:7920
 @n return type of :  int
Returns
Number of anisotropic layers (integer); 0 if disabled.

◆ get_tetmesh_optimization_level()

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
get_tetmesh_optimization_level()
Get the global tet meshing optimization level.
Definition cubit.py:7948
 @n return type of :  int
Returns
Optimization level (int in [0..6]).

◆ get_tetmesh_optimize_mid_nodes()

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}")
get_tetmesh_optimize_mid_nodes()
Get the global flag indicating optimization of mid-edge nodes during tet meshing.
Definition cubit.py:8004
 @n return type of :  boolean
Returns
True if mid-edge node optimization is ON; false otherwise.

◆ get_tetmesh_optimize_overconstrained_edges()

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}")
get_tetmesh_optimize_overconstrained_edges()
Get the global flag indicating optimization of overconstrained edges.
Definition cubit.py:8060
 @n return type of :  boolean
Returns
True if overconstrained edges optimization is ON; false otherwise.

◆ get_tetmesh_optimize_overconstrained_tets()

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}")
get_tetmesh_optimize_overconstrained_tets()
Get the global flag indicating optimization of overconstrained tetrahedra.
Definition cubit.py:8032
 @n return type of :  boolean
Returns
True if overconstrained tetrahedra optimization is ON; false otherwise.

◆ get_tetmesh_parallel()

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.
print(f"Parallel tet mesher enabled? {parallel_on}")
get_tetmesh_parallel()
Get the global parallel-tetmesher flag (HPC) setting.
Definition cubit.py:7892
 @n return type of :  boolean
Returns
True if parallel (HPC) tet mesher is ON; false if OFF.

◆ get_tetmesh_proximity_flag()

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}")
get_tetmesh_proximity_flag(volume_id)
Get the proximity-layer flag for tet meshing on a volume.
Definition cubit.py:7802
 @n type of volume_id:  int
Parameters
volume_idID of the volume to query.

return type of : boolean
Returns
True if proximity layers are ON; false if OFF.

◆ get_tetmesh_proximity_layers()

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
get_tetmesh_proximity_layers(volume_id)
Get the number of proximity layers for tet meshing on a volume.
Definition cubit.py:7832
 @n type of volume_id:  int
Parameters
volume_idID 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()

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}")
get_tetmesh_relax_surface_constraints()
Get the global flag indicating relaxation of surface mesh constraints in tet meshing.
Definition cubit.py:8145
 @n return type of :  boolean
Returns
True if relaxing surface constraints is ON; false otherwise.

◆ get_tight_bounding_box()

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)
get_tight_bounding_box(geometry_type, entity_list)
Get the tight bounding box for a list of entities.
Definition cubit.py:12745
 @n type of geometry_type:  string
Parameters
geometry_typeGeometry type ("body", "volume", "surface", "curve", or "vertex").

type of entity_list: std::vector< int,std::allocator< int > >
entity_listList of entity IDs.

return type of : std:: array< double,15 >
Returns
15-element array representing the tight bounding box.

◆ get_top_level_assembly_items()

get_top_level_assembly_items ( )

◆ get_total_bounding_box()

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
get_total_bounding_box(geometry_type, entity_list)
Get the combined bounding box for a list of entities.
Definition cubit.py:12705
 @n type of geometry_type:  string
Parameters
geometry_typeSpecifies the geometry type ("body", "volume", "surface", "curve", or "vertex").

type of entity_list: std::vector< int,std::allocator< int > >
entity_listList 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()

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)
get_total_volume(volume_list)
Get the total volume for a list of volumes.
Definition cubit.py:12770
 @n type of volume_list:  std::vector< int,std::allocator< int > >
Parameters
volume_listList of volume IDs to include.

return type of : float
Returns
The sum of the volumes for all specified IDs.

◆ get_tri_count()

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)
get_tri_count()
Retrieve the count of triangular elements in the current model.
Definition cubit.py:9556
 @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()

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)
get_tri_global_element_id(tri_id)
Get the Global Element ID for a specific triangular element.
Definition cubit.py:14367
 @n type of tri_id:  int
Parameters
tri_idLocal 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_anisotropic_ratio()

get_trimesh_anisotropic_ratio ( )

Get the global setting for trimesher coarse anisotropic ratio :rtype: float.

Returns
value of anisotropic ratio (length:width)

◆ get_trimesh_coarse_deviation_angle()

get_trimesh_coarse_deviation_angle ( )

Get the global setting for trimesher coarse mesh geometric approximation angle :rtype: float.

Returns
deviation angle (degrees) used for the coarse mesh

◆ get_trimesh_coarse_mesh_toggle()

get_trimesh_coarse_mesh_toggle ( )

Get the global setting for trimesher coarse mesh :rtype: boolean.

Returns
true if trimesher is set to generate a coarse mesh

◆ get_trimesh_geometry_sizing()

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
get_trimesh_geometry_sizing()
Retrieve the global geometry sizing flag for the TriMesh scheme.
Definition cubit.py:8347
 @n return type of :  boolean
Returns
True if TriMesh geometry sizing is ON; false otherwise.

◆ get_trimesh_num_anisotropic_layers()

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
get_trimesh_num_anisotropic_layers()
Retrieve the global number of anisotropic triangle layers for the TriMesh scheme.
Definition cubit.py:8375
 @n return type of :  int
Returns
Number of anisotropic layers (int); 0 if disabled.

◆ get_trimesh_ridge_angle()

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
get_trimesh_ridge_angle()
Retrieve the global ridge angle for the TriMesh scheme.
Definition cubit.py:8480
 @n return type of :  float
Returns
Ridge angle in degrees (double).

◆ get_trimesh_split_overconstrained_edges()

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
get_trimesh_split_overconstrained_edges()
Retrieve the global flag for splitting overconstrained edges in the TriMesh scheme.
Definition cubit.py:8403
 @n return type of :  boolean
Returns
True if splitting overconstrained edges is ON; false otherwise.

◆ get_trimesh_surface_gradation()

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
get_trimesh_surface_gradation()
Retrieve the global surface mesh gradation for the TriMesh scheme.
Definition cubit.py:8206
 @n return type of :  float
Returns
Global surface gradation value (double).

◆ get_trimesh_surface_proximity_ratio()

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
get_trimesh_surface_proximity_ratio()
Retrieve the global surface proximity ratio for the TriMesh scheme.
Definition cubit.py:8288
 @n return type of :  float
Returns
Global surface proximity ratio (double).

◆ get_trimesh_target_min_size()

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
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.
Definition cubit.py:8319
Parameters
geom_typeGeometry type of the entity ("curve", "surface", or "volume").

type of entity_id: int
entity_idID 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()

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
get_trimesh_tiny_edge_length()
Retrieve the global tiny edge length for the TriMesh scheme.
Definition cubit.py:8452
 @n return type of :  float
Returns
Global tiny edge length value (double).

◆ get_trimesh_use_surface_proximity()

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
get_trimesh_use_surface_proximity()
Retrieve the global surface proximity flag for the TriMesh scheme.
Definition cubit.py:8261
 @n return type of :  boolean
Returns
True if global surface proximity is ON; false if OFF.

◆ get_trimesh_volume_gradation()

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
get_trimesh_volume_gradation()
Retrieve the global volume mesh gradation for the TriMesh scheme.
Definition cubit.py:8234
 @n return type of :  float
Returns
Global volume gradation value (double).

◆ get_u_v_from_surface_position()

get_u_v_from_surface_position ( surface_id,
position )

Get the parametric location u, v of a given point on the surface :type surface_id: int.

Parameters
surface_idID of the surface :type position: std::array< double,3 >
positionof point on the surface :rtype: std::array< double,2 >
Returns
parametric u,v of the surface. Returns {-CUBIT_DBL_MAX, -CUBIT_DBL_MAX} if the underlying inverse evaluation fails.

◆ get_undo_enabled()

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)
get_undo_enabled()
Query whether undo is currently enabled.
Definition cubit.py:4879
 @n return type of :  boolean
Returns
True if undo is enabled; otherwise false.

◆ get_unmerged_curves_on_shells()

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:")
get_unmerged_curves_on_shells(shell_vols, thickness)
Identify unmerged curves between sheet (shell) volumes for use in shell construction workflows.
Definition cubit.py:17096

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_volsList of volume IDs to check. Only sheet (shell) volumes will be processed.

type of thickness: std::vector< double,std::allocator< double > >
thicknessList 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()

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")
print("Valence of vertex 1:", val) # prints 3
get_valence(vertex_id)
Get the valence (number of incident edges) for a specific vertex.
Definition cubit.py:10827
 @n type of vertex_id:  int
Parameters
vertex_idID 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()

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")
get_valid_block_element_types(block_id)
Get a list of valid element types for the specified block.
Definition cubit.py:20026

for t in valid_types: print(t)

  @n type of block_id:  int
Parameters
block_idID 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()

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_idID of the velocity boundary condition.

return type of : string
Returns
Combine type string for the given velocity BC.

◆ get_version()

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)
get_version()
Retrieve the current Cubit version string.
Definition cubit.py:4331
 @n return type of :  string
Returns
A string containing the current Cubit version.

◆ get_vertex_coordinates()

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}")
get_vertex_coordinates(entityID)
Get the 3D coordinates of a vertex.
Definition cubit.py:11698
Parameters
entity_idID 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()

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)
get_vertex_count()
Get the current number of vertices in the model.
Definition cubit.py:10576
 @n return type of :  int
Returns
The number of vertices currently defined in the model.

◆ get_vertex_node()

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
print(f"Vertex 1 owns node ID: {node_id}")
get_vertex_node(vertex_id)
Get the node ID owned by a vertex.
Definition cubit.py:13177
 @n type of vertex_id:  int
Parameters
vertex_idID 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()

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)
get_vertex_type(surface_id, vertex_id)
Retrieve the vertex type for a given vertex on a surface.
Definition cubit.py:7096
 @n type of surface_id:  int
Parameters
surface_idID of the surface containing the vertex.

type of vertex_id: int
vertex_idID of the vertex to query.

return type of : string
Returns
: The vertex type "end", "side", "corner", "reverse", or "unknown".

◆ get_view_at()

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)
get_view_at()
Get the camera's current "at" (target) point.
Definition cubit.py:5969
 @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()

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)
get_view_distance()
Get the camera's distance between its position and focus point.
Definition cubit.py:5935
 @n return type of :  float
Returns
Distance (double) between the camera position ("from") and its focus point ("at").

◆ get_view_from()

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)
get_view_from()
Get the camera's current 'from' (position) point.
Definition cubit.py:6003
 @n return type of : std:: array< double,3 >
Returns
Array of three doubles {x, y, z} representing the camera's position.

◆ get_view_up()

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)
get_view_up()
Get the camera's 'up' direction vector.
Definition cubit.py:6037
 @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()

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
get_volume_area(volume_id)
Get the total surface area of a specified volume.
Definition cubit.py:12531
 @n type of volume_id:  int
Parameters
volume_idID of the volume to query.

return type of : float
Returns
Total surface area of the specified volume.

◆ get_volume_cad_material()

get_volume_cad_material ( volume_id)

◆ get_volume_count()

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)
get_volume_count()
Get the current number of volumes in the model.
Definition cubit.py:10507
 @n return type of :  int
Returns
The number of volumes currently defined in the model.

◆ get_volume_element_count()

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)
get_volume_element_count(volume_id)
Retrieve the count of 3D elements in a specified volume.
Definition cubit.py:9717
 @n type of volume_id:  int
Parameters
volume_idID 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()

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
get_volume_gap_solutions(surface_id_1, surface_id_2)
Suggests remedies for a gap between two surfaces on different volumes.
Definition cubit.py:17570

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_1ID 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_2ID 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()

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
print(f"Volume 1 contains {len(hex_ids)} hex(s).")
get_volume_hexes(volume_id)
Get the list of hexahedron (hex) IDs contained in a volume.
Definition cubit.py:13406

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

  @n type of volume_id:  int
Parameters
volume_idID 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()

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).")
get_volume_nodes(volume_id)
Get the list of node IDs owned by a volume.
Definition cubit.py:13374

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

  @n type of volume_id:  int
Parameters
volume_idID 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()

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).")
get_volume_pyramids(volume_id)
Get the list of pyramid IDs contained in a volume.
Definition cubit.py:13515

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

  @n type of volume_id:  int
Parameters
volume_idID 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()

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
print(f"Volume 1 contains {len(tet_ids)} tet(s).")
get_volume_tets(volume_id)
Get the list of tetrahedron (tet) IDs contained in a volume.
Definition cubit.py:13439

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

  @n type of volume_id:  int
Parameters
volume_idID 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()

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
get_volume_volume(vol_id)
Get the enclosed volume of a specified volume.
Definition cubit.py:12556
 @n type of vol_id:  int
Parameters
vol_idID of the volume to query.

return type of : float
Returns
The enclosed volume of the specified volume.

◆ get_volume_wedges()

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
print(f"Volume 1 contains {len(wedge_ids)} wedge(s).")
get_volume_wedges(volume_id)
Get the list of wedge IDs contained in a volume.
Definition cubit.py:13476

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

  @n type of volume_id:  int
Parameters
volume_idID 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()

get_volumes_for_node ( node_name,
node_instance )

◆ get_wedge_count()

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)
get_wedge_count()
Retrieve the count of wedge-shaped elements in the current model.
Definition cubit.py:9633
 @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()

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)
get_wedge_global_element_id(wedge_id)
Get the Global Element ID for a specific wedge element.
Definition cubit.py:14290
 @n type of wedge_id:  int
Parameters
wedge_idLocal 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()

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}")
get_wrt_entity(source_type, source_id, sideset_id)
Get the 'with-respect-to' entity of an item in a sideset.
Definition cubit.py:13691
 @n type of source_type:  string
Parameters
source_typeItem type: "face", "quad", or "tri".

type of source_id: int
source_idID of the entity.

type of sideset_id: int
sideset_idID of the sideset.

return type of : string
Returns
'With-respect-to' entity of the specified entity in the sideset.

◆ graphics_enabled()

graphics_enabled ( )

Used to check if a GUI graphics window is enabled.

◆ group_names_ids()

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.
group_names_ids()
Retrieve names and IDs of all defined groups (excluding the pick group).
Definition cubit.py:22141

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()

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'}")
has_valid_size(geometry_type, entity_id)
Check whether a geometric entity has a valid size.
Definition cubit.py:8870
 @n type of geometry_type:  string
Parameters
geometry_typeType of the geometric entity (e.g. "surface", "curve", "volume", etc.).

type of entity_id: int
entity_idID 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()

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_enumCI_BCEntityTypes: 7 (top), 8 (bottom).

type of entity_id: int
entity_idID of the heatflux BC.

return type of : boolean
Returns
True if the BC is applied to the specified shell area.

◆ highlight()

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)
highlight(entity_type, entity_id)
Highlight the given entity in the graphics window without selecting it.
Definition cubit.py:6562
 @n type of entity_type:  string
Parameters
entity_typeEntity type to highlight ("vertex", "curve", "surface", or "volume").

type of entity_id: int
entity_idID of the entity to highlight.

◆ init()

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



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

Parameters
argvList of startup directives for Cubit (e.g., command-line flags). Use {""} for defaults.

◆ is_acis_engine_available()

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)
is_acis_engine_available()
Determine whether the ACIS geometry engine is available.
Definition cubit.py:4619
 @n return type of :  boolean
Returns
True if ACIS support is present; otherwise false.

◆ is_assembly_metadata_attached()

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_idID of the volume.

return type of : boolean
Returns
True if metadata exists, false otherwise.

◆ is_blend_surface()

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.
print("Surface 7 is blend:", is_blend)
is_blend_surface(surface_id)
Determine if a face's underlying surface is a blend (fillet).
Definition cubit.py:15453
 @n type of surface_id:  int
Parameters
surface_idID 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()

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_idBoundary layer ID to check.

return type of : boolean
Returns
True if ID is available, false if already in use.

◆ is_catia_engine_available()

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)
is_catia_engine_available()
Determine whether the CATIA geometry engine is available.
Definition cubit.py:4596
 @n return type of :  boolean
Returns
True if CATIA support is compiled in; otherwise false.

◆ is_cavity_surface()

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.
is_cavity_surface(surface_id)
Return whether the specified surface is part of a cavity.
Definition cubit.py:15815
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : boolean
Returns
True if the surface is part of a cavity, false otherwise.

◆ is_chamfer_surface()

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)
is_chamfer_surface(surface_id, thickness_threshold)
Determine if a face's underlying surface is a chamfer.
Definition cubit.py:15300
 @n type of surface_id:  int
Parameters
surface_idID of the surface to check.

type of thickness_threshold: float
thickness_thresholdMax thickness to qualify as chamfer.

return type of : boolean
Returns
True if the surface thickness <= thickness_threshold, indicating a chamfer.

◆ is_clipping_plane_manipulation_on()

is_clipping_plane_manipulation_on ( )

Get the current clipping plane manipulation status :rtype: boolean.

Returns
True if clipping manipluation is on, otherwise false

◆ is_clipping_plane_on()

is_clipping_plane_on ( )

Get the current clipping plane status :rtype: boolean.

Returns
True if clipping is on, otherwise false

◆ is_close_loop_surface()

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
is_close_loop_surface(surface_id, mesh_size)
Check if a surface has multiple loops closer than a given threshold.
Definition cubit.py:15128
 @n type of surface_id:  int
Parameters
surface_idID of the surface to check.

type of mesh_size: float
mesh_sizeDistance 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()

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
is_command_echoed()
Check whether Cubit echoes commands to the console.
Definition cubit.py:4937
 @n return type of :  boolean
Returns
True if command echoing is enabled; false otherwise.

◆ is_command_journaled()

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
journal_commands(state)
Enable or disable journaling of Cubit commands.
Definition cubit.py:5087

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()

is_cone_surface ( surface_id)

Determine whether a surface is a cone.

Returns whether the specified surface is a conical surface.

Notes This test returns true only for a single, complete cone that includes the apex (hard point). It is not intended to identify cone surfaces after a periodic split.

.. code-block:: python
# Create a cylinder volume with a cone on top.
cubit.cmd('cylinder rad 1 height 5') # Create cylinder (vol 1)
cubit.cmd('create frustum height 1 radius 1 top 0') # Create cone (vol 2)
cubit.cmd('vol 2 mov z 3') # Move cone on top of cylinder
cubit.cmd('unite vol all') # Unite into a single volume (vol 1)
# BEFORE splitting: the cone's lateral surface is surface 4
cone_whole = cubit.is_cone_surface(4)
print("Surface 4 is cone (before split):", cone_whole)
# Now split the periodic cone surface; this creates two periodic pieces, e.g., surfaces 7 and 8
cubit.cmd('split period vol 1')
cone_split_7 = cubit.is_cone_surface(7)
cone_split_8 = cubit.is_cone_surface(8)
print("Surface 7 is cone (after split):", cone_split_7)
print("Surface 8 is cone (after split):", cone_split_8)
# Expected output:
# Surface 4 is cone (before split): True
# Surface 7 is cone (after split): False
# Surface 8 is cone (after split): False
is_cone_surface(surface_id)
Determine whether a surface is a cone.
Definition cubit.py:15646



type of surface_id: int

Parameters
surface_idID of the surface to test.

return type of : boolean
Returns
True if the surface is a complete cone (with apex), false otherwise.

◆ is_continuous_surface()

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
print("Surface 4 has adjacent continuous surfaces:", result)
# Expected output:
# True
is_continuous_surface(surface_id, angle_tol)
Return whether the surface has any adjacent continuous surfaces.
Definition cubit.py:16198
 @n type of surface_id:  int
Parameters
surface_idID of surface to query.

type of angle_tol: float
angle_tolAngle 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()

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
is_cylinder_surface(surface_id)
Determine if a given face's underlying surface is a circular cylinder.
Definition cubit.py:15424
 @n type of surface_id:  int
Parameters
surface_idID of the surface to check.

return type of : boolean
Returns
True if the surface is a cylindrical surface; otherwise false.

◆ is_file_hdf5()

is_file_hdf5 ( filename)

Check whether a file is an HDF5 file.

.. code-block:: python
path = "model.h5m"
is_h5 = cubit.is_file_hdf5(path)
print(path, "is HDF5?", is_h5)
is_file_hdf5(filename)
Check whether a file is an HDF5 file.
Definition cubit.py:5813



type of filename: string

Parameters
filenamePath to the file to test.

return type of : boolean
Returns
True if the file exists and has an HDF5 signature; false otherwise.

◆ is_geometry_visibility_on()

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)
is_geometry_visibility_on()
Check if geometry graphics are visible in the graphics window.
Definition cubit.py:6222
 @n return type of :  boolean
Returns
true if geometry graphics are currently visible; false otherwise.

◆ is_hole_surface()

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.
is_hole_surface(surface_id, radius_threshold)
Return whether the specified surface is part of a hole.
Definition cubit.py:16081
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

type of radius_threshold: float
radius_thresholdMaximum 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()

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.
is_interval_count_odd(surface_id)
Check if any loop on a surface has an odd number of mesh intervals.
Definition cubit.py:9184

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_idID 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()

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_typeThe type of geometry to check. Valid values are "curve", "surface", or "volume".

type of entity_id: int
entity_idThe 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()

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_typeMesh element type (e.g., "node", "edge", "tri", "quad", "tet", "hex").

type of element_id: int
element_idID 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()

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)
is_mesh_visibility_on()
Check if mesh graphics are visible in the graphics window.
Definition cubit.py:6195
 @n return type of :  boolean
Returns
true if mesh graphics are currently visible; false otherwise.

◆ is_meshed()

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_typeGeometry type ("curve", "surface", or "volume").

type of entity_id: int
entity_idID of the entity to check.

return type of : boolean
Returns
True if the specified entity is already meshed; false otherwise.

◆ is_modified()

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)
is_modified()
Check if the model has been modified since import or last save.
Definition cubit.py:4733
 @n return type of :  boolean
Returns
True if the model has been changed by any operation; false otherwise.

◆ is_multi_volume()

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.
is_multi_volume(body_id)
Check if a body contains multiple volumes.
Definition cubit.py:11638

if multi: print("Body 10 has multiple volumes. Splitting...")

cubit.cmd("split body 10")
 @n type of body_id:  int
Parameters
body_idID of the body to query.

return type of : boolean
Returns
True if the body contains more than one volume; otherwise false.

◆ is_narrow_surface()

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)
is_narrow_surface(surface_id, mesh_size)
Determine if any two non-adjacent edges on the surface form a narrow region.
Definition cubit.py:14909
 @n type of surface_id:  int
Parameters
surface_idID of the surface to check.

type of mesh_size: float
mesh_sizeDistance threshold for identifying narrow edge pairs.

return type of : boolean
Returns
True if any qualifying edge pair is found; otherwise false.

◆ is_occlusion_on()

is_occlusion_on ( )

Check if occlusion is enabled.

 Returns true if occlusion is currently active.

.. code-block:: python

is_occlusion_on()
Check if occlusion is enabled.
Definition cubit.py:6141
 @n return type of :  boolean
Returns
true if occlusion (hidden-line removal) is enabled; false otherwise.

◆ is_on_thin_shell()

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_enumBC type (temperature = 4, convection = 7, heatflux = 8).

type of entity_id: int
entity_idID of the boundary condition.

return type of : boolean
Returns
True if BC is on a thin shell element.

◆ is_opencascade_engine_available()

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)
is_opencascade_engine_available()
Determine whether the OpenCASCADE geometry engine is available.
Definition cubit.py:4642
 @n return type of :  boolean
Returns
True if OpenCASCADE support is compiled in; otherwise false.

◆ is_part_of_list()

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'}")
is_part_of_list(target_id, id_list)
Check if an ID is present in a list of IDs.
Definition cubit.py:5634
 @n type of target_id:  int
Parameters
target_idTarget ID to search for.

type of id_list: std::vector< int,std::allocator< int > >
id_listList of IDs.

return type of : boolean
Returns
true if target_id is a member of id_list, otherwise false.

◆ is_performing_undo()

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
is_performing_undo()
Query whether an undo operation is currently being performed.
Definition cubit.py:4826
 @n return type of :  boolean
Returns
True if an undo is in progress; false otherwise.

◆ is_periodic()

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)
is_periodic(geometry_type, entity_id)
Query whether a specified surface or curve is periodic.
Definition cubit.py:12861
Parameters
geom_typeSpecifies the geometry type ("surface" or "curve").

type of entity_id: int
entity_idID of the entity to query.

return type of : boolean
Returns
True if the entity is periodic; otherwise false.

◆ is_perspective_on()

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")
print("Perspective on?", persp_on)
is_perspective_on()
Check if perspective projection is enabled.
Definition cubit.py:6105
 @n return type of :  boolean
Returns
true if perspective projection is enabled; false otherwise.

◆ is_playback_paused()

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
pause_playback()
Pause journal playback immediately.
Definition cubit.py:4119

if cubit.is_playback_paused(): print("Playback is currently paused.")

# Resume playback
resume_playback()
Resume a paused journal playback.
Definition cubit.py:4162
 @n return type of :  boolean
Returns
True if playback is paused; false otherwise.

◆ is_playback_paused_on_error()

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
set_playback_paused_on_error(pause)
Configure whether playback pauses on error.
Definition cubit.py:4061

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()

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)
is_point_contained(geometry_type, entity_id, xyz_point)
Determine if a point is inside, outside, on, or unknown relative to a given entity.
Definition cubit.py:12982
 @n type of geometry_type:  string
Parameters
geometry_typeType of the entity ("volume" or "body").

type of entity_id: int
entity_idID of the entity to test.

type of xyz_point: std::array< double,3 >
xyz_pointA 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_protrusion_surface()

is_protrusion_surface ( surface_id)

Return whether the specified surface is part of a protrusion.

A protrusion surface is a surface that bounds a region of material extending outward from the main geometry.

If the surface is part of a protrusion (such as a boss or raised feature), this function returns true; otherwise, false.

.. code-block:: python
cubit.cmd("brick x 10")
cubit.cmd("brick x 5")
cubit.cmd("vol 2 move x 5")
cubit.cmd("unite volume 1 2")
surf_id = 12
is_protrusion = cubit.is_protrusion_surface(surf_id)
print(f"Surface {surf_id} is {'a protrusion surface' if is_protrusion else 'not a protrusion surface'}")
# Expected output (example):
# Surface 12 is a protrusion surface.
is_protrusion_surface(surface_id)
Return whether the specified surface is part of a protrusion.
Definition cubit.py:15926



type of surface_id: int

Parameters
surface_idID of the surface to query.

return type of : boolean
Returns
True if the surface is part of a protrusion, false otherwise.

◆ is_scale_visibility_on()

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)
is_scale_visibility_on()
Check if the scale annotation is visible in the graphics window.
Definition cubit.py:6168
 @n return type of :  boolean
Returns
true if the scale annotation is currently visible; false otherwise.

◆ is_select_partial_on()

is_select_partial_on ( )

Check if partial selection is enabled.

 @n return type of :  boolean
Returns
true if partial picks are allowed; false otherwise.
.. code-block:: python
import cubit
is_select_partial_on()
Check if partial selection is enabled.
Definition cubit.py:6480

◆ is_sheet_body()

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)
is_sheet_body(volume_id)
Determine if a volume is a sheet body (zero thickness).
Definition cubit.py:11668
 @n type of volume_id:  int
Parameters
volume_idID 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()

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)
is_special_build(build_type)
Check if a special build type is available.
Definition cubit.py:4671
 @n type of build_type:  string
Parameters
build_typeName 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()

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")
print("Surface 17 meshable under 'map'?", can_mesh)
is_surface_meshable(surface_id)
Check if a surface is meshable under the current meshing scheme.
Definition cubit.py:7060
 @n type of surface_id:  int
Parameters
surface_idID of the surface to test.

return type of : boolean
Returns
True if the surface is meshable; false otherwise.

◆ is_surface_planar()

is_surface_planar ( surface_id)

◆ is_surface_planer()

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)
is_surface_planar(surface_id)
Definition cubit.py:12267
 @n type of surface_id:  int
Parameters
surface_idID of the surface to query.

return type of : boolean
Returns
True if the surface is planar; otherwise false.

◆ is_type_filtered()

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)
is_type_filtered(filter_type)
Check if a specific entity type is currently excluded from picking.
Definition cubit.py:6828
 @n type of filter_type:  string
Parameters
filter_typeEntity 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()

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()) # False
set_undo_saved()
Clear the undo-needed flag for the model.
Definition cubit.py:4802
is_undo_save_needed()
Check if the model requires an undo checkpoint save.
Definition cubit.py:4783
 @n return type of :  boolean
Returns
True if the model has changed since last undo save; false otherwise.

◆ is_virtual()

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)
is_virtual(geometry_type, entity_id)
Query whether a specified geometry entity is virtual.
Definition cubit.py:11152
 @n type of geometry_type:  string
Parameters
geometry_typeThe type of geometry ("curve", "surface", "volume", etc.).

type of entity_id: int
entity_idThe ID of the entity to query.

return type of : boolean
Returns
True if the specified entity is virtual; false otherwise.

◆ is_visible()

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_typeThe type of geometry ("curve", "surface", "volume", etc.).

type of entity_id: int
entity_idThe ID of the entity to query.

return type of : boolean
Returns
True if the specified entity is currently visible; false otherwise.

◆ is_volume_meshable()

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")
print("Volume 42 meshable under 'sweep'?", can_mesh)
is_volume_meshable(volume_id)
Check if a volume is meshable under the current meshing scheme.
Definition cubit.py:7031
 @n type of volume_id:  int
Parameters
volume_idID of the volume to test.

return type of : boolean
Returns
True if the volume is meshable; false otherwise.

◆ is_working_dir_set()

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())
is_working_dir_set()
Check if the "-workingdir" option was provided at Cubit startup.
Definition cubit.py:5169
 @n return type of :  boolean
Returns
true if -workingdir was used when launching Cubit; false otherwise.

◆ journal_commands()

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
stateTrue to enable journaling; false to disable it.

◆ load_ML()

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.

@n type of model_type:  string, optional
Parameters
model_typeSpecifies 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()

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)
measure_between_entities(entity_type1, entity_id1, entity_type2, entity_id2)
Returns the shortest distance between two geometry entities and their closest points.
Definition cubit.py:13071
 @n type of entity_type1:  string
Parameters
entity_type1Type of the first geometry entity.

type of entity_id1: int
entity_id1ID of the first geometry entity.

type of entity_type2: string
entity_type2Type of the second geometry entity.

type of entity_id2: int
entity_id2ID 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()

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.

@n type of geom_type:  string
Parameters
geom_typeGeometry 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")
ML_train(geom_type)
Force retraining of the ML classification model for a specific geometry type.
Definition cubit.py:23463

if success: print("Training for surface model started successfully.") else:

print("Failed to trigger training for surface model.")

◆ move()

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)
move(entity, vector, preview=False)
Translates an Entity by a specified vector.
Definition cubit.py:24931
  @n type of entity:  :py:class:`Entity`, in
Parameters
entityThe Entity to translate.

type of vector: std::array< double,3 >, in
vectorThe translation vector (x, y, z).

type of preview: boolean, in, optional
previewIf true, show a preview without applying (default false).

◆ number_undo_commands()

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
number_undo_commands()
Query the number of undoable commands in the stack.
Definition cubit.py:4914
 @n return type of :  int
Returns
The number of commands currently in the undo stack.

◆ parse_cubit_list()

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)
parse_cubit_list(type, entity_list_string)
Parse a Cubit-style entity selection expression into a list of IDs.
Definition cubit.py:5380
 @n type of type:  string
Parameters
typeEntity type string (e.g., "vertex", "curve", "surface", "volume").

type of entity_list_string: string
entity_list_stringFree-form Cubit selection expression.

return type of : std::vector< int,std:: allocator< int > >
Returns
Vector of validated entity IDs matching the expression.

◆ parse_locations()

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))
parse_locations(location_str)
Parse a Cubit location specification into concrete 3D coordinates.
Definition cubit.py:5438
 @n type of location_str:  string
Parameters
location_strCubit 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()

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()

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_cmd_options()
Display Cubit's supported startup options.
Definition cubit.py:4700

◆ print_current_selections()

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

import cubit
print_current_selections()
Print all selected entities and their types.
Definition cubit.py:6931

◆ print_currently_selected_entity()

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

import cubit
print_currently_selected_entity()
Print details of the current selected entity.
Definition cubit.py:6949

◆ print_info()

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.")
print_info(message)
Print a message through Cubit's messaging system.
Definition cubit.py:5329
 @n type of message:  string
Parameters
messageThe text to be printed.

◆ print_raw_help()

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)
print_raw_help(input_line, order_dependent, consecutive_dependent)
Display context-sensitive help while typing commands.
Definition cubit.py:5538
 @n type of input_line:  string
Parameters
input_lineCurrent command-line text being edited.

type of order_dependent: int
order_dependentSet to 1 (true) if the key was '?' or '!'; set to 0 (false) if it was '&'.

type of consecutive_dependent: int
consecutive_dependentSet to 1 (true) if the key was '?' (allows repeated help); otherwise 0 (false).

◆ print_surface_summary_stats()

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_surface_summary_stats()
Print summary statistics for all surfaces in the model.
Definition cubit.py:12504

◆ print_volume_summary_stats()

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.
print_volume_summary_stats()
Print summary statistics for all volumes in the model.
Definition cubit.py:12800

◆ prism()

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())
prism(height, sides, major, minor)
Create a prism of the specified dimensions.
Definition cubit.py:24182
  @n type of height:  float, in
Parameters
heightHeight of the prism.

type of sides: int, in
sidesNumber of sides of the base polygon.

type of major: float, in
majorMajor radius of the base polygon.

type of minor: float, in
minorMinor radius of the base polygon.

return type of : :py:class: Body
Returns
Body object representing the newly created prism geometry.

◆ project_unit_square()

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)
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.
Definition cubit.py:12438

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
ptsA 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_idID of the surface onto which points are projected.

type of quad_id: int
quad_idID of the quad face used to map unit-square coordinates.

type of node00_id: int
node00_idID of the quad node corresponding to (u=0, v=0).

type of node10_id: int
node10_idID 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()

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())
pyramid(height, sides, major, minor, top=0.0)
Create a pyramid of specified dimensions.
Definition cubit.py:24221
  @n type of height:  float, in
Parameters
heightHeight of the pyramid.

type of sides: int, in
sidesNumber of sides of the base polygon.

type of major: float, in
majorMajor radius of the base polygon.

type of minor: float, in
minorMinor radius of the base polygon.

type of top: float, in, optional
topTop 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()

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)
reflect(entity, axis, preview=False)
Reflects an Entity about a specified axis (e.g., plane normal).
Definition cubit.py:25000
  @n type of entity:  :py:class:`Entity`, in
Parameters
entityThe Entity to be reflected.

type of axis: std::array< double,3 >, in
axisThe axis (normal) defining the reflection plane.

type of preview: boolean, in, optional
previewIf true, show a preview without applying (default false).

◆ release_interface()

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
instancePointer to the CubitBaseInterface to release.

return type of : boolean
Returns
True if the interface was successfully released; false otherwise.

◆ remove_entity_from_group()

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"
remove_entity_from_group(group_id, entity_id, entity_type)
Remove a specific entity from a given group.
Definition cubit.py:22041
 @n type of group_id:  int
Parameters
group_idID of the group from which the entity will be removed.

type of entity_id: int
entity_idID of the entity to remove.

type of entity_type: string
entity_typeType of the entity (e.g., "vertex", "curve", "surface", "volume"). Only geometric entities are supported.

return type of : void
Returns
None.

◆ remove_filter_type()

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
remove_filter_type(filter_type)
Remove an entity type from the graphics pick filter.
Definition cubit.py:6802
 @n type of filter_type:  string
Parameters
filter_typeEntity type to remove from the pickable set (e.g., "vertex", "curve", "surface", "volume", "node", "edge", "face").

◆ replace_progress_handler()

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
replace_progress_handler(progress)
Replace the current progress-bar callback handler and return the old one.
Definition cubit.py:3997
 @n type of progress:  :py:class:`CubitProgressHandler`
Parameters
progressShared 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()

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()
Reset Cubit state.
Definition cubit.py:24047

◆ reset_camera()

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
reset_camera()
Reset the camera view and clear auxiliary graphics windows.
Definition cubit.py:6059

◆ resume_playback()

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()

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
scale(entity, factor, preview=False)
Scales an Entity uniformly by a specified factor.
Definition cubit.py:24964
  @n type of entity:  :py:class:`Entity`, in
Parameters
entityThe Entity to scale.

type of factor: float, in
factorThe uniform scale factor.

type of preview: boolean, in, optional
previewIf true, show a preview without applying (default false).

◆ set_copy_block_on_geometry_copy_setting()

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
valDesired 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()

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
valDesired 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()

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
valDesired setting ("ON", "USE_ORIGINAL", or "OFF").

return type of : boolean
Returns
True if setting was successfully applied, false otherwise.

◆ set_cubit_interrupt()

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
set_cubit_interrupt(interrupt)
Enable or disable interruptible operations in Cubit.
Definition cubit.py:4024
 @n type of interrupt:  boolean
Parameters
interruptTrue to stop interruptible processes, false to allow them.

◆ set_cubit_message_handler()

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()
set_cubit_message_handler(hdlr)
Redirect Cubit output to a custom message handler.
Definition cubit.py:3877
 @n type of hdlr:  :py:class:`CubitMessageHandler`
Parameters
hdlrShared pointer to a CubitMessageHandler that will receive messages.

◆ set_element_variable()

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\"")
set_element_variable(element_ids, variable_name, variables)
Sets scalar variables on specified mesh elements for Exodus export.
Definition cubit.py:25070
  @n type of element_ids:  std::vector< int,std::allocator< int > >, in
Parameters
element_idsList of element IDs to assign variables to.

type of variable_name: string, in
variable_nameName of the element variable.

type of variables: std::vector< double,std::allocator< double > >, in
variablesValues for each element (single value applies to all elements).

◆ set_entity_name()

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")
set_entity_name(entity_type, entity_id, new_name)
Set the name of a specified entity.
Definition cubit.py:11471

if success: print("Rename succeeded")

  @n type of entity_type:  string
Parameters
entity_typeType of the entity ("body", "volume", "surface", "curve", or "vertex").

type of entity_id: int
entity_idID of the entity to rename.

type of new_name: string
new_nameThe 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()

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()
set_exit_handler(hdlr)
Set a custom exit callback for Cubit.
Definition cubit.py:3932
 @n type of hdlr:  :py:class:`ExternalExitHandler`
Parameters
hdlrPointer to an ExternalExitHandler implementation that will be called when Cubit exits.

◆ set_filter_types()

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"])
set_filter_types(num_types, filter_types)
Set multiple pick filter types for graphics selections.
Definition cubit.py:6751
 @n type of num_types:  int
Parameters
num_typesNumber of entity types in filter_types.

type of filter_types: std::vector< std::string,std::allocator< std::string > >
filter_typesVector of entity-type strings to enable for picking. Valid values include "vertex", "curve", "surface", "volume", "node", "edge", "face", etc.

◆ set_label_type()

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
set_label_type(entity_type, label_flag)
Sets label display type for a given entity type.
Definition cubit.py:6335
 @n type of entity_type:  string
Parameters
entity_typeEntity type to label.

type of label_flag: int
label_flagLabel display type.
 @n return type of :  void
Returns
None.

◆ set_max_group_id()

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_idThe desired maximum group ID to enforce (must equal Cubit's current max ID).

return type of : void
Returns
None.

◆ set_ML_base_user_dir()

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").

  @n type of path:  string
Parameters
pathTop-level path to the user training data directory.

type of print_info: boolean, optional
print_infoIf true, output status messages about directory setup.
   .. code-block:: python
data_dir = "/path/to/user/training/data"
set_ML_base_user_dir(path, print_info=False)
Set the root directory for user-provided ML training data (classification only).
Definition cubit.py:23808

◆ set_modified()

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_modified()
Reset the model's modified status to "unmodified".
Definition cubit.py:4756

◆ set_nodal_variable()

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)
set_nodal_variable(node_ids, variable_name, variables)
Sets scalar variables on specified mesh nodes.
Definition cubit.py:25033
  @n type of node_ids:  std::vector< int,std::allocator< int > >, in
Parameters
node_idsList of node IDs to assign variables to.

type of variable_name: string, in
variable_nameName of the nodal variable.

type of variables: std::vector< double,std::allocator< double > >, in
variablesValues for each node (single value applies to all nodes).

◆ set_overlap_max_angle()

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)
set_overlap_max_angle(maximum_angle)
Set the maximum angle tolerance for calculating surface overlaps.
Definition cubit.py:16979
 @n type of maximum_angle:  float
Parameters
maximum_angleThe new maximum angle tolerance (in degrees) to use when testing surface overlaps.

◆ set_overlap_max_gap()

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.
print("New overlap max gap:", new_max_gap)
set_overlap_max_gap(maximum_gap)
Set the maximum gap tolerance for calculating surface overlaps.
Definition cubit.py:16863
 @n type of maximum_gap:  float
Parameters
maximum_gapThe new maximum gap tolerance (in model units) to use when testing surface overlaps.

◆ set_overlap_min_gap()

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.
print("New overlap min gap:", new_min_gap)
set_overlap_min_gap(min_gap)
Set the minimum gap tolerance for calculating surface overlaps.
Definition cubit.py:16921
 @n type of min_gap:  float
Parameters
min_gapThe new minimum gap tolerance (in model units) to use when testing surface overlaps.

◆ set_pick_type()

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)
# Change pick mode to volume silently (no confirmation)
cubit.set_pick_type("volume", True)
set_pick_type(pick_type, silent=False)
Set the current pick mode for entity selection.
Definition cubit.py:6722
 @n type of pick_type:  string
Parameters
pick_typeEntity type to pick. Valid values include: "vertex", "curve", "surface", "volume", "node", "edge", "face", etc.

type of silent: boolean, optional
silentIf true, suppress the console message confirming the change. Defaults to false (confirmation printed).

◆ set_playback_paused_on_error()

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
pauseTrue to pause playback on error; false to continue automatically.

◆ set_progress_handler()

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()
set_progress_handler(progress)
Register a progress-bar callback handler with Cubit.
Definition cubit.py:3969



type of progress: :py:class:CubitProgressHandler

Parameters
progressShared pointer to a CubitProgressHandler instance.

◆ set_rendering_mode()

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")
set_rendering_mode(mode)
Set the current graphics rendering mode (equivalent to "Graphics Mode <option>").
Definition cubit.py:6293



type of mode: int

Parameters
modeInteger code for the rendering mode (0-5), corresponding to: 0=WireFrame, 1=HiddenLine, 2=TrueHiddenLine, 3=SmoothShade, 4=Transparent, 5=GeomFacet.

◆ set_undo_saved()

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()

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")
silent_cmd(input_string)
Execute a Cubit command without echoing or verbose output.
Definition cubit.py:5306
 @n type of input_string:  string
Parameters
input_stringC-string containing the complete Cubit command.

return type of : boolean
Returns
true if the command executed successfully; false otherwise.

◆ snap_locations_to_geometry()

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))
snap_locations_to_geometry(locations, entity_type, entity_id, tol)
Snaps given XYZ locations to nearest points on specified entity.
Definition cubit.py:13024
 @n type of locations:  std::vector< std::array< double,3 >,std::allocator< std::array< double,3 > > >
Parameters
locationsA vector of XYZ points to snap.

type of entity_type: string
entity_typeType of entity (e.g., "volume", "surface", "curve").

type of entity_id: int
entity_idID of the target entity.

type of tol: float
tolTolerance 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()

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
sphere(radius, x_cut=0, y_cut=0, z_cut=0, inner_radius=0)
Create all or part of a sphere.
Definition cubit.py:24145
  @n type of radius:  float, in
Parameters
radiusRadius of the sphere.

type of x_cut: int, in, optional
x_cutIf 1, cut sphere by the yz-plane (default = 0).

type of y_cut: int, in, optional
y_cutIf 1, cut sphere by the xz-plane (default = 0).

type of z_cut: int, in, optional
z_cutIf 1, cut sphere by the xy-plane (default = 0).

type of inner_radius: float, in, optional
inner_radiusInner 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()

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

import cubit
step_next_possible_selection()
Advance to the next entity in the current selection list.
Definition cubit.py:6893

◆ step_previous_possible_selection()

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

import cubit
step_previous_possible_selection()
Move back to the previous entity in the current selection list.
Definition cubit.py:6913

◆ stop_playback()

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
stop_playback()
Stop journal playback entirely.
Definition cubit.py:4142

◆ string_from_id_list()

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"
string_from_id_list(ids)
Convert a list of integers into a compact Cubit-style ID string.
Definition cubit.py:5470
 @n type of ids:  std::vector< int,std::allocator< int > >
Parameters
idsVector of integer IDs to format.

return type of : string
Returns
String containing ranges and line breaks at column 80.

◆ subtract()

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
subtract(tool_in, from_in, imprint_in=False, keep_old_in=False)
Performs a boolean subtract operation: removes tool bodies from target bodies.
Definition cubit.py:24860
  @n type of tool_in:  std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
Parameters
tool_inBodies to subtract (tools).

type of from_in: std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
from_inBodies to subtract from (targets).

type of imprint_in: boolean, in, optional
imprint_inTrue to imprint shared geometry (default false).

type of keep_old_in: boolean, in, optional
keep_old_inTrue 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()

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_inID of the surface to retrieve.

return type of : :py:class: Surface
Returns
Surface object corresponding to the specified ID.

◆ sweep_curve()

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
sweep_curve(curves, along_curves, draft_angle, draft_type, rigid)
Sweep one or more curves along a path to create sheet bodies.
Definition cubit.py:24560
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curvesCross-section curves to sweep.

type of along_curves: std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
along_curvesPath curves defining the sweep trajectory.

type of draft_angle: float, in
draft_angleAngle (in degrees) for draft taper (default = 0).

type of draft_type: int, in
draft_typeDraft type: 0=extended, 1=rounded, 2=natural (default = 0).

type of rigid: boolean, in
rigidIf 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()

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_enumBC type (temperature = 4, convection = 7).

type of bc_area_enum: int
bc_area_enumCI_BCEntityTypes: 7 (top), 8 (bottom), 9 (gradient), 10 (middle).

type of entity_id: int
entity_idID of the BC.

return type of : boolean
Returns
True if the temperature BC is on the specified shell area.

◆ temperature_is_on_solid()

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_enumBC type (temperature = 4, convection = 7).

type of entity_id: int
entity_idID of the boundary condition.

return type of : boolean
Returns
True if temperature BC is on a solid.

◆ torus()

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
torus(center_radius, swept_radius)
Create a torus of specified dimensions.
Definition cubit.py:24301
  @n type of center_radius:  float, in
Parameters
center_radiusDistance from torus center to center of swept circle (major radius, must be > swept_radius).

type of swept_radius: float, in
swept_radiusRadius 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()

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
tweak_curve_offset(curves, distances, keep_old=False, preview=False)
2D equivalent of tweak_surface_offset: offsets specified curves on a sheet body.
Definition cubit.py:24779
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curvesList of Curve objects to offset.

type of distances: std::vector< double,std::allocator< double > >, in
distancesList of distances for each curve (in model units).

type of keep_old: boolean, in, optional
keep_oldTrue to retain the original sheet body (default false).

type of preview: boolean, in, optional
previewTrue 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()

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
tweak_curve_remove(curves, keep_old=False, preview=False)
Removes specified curves and extends adjacent surfaces on a sheet body.
Definition cubit.py:24737
  @n type of curves:  std::vector< CubitInterface::Curve,std::allocator< CubitInterface::Curve > >, in
Parameters
curvesList of Curve objects to remove.

type of keep_old: boolean, in, optional
keep_oldTrue to retain the original sheet body (default false).

type of preview: boolean, in, optional
previewTrue 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()

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)
tweak_surface_offset(surfaces, distances)
Offsets specified surfaces by given distances.
Definition cubit.py:24654
@n type of surfaces:  std::vector< CubitInterface::Surface,std::allocator< CubitInterface::Surface > >
Parameters
surfacesList of Surface objects to offset.

type of distances: std::vector< double,std::allocator< double > >
distancesList 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()

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
tweak_surface_remove(surfaces, extend_ajoining=True, keep_old=False, preview=False)
Removes specified surfaces from a body, optionally extending adjacent surfaces.
Definition cubit.py:24696
  @n type of surfaces:  std::vector< CubitInterface::Surface,std::allocator< CubitInterface::Surface > >, in
Parameters
surfacesList of Surface objects to remove.

type of extend_ajoining: boolean, in, optional
extend_ajoiningTrue to extend adjacent surfaces (default true).

type of keep_old: boolean, in, optional
keep_oldTrue to retain the original body (default false).

type of preview: boolean, in, optional
previewTrue 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()

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
tweak_vertex_fillet(verts, radius, keep_old=False, preview=False)
2D sheet vertex chamfer: creates chamfers at specified vertices by offsetting adjacent curves.
Definition cubit.py:24820
vertex(id_in)
Retrieve a vertex object by its ID.
Definition cubit.py:24024
  @n type of verts:  std::vector< CubitInterface::Vertex,std::allocator< CubitInterface::Vertex > >, in
Parameters
vertsList of Vertex objects to chamfer.

type of radius: float, in
radiusChamfer distance (model units).

type of keep_old: boolean, in, optional
keep_oldTrue to retain the original sheet body (default false).

type of preview: boolean, in, optional
previewTrue 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()

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
unite(body_in, keep_old_in=False)
Performs a boolean unite operation: merges specified bodies into one.
Definition cubit.py:24897
  @n type of body_in:  std::vector< CubitInterface::Body,std::allocator< CubitInterface::Body > >, in
Parameters
body_inList of Body objects to unite.

type of keep_old_in: boolean, in, optional
keep_old_inTrue 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()

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.

  @n type of model_type:  string, optional
Parameters
model_typeSpecifies 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()

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)
unselect_entity(entity_type, entity_id)
Unselect an entity that is currently selected.
Definition cubit.py:6434
 @n type of entity_type:  string
Parameters
entity_typeType of the entity ("vertex", "curve", "surface", "volume").

type of entity_id: int
entity_idID of the entity to unselect.

◆ vertex()

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_inID of the vertex to retrieve.

return type of : :py:class: Vertex
Returns
Vertex object corresponding to the specified ID.

◆ volume()

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())
volume(id_in)
Retrieve a volume by its ID.
Definition cubit.py:23939
  @n type of id_in:  int
Parameters
id_inID of the volume to retrieve.

return type of : :py:class: Volume
Returns
Volume object corresponding to the specified ID.

◆ volume_contains_tets()

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)
volume_contains_tets(volume_id)
Determine whether a specified volume contains any tetrahedral elements.
Definition cubit.py:9771
 @n type of volume_id:  int
Parameters
volume_idID of the volume to check.

return type of : boolean
Returns
True if the volume contains any tetrahedral elements; false otherwise.

◆ was_last_cmd_undoable()

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)
was_last_cmd_undoable()
Report whether the last executed command was undoable.
Definition cubit.py:4851
 @n return type of :  boolean
Returns
true if the last command supports undo; false otherwise.

◆ write_to_journal()

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"')
write_to_journal(words)
Append a custom entry to Cubit's journal and recording streams.
Definition cubit.py:5056
 @n type of words:  string
Parameters
wordsText 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

◆ WEDGE12

WEDGE12 = _cubit3.WEDGE12

◆ WEDGE15

WEDGE15 = _cubit3.WEDGE15

◆ WEDGE16

WEDGE16 = _cubit3.WEDGE16

◆ WEDGE20

WEDGE20 = _cubit3.WEDGE20

◆ WEDGE21

WEDGE21 = _cubit3.WEDGE21

◆ WEDGE6

WEDGE6 = _cubit3.WEDGE6