spacer
Sandia Home
Home | Licensing | Tutorials | Documentation | Support | Downloads | Links
 
 
 

Cubit: CubitInterface Namespace Reference

CubitInterface Namespace Reference

This document explains how to access Cubit data from C++ or python. More...


Classes

class  CIObserve
 Classes that need geometry update events need to derive from this class then implement the virtual functions required. ...
class  AssemblyItem
 Class to implement assembly tree interface. ...
class  MershErrorFeedback
 Class to implement mesh command feedback processing. ...

CubitInterface Control - Not Generally Useful

const int CI_ERROR = -1
void init (const std::vector< std::string > &argv)
 Use init to initialize Cubit. Using a blank list as the input parameter is acceptable. param List of start-up directives. See Cubit Help for details.
void process_input_files ()
void destroy ()
bool prepare_next_script_line ()
void copy_next_script_line (std::string &buffer)
void process_next_script_line ()
void set_exit_handler (ExternalExitHandler *hdlr)
void set_playback_handler (ExternalPlaybackHandler *hdlr)
void set_cubit_message_handler (CubitMessageHandler *hdlr)
void set_progress_tool (classProgressTool *progress)

Functions

std::vector
< CubitInterface::AssemblyItem * > 
get_assembly_children (int assembly_id)
std::vector
< CubitInterface::AssemblyItem * > 
get_assembly_items ()
std::vector< int > get_volumes_for_node (std::string node_name, int node_instance)
int get_mesh_error_count ()
std::vector
< CubitInterface::MeshErrorFeedback * > 
get_mesh_errors ()
System Control and Data
bool is_command_echoed ()
 Check the echo flag in cubit.
bool is_command_journaled ()
 Check the journaling flag in cubit.
void cmd (const char *input_string)
 Pass a command string into Cubit.
void silent_cmd (const char *input_string)
 Pass a command string into Cubit and have it executed without being verbose at the command prompt.
std::vector< int > parse_cubit_list (const std::string &type, std::string int_list, bool include_sheet_bodies=false)
 Parse a Cubit style list of IDs (1,2,4 to 19 by 3 or all) into a list of integers.
void print_raw_help (const char *input_line, int order_dependent, int consecutive_dependent)
 Used to print out help when a ?, & or ! is pressed.
int get_error_count ()
 Get the number of errors in the current Cubit session.
bool is_volume_meshable (int volume_id)
 Check if volume is meshable with current scheme.
void set_cubit_interrupt (bool interrupt)
 This sets the global flag in Cubit that stops all interruptable processes.
bool developer_commands_are_enabled ()
 This checks to see whether developer commands are enabled.
std::string get_version ()
 Get the Cubit version.
std::string get_revision_date ()
 Get the Cubit revision date.
std::string get_build_number ()
 Get the Cubit build number.
std::string get_acis_version ()
 Get the Acis version number.
std::string get_exodus_version ()
 Get the Exodus version number.
std::string get_graphics_version ()
 Get the VTK version number.
void print_cmd_options ()
 Used to print the command line options.
bool is_modified ()
 Get the modified status of the model.
void set_modified (bool modified)
 Set the status of the model.
bool is_undo_save_needed ()
 Get the status of the model relative to undo checkpointing.
void set_undo_saved ()
 Set the status of the model relative to undo checkpointin.
std::vector< std::string > get_mesh_error_solutions (int error_code)
 Get the paired list of mesh error solutions and help context cues.
Graphics Manipulation and Data
std::vector< double > get_view_at ()
 Get the camera 'at' point.
std::vector< double > get_view_from ()
 Get the camera 'from' point.
double get_view_distance ()
 Get the distance from the camera to the model (from - at).
void reset_camera ()
 reset the camera in all open windows this includes resetting the view, closing the histogram and color windows and clearing the scalar bar, highlight, and picked entities.
void unselect_entity (const std::string &entity_type, int entity_id)
 Unselect an entity and removed if from the picked list.
bool is_scale_visibility_on ()
 Get the current scale visibility setting.
bool is_perspective_on ()
 Get the current perspective mode.
int get_rendering_mode ()
 Get the current rendering mode.
void set_rendering_mode (int mode)
 Set the current rendering mode.
void clear_preview ()
 Clear preview graphics without affecting other display settings.
int get_pick_type ()
 Get the current pick type.
Mesh Query Support
double get_mesh_edge_length (int edge_id)
 Get the length of a mesh edge.
double get_meshed_volume_or_area (const std::string &geom_type, std::vector< int > entity_ids)
 Get the total volume/area of a entity's mesh.
int get_mesh_intervals (const std::string &geom_type, int entity_id)
 Get the interval count for a specified entity.
std::string get_mesh_scheme (const std::string &geom_type, int entity_id)
 Get the mesh scheme for the specified entity.
std::string get_mesh_scheme_firmness (const std::string &geom_type, int entity_id)
 Get the mesh scheme firmness for the specified entity.
std::string get_mesh_interval_firmness (const std::string &geom_type, int entity_id)
 Get the mesh interval firmness for the specified entity.
std::string get_smooth_scheme (const std::string &geom_type, int entity_id)
 Get the smooth scheme for a specified entity.
double get_mesh_size (const std::string &geom_type, int entity_id)
 Get the mesh size for a specified entity.
double get_auto_size (std::vector< int > volume_id_list, double size)
 Get the auto size for a given set of volumes. Note, this does not actually set the interval size on the volumes. It simply returns the size that would be set if an 'size auto factor n' command were issued.
bool is_meshed (const std::string &geom_type, int entity_id)
 Determines whether a specified entity is meshed.
bool is_merged (const std::string &geom_type, int entity_id)
 Determines whether a specified entity is merged.
int get_volume_element_count (int volume_id)
 Get the count of elements in a volume.
bool volume_contains_tets (int volume_id)
 Determine whether a volume contains tets.
int get_surface_element_count (int surface_id)
 Get the count of elements in a surface.
std::vector< int > get_hex_sheet (int node_id_1, int node_id_2)
 Get the list of hex elements forming a hex sheet through the given two node ids. The nodes must be adjacent in the connectivity of the hex i.e. they form an edge of the hex.
int get_hex_count ()
 Get the count of hexes in the model.
int get_pyramid_count ()
 Get the count of pyramids in the model.
int get_tet_count ()
 Get the count of tets in the model.
int get_quad_count ()
 Get the count of quads in the model.
int get_tri_count ()
 Get the count of tris in the model.
int get_edge_count ()
 Get the count of edges in the model.
int get_node_count ()
 Get the count of nodes in the model.
void get_quality_stats (const std::string &entity_type, std::vector< int > id_list, const std::string &metric_name, double single_threshold, bool use_low_threshold, double low_threshold, double high_threshold, double &min_value, double &max_value, double &mean_value, double &std_value, std::vector< int > &mesh_list, std::string &element_type, int &bad_group_id, bool make_group=false)
 Get the quality stats for a specified entity.
double get_quality_value (const std::string &mesh_type, int mesh_id, const std::string &metric_name)
 Get the metric value for a specified mesh entity.
Geometry Query Support
int get_common_vertex_id (int curve_1_id, int curve_2_id)
 Given 2 curves, get the common vertex id.
int get_common_curve_id (int surface_1_id, int surface_2_id)
 Given 2 surfaces, get the common curve id.
std::vector< int > get_source_surfaces (int volume_id)
 Get a list of a volume's sweep source surfaces.
std::vector< int > get_target_surfaces (int volume_id)
 Get a list of a volume's sweep target surfaces.
bool get_undo_enabled ()
int number_undo_commands ()
bool get_node_constraint ()
 Query current setting for node constraint (move nodes to geometry).
std::string get_vertex_type (int surface_id, int vertex_id)
 Get the Vertex Types for a specified vertex on a specified surface. Vertex types include "side", "end", "reverse", "unknown".
bool is_visible (const std::string &geom_type, int entity_id)
 Query visibility for a specific entity.
bool is_virtual (const std::string &geom_type, int entity_id)
 Query virtualality for a specific entity.
double get_total_volume (std::vector< int > volume_list)
 Get the total volume for a list of volume ids.
std::vector< double > get_total_bounding_box (const std::string &geom_type, std::vector< int > entity_list)
 Get the bounding box for a list of entities.
std::vector< double > get_bounding_box (const std::string &geom_type, int entity_id)
 Get the bounding box for a specified entity.
std::vector< std::string > get_entity_modeler_engine (const std::string &geom_type, int entity_id)
 Get the modeler engine type for a specified entity.
int get_entity_color_index (const std::string &entity_type, int entity_id)
 Get the color of a specified entity.
std::string get_entity_name (const std::string &geom_type, int entity_id)
 Get the name of a specified entity.
bool is_multi_volume (int body_id)
 Query whether a specified body is a multi volume body.
bool is_sheet_body (int volume_id)
 Query whether a specified volume is a sheet body.
std::vector< int > get_relatives (const std::string &source_geom_type, int source_id, const std::string &target_geom_type)
 Get the relatives (parents/children) of a specified entity.
std::vector< int > get_entities (const std::string &geom_type, bool include_sheet_bodies=false)
 Get all geometry entities of a specified type.
int get_volume_count ()
 Get the current number of volumes.
int get_surface_count ()
 Get the current number of surfaces.
int get_curve_count (std::vector< int > target_volume_ids)
 Get the current number of curves in the passed-in volumes.
int get_curve_count ()
 Get the current number of curves.
int get_vertex_count ()
 Get the current number of vertices.
bool is_granite_engine_available ()
 Determine whether pro-e/granite engine is available.
bool is_catia_engine_available ()
 Determine whether catia engine is available.
int get_valence (int vertex_id)
 Get the valence for a specific vertex.
double get_distance_between (int vertex_id_1, int vertex_id_2)
 Get the distance between two vertices.
double get_curve_radius (int curve_id)
 Get the radiuis of a specified curve.
std::string get_surface_type (int surface_id)
 Get the surface type for a specified surface.
void get_surface_normal (int surface_id, double &x, double &y, double &z)
 Get the surface normal for a specified surface.
std::vector< double > get_surface_normal (int surface_id)
 Get the surface normal for a specified surface.
void get_surface_centroid (int surface_id, double &x, double &y, double &z)
 Get the surface centroid for a specified surface.
std::vector< double > get_surface_centroid (int surface_id)
 Get the surface centroid for a specified surface.
std::string get_surface_sense (int surface_id)
 Get the surface sense for a specified surface.
bool is_interval_count_odd (int surface_id)
 Query whether a specified surface has an odd loop.
std::string get_curve_type (int curve_id)
 Get the curve type for a specified curve.
std::string get_merge_setting (const std::string &geom_type, int entity_id)
 Get the merge setting for a specified entity.
double get_curve_length (int curve_id)
 Get the length of a specified curve.
double get_arc_length (int curve_id)
 Get the arc length of a specified curve.
double get_distance_from_curve_start (double x, double y, double z, int curve_id)
 Get the distance from a point on a curve to the curve's start point.
double get_surface_area (int surface_id)
 Get the area of a surface.
double get_hydraulic_radius_surface_area (int surface_id)
 Get the area of a hydraulic surface.
double get_volume_area (int volume_id)
 Get the area of a volume.
double get_hydraulic_radius_volume_area (int volume_id)
 Get the area of a hydraulic volume.
int get_owning_body (const std::string &geom_type, int entity_id)
 Get the owning body for a specified entity.
int get_owning_volume_by_name (const std::string &entity_name)
 Get the owning volume for a specified entity.
int get_owning_volume (const std::string &geom_type, int entity_id)
 Get the owning volume for a specified entity.
void print_surface_summary_stats ()
 Print the surface summary stats to the console.
void print_volume_summary_stats ()
 Print the volume summary stats to the console.
std::vector< double > get_center_point (const std::string &entity_type, int entity_id)
 Get the center point of a specified entity.
std::vector< int > get_list_of_free_ref_entities (const std::string &geom_type)
 Get all free entities of a given geometry type.
void get_entity_info (RefEntity *source_entity, std::string &geom_type, int &entity_id)
 Get the geometry type and id given a ref entity.
std::vector< int > get_adjacent_volumes (const std::string &geom_type, int entity_id)
 Get a list of adjacent volumes to a specified entity.
std::vector< int > get_adjacent_surfaces (const std::string &geom_type, int entity_id)
 Get a list of adjacent surfaces to a specified entity.
bool is_periodic (const std::string &geom_type, int entity_id)
 Query whether a specified surface or curve is periodic.
bool is_surface_planer (int surface_id)
 Query whether a specified surface is planer.
void get_periodic_data (const std::string &geom_type, int entity_id, double &interval, std::string &firmness, int &lower_bound, std::string &upper_bound)
 Get the periodic data for a surface or curve.
std::vector< int > evaluate_exterior_angle (const std::vector< int > &curve_list, const double test_angle)
General Purpose Utility
int get_last_id (const std::string &entity_type)
 Get the id of the last created entity of the given type.
bool is_part_of_list (int target_id, std::vector< int > id_list)
 Routine to check for the presence of an id in a list of ids.
Geometry Repair Support
std::vector< int > get_blend_surfaces (std::vector< int > target_volume_ids)
 Get the list of blend surfaces for a list of volumes.
std::vector< int > get_small_loops (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of close loops (surfaces) for a list of volumes.
std::vector< std::vector< int > > get_mergeable_vertices (std::vector< int > target_volume_ids)
 Get the list of mergeable vertices from a list of volumes/bodies.
double estimate_merge_tolerance (std::vector< int > target_volume_ids, bool accurate_in=false, bool report_in=false, double lo_val_in=-1.0, double hi_val_in=-1.0, int num_calculations_in=10, bool return_calculations_in=false, std::vector< double > *merge_tols=NULL, std::vector< int > *num_proximities=NULL)
 Estimate a good merge tolerance for the passed-in volumes.
void get_coincident_entity_pairs (std::vector< int > target_volume_ids, std::vector< int > &v_v_vertex_list, std::vector< int > &v_c_vertex_list, std::vector< int > &v_c_curve_list, std::vector< int > &v_s_vertex_list, std::vector< int > &v_s_surf_list, std::vector< double > &vertex_distance_list, std::vector< double > &curve_distance_list, std::vector< double > &surf_distance_list, double low_value, double hi_value, bool do_vertex_vertex=true, bool do_vertex_curve=true, bool do_vertex_surf=true, bool filter_same_volume_cases=false)
 Get the list of coincident vertex-vertex, vertex-curve, and vertex-surface pairs and distances from a list of volumes.
void get_coincident_vertex_vertex_pairs (std::vector< int > target_volume_ids, std::vector< int > &vertex_pair_list, std::vector< double > &distance_list, double low_value, double threshold_value, bool filter_same_volume_cases=false)
 Get the list of coincident vertex pairs and distances from a list of volumes.
void find_nonmanifold_curves (std::vector< int > target_volume_ids, std::vector< int > &curve_list)
 Get the list of nonmanifold curves in the volume list.
void find_floating_volumes (std::vector< int > target_volume_ids, std::vector< int > &floating_list)
 Get the list of volumes with no merged children.
void find_nonmanifold_vertices (std::vector< int > target_volume_ids, std::vector< int > &vertex_list)
 Get the list of nonmanifold vertices in the volume list.
void get_coincident_vertex_curve_pairs (std::vector< int > target_volume_ids, std::vector< int > &vertex_list, std::vector< int > &curve_list, std::vector< double > &distance_list, double low_value, double threshold_value, bool filter_same_volume_cases=false)
 Get the list of coincident vertex/curve pairs and distances from a list of volumes.
void get_coincident_vertex_surface_pairs (std::vector< int > target_volume_ids, std::vector< int > &vertex_list, std::vector< int > &surface_list, std::vector< double > &distance_list, double low_value, double threshold_value, bool filter_same_volume_cases=false)
 Get the list of coincident vertex/surface pairs and distances from a list of volumes.
void get_mergeable_entities (std::vector< int > target_volume_ids, std::vector< std::vector< int > > &surface_list, std::vector< std::vector< int > > &curve_list, std::vector< std::vector< int > > &vertex_list)
 Get the list of mergeable entities from a list of volumes.
void get_sharp_surface_angles (std::vector< int > target_volume_ids, std::vector< int > &large_surface_angles, std::vector< int > &small_surface_angles, std::vector< double > &large_angles, std::vector< double > &small_angles, double upper_bound, double lower_bound)
 Get the list of sharp surface angles for a list of volumes.
void get_sharp_curve_angles (std::vector< int > target_volume_ids, std::vector< int > &large_curve_angles, std::vector< int > &small_curve_angles, std::vector< double > &large_angles, std::vector< double > &small_angles, double upper_bound, double lower_bound)
 Get the list of sharp curve angles for a list of volumes.
std::vector< std::vector
< std::string > > 
get_solutions_for_near_coincident_vertices (int vertex_id1, int vertex_id2)
 Get lists of display strings and command strings for near coincident vertices.
std::vector< std::vector
< std::string > > 
get_solutions_for_imprint_merge (int surface_id1, int surface_id2)
 Get lists of display strings and command strings for imprint/merge solutions.
std::vector< std::vector
< std::string > > 
get_solutions_for_forced_sweepability (int volume_id, std::vector< int > &source_surface_id_list, std::vector< int > &target_surface_id_list, double small_curve_size=-1.0)
 Get lists of display strings and command strings for forced sweepability solutions.
std::vector< std::vector
< std::string > > 
get_solutions_for_small_surfaces (int surface_id, double small_curve_size, double mesh_size)
 Get lists of display, preview and command strings for small surface solutions.
std::vector< std::vector
< std::string > > 
get_solutions_for_small_curves (int curve_id, double small_curve_size, double mesh_size)
 Get lists of display, preview and command strings for small curve solutions.
std::vector< std::vector
< std::string > > 
get_solutions_for_surfaces_with_narrow_regions (int surface_id, double small_curve_size, double mesh_size)
 Get lists of display, preview and command strings for surfaces with narrow regions solutions.
bool get_solutions_for_source_target (int volume_id, std::vector< std::vector< int > > &feasible_source_surface_id_list, std::vector< std::vector< int > > &feasible_target_surface_id_list, std::vector< std::vector< int > > &infeasible_source_surface_id_list, std::vector< std::vector< int > > &infeasible_target_surface_id_list)
 Get a list of suggested sources and target surface ids given a specified volume.
double get_merge_tolerance ()
 Get the current merge tolerance value.
std::vector< int > get_coincident_vertices (std::vector< int > target_volume_ids, double high_tolerance)
std::vector< int > get_tangential_intersections (std::vector< int > target_volume_ids, double upper_bound, double lower_bound)
 Get the list of bad tangential intersections for a list of volumes.
std::vector< int > get_small_curves (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small curves for a list of volumes.
void get_closest_vertex_curve_pairs (std::vector< int > target_ids, int &num_to_return, std::vector< int > &vert_ids, std::vector< int > &curve_ids, std::vector< double > &distances)
 Find the n closest vertex pairs in the model.
void get_smallest_features (std::vector< int > target_ids, int &num_to_return, std::vector< int > &type1_list, std::vector< int > &type2_list, std::vector< int > &id1_list, std::vector< int > &id2_list, std::vector< double > &distance_list)
std::vector< int > get_smallest_curves (std::vector< int > target_volume_ids, int num_to_return)
 Get the list of 'num_to_return' smallest curves in the volumes.
std::vector< int > get_small_surfaces (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small surfaces for a list of volumes.
std::vector< int > get_small_and_narrow_surfaces (std::vector< int > target_ids, double small_area, double small_curve_size)
 Get the list of small or narrow surfaces from a list of volumes.
std::vector< int > get_narrow_surfaces (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of narrow surfaces for a list of volumes.
std::vector< int > get_surfs_with_narrow_regions (std::vector< int > target_ids, double narrow_size)
 Get the list of surfaces with narrow regions.
std::vector< int > get_small_volumes (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small volumes from a list of volumes.
void get_small_volumes_hydraulic_radius (std::vector< int > target_volume_ids, double mesh_size, std::vector< int > &small_volumes, std::vector< double > &small_radius)
 Get the list of small hydraulic radius volumes for a list of volumes.
void get_bad_geometry (std::vector< int > target_volume_ids, std::vector< int > &body_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list)
 Get the list of bad geometry for a list of volumes.
void get_small_surfaces_hydraulic_radius (std::vector< int > target_volume_ids, double mesh_size, std::vector< int > &small_surfaces, std::vector< double > &small_radius)
 Get the list of small hydraulic radius surfaces for a list of volumes.
std::vector< int > get_overlapping_volumes (std::vector< int > target_volume_ids)
 Get the list of overlapping volumes for a list of volumes.
void get_overlapping_surfaces (std::vector< int > target_volume_ids, std::vector< int > &surf_list_1, std::vector< int > &surf_list_2, std::vector< double > &distance_list, bool filter_slivers=false)
 Get the list of overlapping surfaces for a list of volumes.
std::vector< std::string > get_solutions_for_decomposition (const std::vector< int > &volume_list, double exterior_angle, bool do_imprint_merge, bool tol_imprint)
 Get the list of possible decompositions.
std::vector< std::string > get_solutions_for_blends (int surface_id)
 Get the list blend surfaces and suggestions for removing them.
std::vector< std::vector< int > > get_blend_chains (int surface_id)
Mesh Element Queries
void get_owning_volume_ids (const std::string &entity_type, std::vector< int > &entity_list, std::vector< int > &vol_ids)
int get_exodus_id (const std::string &entity_type, int entity_id)
 Get the exodus/genesis id for this element.
std::string get_geometry_owner (const std::string &entity_type, int entity_id)
 Get the geometric owner of this mesh element.
std::vector< int > get_connectivity (const std::string &entity_type, int entity_id)
 Get the list of node ids contained within a mesh entity.
std::vector< int > get_sub_elements (const std::string &entity_type, int entity_id, int dimension)
 Get the lower dimesion entities associated with a higher dimension entities. For example get the faces associated with a hex or the edges associated with a tri.
std::vector< double > get_nodal_coordinates (int node_id)
 Get the nodal coordinates for a given node id.
bool get_node_position_fixed (int node_id)
 Query "fixedness" state of node. A fixed node is not affecting by smoothing.
std::string get_sideset_element_type (int sideset_id)
 Get the element type of a sideset.
std::string get_block_element_type (int block_id)
 Get the element type of a block.
int get_exodus_element_count (int entity_id, std::string entity_type)
 Get the number of elements in a exodus entity.
int get_block_attribute_count (int block_id)
 Get the number of attributes in a block.
double get_block_attribute_value (int block_id, int index)
 Get a specific block attribute value.
std::vector< std::string > get_valid_block_element_types (int block_id)
 Get a list of potential element types for a block.
int get_nodeset_node_count (int nodeset_id)
 Get the number of nodes in a nodeset.
std::string get_mesh_element_type (const std::string &entity_type, int entity_id)
 Get the mesh element type contained in the specified geometry.
Blocks, Sidesets, and Nodesets
int get_block_id (std::string entity_type, int entity_id)
 Get the associated block id for a specific curve, surface, or volume.
std::vector< int > get_block_id_list ()
 Get a list of all blocks.
std::vector< int > get_nodeset_id_list ()
 Get a list of all nodesets.
std::vector< int > get_sideset_id_list ()
 Get a list of all sidesets.
std::string get_exodus_entity_name (std::string entity_type, int entity_id)
 Get the name associated with an exodus entity.
std::string get_exodus_entity_description (std::string entity_type, int entity_id)
 Get the description associated with an exodus entity.
void get_block_children (int block_id, std::vector< int > &group_list, std::vector< int > &node_list, std::vector< int > &edge_list, std::vector< int > &tri_list, std::vector< int > &face_list, std::vector< int > &pyramid_list, std::vector< int > &tet_list, std::vector< int > &hex_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list)
 Get lists of any and all possible children of a block.
std::vector< int > get_block_groups (int block_id)
 Get a list of group ids associated with a specific block.
std::vector< int > get_block_volumes (int block_id)
 Get a list of volume ids associated with a specific block.
std::vector< int > get_block_surfaces (int block_id)
 Get a list of surface associated with a specific block.
std::vector< int > get_block_curves (int block_id)
 Get a list of curve associated with a specific block.
std::vector< int > get_block_vertices (int block_id)
 Get a list of vertices associated with a specific block.
std::vector< int > get_block_nodes (int block_id)
 Get a list of nodes associated with a specific block.
std::vector< int > get_block_edges (int block_id)
 Get a list of edges associated with a specific block.
std::vector< int > get_block_faces (int block_id)
 Get a list of faces associated with a specific block.
std::vector< int > get_block_tris (int block_id)
 Get a list of tris associated with a specific block.
std::vector< int > get_block_pyramids (int block_id)
 Get a list of pyramids associated with a specific block.
std::vector< int > get_block_tets (int block_id)
 Get a list of tets associated with a specific block.
std::vector< int > get_block_hexes (int block_id)
 Get a list of hexes associated with a specific block.
void get_nodeset_children (int nodeset_id, std::vector< int > &node_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list)
 get lists of any and all possible children of a nodeset
std::vector< int > get_nodeset_volumes (int nodeset_id)
 Get a list of volume ids associated with a specific nodeset.
std::vector< int > get_nodeset_surfaces (int nodeset_id)
 Get a list of surface ids associated with a specific nodeset.
std::vector< int > get_nodeset_curves (int nodeset_id)
 Get a list of curve ids associated with a specific nodeset.
std::vector< int > get_nodeset_vertices (int nodeset_id)
 Get a list of vertex ids associated with a specific nodeset.
std::vector< int > get_nodeset_nodes (int nodeset_id)
 Get a list of node ids associated with a specific nodeset.
std::vector< int > get_sideset_surfaces (int sideset_id)
 Get a list of any surfaces in a sideset.
std::vector< int > get_surface_quads (int surface_id)
 get the list of any quad elements on a given surface
std::vector< int > get_sideset_quads (int sideset_id)
 Get a list of any quads in a sideset.
void get_sideset_children (int sideset_id, std::vector< int > &face_list, std::vector< int > &surface_list, std::vector< int > &curve_list)
 get lists of any and all possible children of a sideset
std::vector< int > get_sideset_curves (int sideset_id)
 Get a list of curve ids associated with a specific sideset.
std::string get_entity_sense (std::string source_type, int source_id, int sideset_id)
 Get the sense of a sideset item.
std::string get_wrt_entity (std::string source_type, int source_id, int sideset_id)
 Get the with-respect-to entity.
bool is_using_shells (int sideset_id)
 Get the shell use for a sideset.
std::vector< std::string > get_geometric_owner (std::string mesh_entity_type, std::string mesh_entity_list)
 Get a list of geometric owners given a list of mesh entities.
std::vector< int > get_block_ids (const std::string &mesh_geom_file_name)
 Get list of block ids from a mesh geometry file.
std::vector< double > get_all_exodus_times (const std::string &filename)
 Open an exodus file and get a vector of all stored time stamps.
int get_next_sideset_id ()
 Get a next available sideset id.
int get_next_nodeset_id ()
 Get a next available nodeset id.
int get_next_block_id ()
 Get a next available block id.
Group Support
void group_list (std::vector< std::string > &name_list, std::vector< int > &id_list)
 Get the names and ids of all the groups (excluding the pick group) that are defined by the current cubit session.
void get_group_children (int group_id, std::vector< int > &group_list, std::vector< int > &body_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list, int &node_count, int &edge_count, int &hex_count, int &quad_count, int &tet_count, int &tri_count)
 Get group children.
std::vector< int > get_group_groups (int group_id)
 Get group groups (groups that are children of another group).
std::vector< int > get_group_volumes (int group_id)
 Get group volumes (volumes that are children of a group).
int get_id_from_name (const std::string &name)
 Get id for a named entity.
std::vector< int > get_group_surfaces (int group_id)
 Get group surfaces (surfaces that are children of a group).
std::vector< int > get_group_curves (int group_id)
 Get group curves (curves that are children of a group).
std::vector< int > get_group_vertices (int group_id)
 Get group vertices (vertices that are children of a group).
std::vector< int > get_group_nodes (int group_id)
 Get group nodes (nodes that are children of a group).
std::vector< int > get_group_edges (int group_id)
 Get group edges (edges that are children of a group).
std::vector< int > get_group_quads (int group_id)
 Get group quads (quads that are children of a group).
std::vector< int > get_group_tris (int group_id)
 Get group tris (tris that are children of a group).
std::vector< int > get_group_tets (int group_id)
 Get group tets (tets that are children of a group).
std::vector< int > get_group_hexes (int group_id)
 Get group hexes (hexes that are children of a group).
bool is_mesh_element_in_group (const std::string &element_type, int element_id)
 Indicates whether a mesh element is in a group.
std::vector< int > get_mesh_group_parent_ids (const std::string &element_type, int element_id)
 Get the group ids which are parents to the indicated mesh element.
int get_next_group_id ()
 Get the next available group id from Cubit.
int create_new_group ()
 Create a new group.
void delete_all_groups ()
 Delete all groups.
void delete_group (int group_id)
 Delete a specific group.
void set_max_group_id (int max_group_id)
 Reset Cubit's max group id This is really dangerous to use and exists only to overcome a limitation with Cubit. Cubit keeps track of the next group id to assign. But those ids just keep incrementing in Cubit. Some of the power tools in the Cubit GUI make groups 'under the covers' for various operations. The groups are immediately deleted. But, creating those groups will cause Cubit's group id to increase and downstream journal files may be messed up because those journal files are expecting a certain ID to be available.
void remove_entity_from_group (int group_id, int entity_id, const std::string &entity_type)
 Remove a specific entity from a specific group.
Metadata Support
std::string get_assembly_metadata (int volume_id, int data_type)
 Get metadata for a specified volume id.
bool is_assembly_metadata_attached (int volume_id)
 Determine whether metadata is attached to a specified volume.
std::string get_assembly_name (int assembly_id)
 Get the stored name of an assembly node.
std::string get_assembly_description (int assembly_id)
 Get the stored description of an assembly node.
std::string get_assembly_file_format (int assembly_id)
 Get the stored file format of an assembly node.
std::string get_assembly_units (int assembly_id)
 Get the stored units measure of an assembly node.
std::string get_assembly_material_description (int assembly_id)
 Get the stored material description of an assembly part.
std::string get_assembly_material_specification (int assembly_id)
 Get the stored material specification of an assembly part.
int get_assembly_instance (int assembly_id)
 Get the stored instance number of an assembly node.
std::string get_assembly_classification_category ()
 Get Classification Category for metadata.
std::string get_assembly_classification_level ()
 Get Classification Level for metadata.
std::string get_assembly_weapons_category ()
 Get Weapons Category for metadata.


Detailed Description

This document explains how to access Cubit data from C++ or python.

The purpose of CubitInterface is to provide developers with a query interface into Cubit. With very few exceptions, the functions in CubitInterface will not change Cubit's state. The function, "set_cubit_interrupt" will set a global flag indicating to Cubit that interruptable processes may be halted. Also, the functions "cmd" and "silent_cmd" take actual Cubit command-line directives as input. All other functions provide query access into Cubit.

Most function prototypes are easy to understand. A few are more ambiguous and for those some examples are provided. Note that input parameters that require entity types, such as "volume", "quad", "curve", and so forth, expect lower case spellings of those entity types.

Examples are provided for C++ and python developers.


Function Documentation

CUBIEXPORT void CubitInterface::clear_preview (  ) 

Clear preview graphics without affecting other display settings.

( const char *  input_string  ) 

Pass a command string into Cubit.

Passing a command into Cubit using this method will result in an immediate execution of the command. The command is passed directly to Cubit without any validation or other checking.

 CubitInterface::cmd("create brick x 10");
 cubit.cmd("brick x 10")
Parameters:
input_string Pointer to a string containing a complete Cubit command

( std::string &  buffer  ) 

(  ) 

Create a new group.

Returns:
group_id ID of new group

(  ) 

Delete all groups.

( int  group_id  ) 

Delete a specific group.

Parameters:
group_id ID of group to delete

(  ) 

(  ) 

This checks to see whether developer commands are enabled.

Returns:
True if developer commands are enabled, otherwise False

(