Skip to main content

ACP in-app scripting API 2026 R1

Model

Last update: 16.07.2026

class compolyx.Model(name=None, path=None, format=None, ignored_entities=None, graph=None, parent=None, convert_section_data=False, unit_system_type=None, reference_surface_input_unit_system_type=None, cache_data=False)

Represents a finite element model.

Access:

>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.import_model(name='class40.1', path='class40.cdb', format='ansys:cdb')

Get existing model:

>>> class40_model = db.models['class40.1']

Attributes

Name Description
Model.active_scene Active Scene.
Model.analysis_model_path Analysis model file path.
Model.angle_tolerance Section computation angle tolerance (in degree).
Model.cache_update_results Define whether to store the update results or not.
Model.definitions Definitions.
Model.deformation_scale_factor Factor with which the deformed shape plot is scaled.
Model.draping_offset_correction Define whether to consider lay-up thickness in draping analysis.
Model.edge_sets Dictionary with all Edge Sets defined.
Model.element_sets Dictionary with all element sets defined.
Model.enabled
Model.excel_path
Model.field_definitions Dictionary with all defined field definitions.
Model.force_disable_result_extrapolation Force the result extrapolation to be disabled ('ERESX,NO' command) when exporting to APDL or CDB format.
Model.format File format string.
Model.geometry Geometry node.
Model.is_dict_item Indicates whether the object is an item in a dictionary.
Model.is_list_item Indicates whether the object is an item of a list.
Model.layup_plots Plots.
Model.link_path Root path of the current node in the tree for links to this object.
Model.lookup_tables Dictionary with all Look-Up Tables.
Model.material_data Dictionary with all Material Data defined.
Model.mesh Mesh of this model.
Model.minimum_analysis_ply_thickness Section computation minimum analysis ply thickness (in length unit of model).
Model.modeling_groups Dictionary with all Modeling Groups defined.
Model.name Name of the object.
Model.oriented_selection_sets Dictionary with all oriented element sets defined.
Model.parameters List of parameters visible to the workbench.
Model.parent Parent object in the tree.
Model.path Path to the reference surface input file.
Model.plybook PlyBook.
Model.pre_path Save path of pre database linked to currently loaded post database.
Model.ratio_of_displayed_vectors
Model.reference_surface_bounding_box Tuple with corners of bounding box of reference surface mesh.
Model.reference_surface_input_unit_system_locked If the unit system of the reference surface is not defined in the mesh input, the unit system can be changed.
Model.reference_surface_input_unit_system_type Unit System of the Reference Surface Input File.
Model.relative_thickness_tolerance Section computation relative thickness tolerance.
Model.root_path Root path of the current node in the tree.
Model.rosettes Dictionary with all Rosettes defined.
Model.sampling_points Sampling point Container.
Model.save_path
Model.scenes Scenes.
Model.scripts List of user-defined scripts.
Model.section_cuts Section Cuts.
Model.selection Selected objects of this model.
Model.selection_rules Dictionary with all Selection Rules defined.
Model.sensors Dictionary with all Sensors.
Model.show_deformed Whether to show result plots in the deformed and scaled configuration.
Model.show_solver_elements Whether mesh selections and plot should consider solver elements in solid models or not.
Model.solid_models SolidModel.
Model.solutions Solutions.
Model.solver Solver instance.
Model.status_changed_controller
Model.unit_system Create a unit system and assign it to the model.
Model.use_default_section_tolerances Boolean whether to uses angle and thickness tolerances of the application preferences for section computation.
Model.use_nodal_thicknesses Define whether to use nodal thicknesses or element thicknesses.
Model.vector_scale_factor
Model.views Views.
Model.workbench_state

Methods

Name Description
Model.add_solution(name[, id, path, path2, ...]) Load a nodal solution from one or more files and add it to the model.
Model.add_winding_entities(axial_direction, ...) Generates a winding layup for an axisymmetric body.
Model.average_element_size() Average element size of the model.
Model.coordinate_system_arrow_length()
Model.copy_combined_failure_criteria(source) Copy a combined failure criteria definition.
Model.copy_edge_set(source) Copy a edge set.
Model.copy_element_set(source) Copy an element set.
Model.copy_field_definition(source) Copy a FieldDefinition.
Model.copy_lookup_table(source) Copy a lookup table.
Model.copy_oriented_selection_set(source) Copy an oriented element set.
Model.copy_rosette(source) Copy a rosette.
Model.copy_sampling_point(source) Copy a sampling point.
Model.copy_section_cut(source) Copy a section cut.
Model.copy_selection_rule(source) Copy a rule.
Model.copy_sensor(source) Copy a sensor.
Model.copy_solid_model(source) Copy a solid model.
Model.create_boolean_selection_rule(name[, ...]) Create a new boolean selection rule.
Model.create_combined_failure_criteria(name) Create a combined failure criteria.
Model.create_combined_solution([name, solutions])
Model.create_cutoff_selection_rule(name[, ...]) Create new cut-off rule.
Model.create_cylindrical_selection_rule(name) Create new cylindrical selection rule.
Model.create_edge_set(name[, id, origin, ...]) Create a new edge set.
Model.create_element_set(name[, id, ...]) Create a new element set.
Model.create_envelope_solution(name[, id, ...]) Create an envelope solution.
Model.create_field_definition(name[, id, ...]) Create a new field definition.
Model.create_geometrical_selection_rule(name) Create new geometrical selection rule.
Model.create_imported_modeling_group(name[, id])
Model.create_imported_solid_model(name[, ...]) Create a new solid model.
Model.create_lookup_table1d(name[, id, ...]) Create a new 1D lookup table object.
Model.create_lookup_table3d(name[, id, ...]) Create a new 3D lookup table object.
Model.create_modeling_group(name[, id])
Model.create_oriented_selection_set(name[, ...]) Create a new oriented selection set.
Model.create_parallel_selection_rule(name[, ...]) Create a new parallel selection rule.
Model.create_published_parameter(name[, ...]) Create a published parameter.
Model.create_rosette(name[, id, origin, ...]) Create a new rosette.
Model.create_sampling_point(name[, id, ...]) Create a new sampling point.
Model.create_scene(name[, id, title, ...]) Create a new scene.
Model.create_script(name[, source, active, ...]) Creates a script object, which allows executing custom Python code.
Model.create_section_cut(name[, id, active, ...]) Creates a new section cut.
Model.create_sensor(name[, id, active, ...]) Create new sensor.
Model.create_solid_model(name[, id, active, ...]) Create a new solid model.
Model.create_spherical_selection_rule(name) Create a new spherical selection rule.
Model.create_tube_selection_rule(name[, id, ...]) Create a new tube selection rule.
Model.create_variable_offset_selection_rule(name) Create new slab offset rule.
Model.create_view(name[, position, ...])
Model.default_vector_scale_and_ratio()
Model.element_normal(globalID) Returns the element normal (direction).
Model.export_composite_cae_h5(path[, ...]) Export layup to composite CAE .hdf5 file.
Model.export_h5_composite_definitions(path) Save composite definitions to .hdf5 file.
Model.export_ply_geometries(filename[, ...]) Exports the surface, boundary, and/or fiber directions of modeling, production, and analysis ply to .igs or .step file.
Model.export_solid_models([directory, ...]) Save solid models to files.
Model.find_materials(**properties) Find materials with the given properties or property ranges.
Model.find_parent(type) Steps up the tree and returns the first parent with given type.
Model.get_composite_cae_h5_mesh_preview(...)
Model.get_element_by_point(point) Returns the element label of the closest element with respect to the given point.
Model.get_layup(path[, format, objects, mode]) Load layup from excel or .csv file.
Model.get_layup_from_csv_file(path[, ...]) Function that reads the layup data from a .csv file and adds the data to the graph.
Model.get_layup_from_excel_file(path[, ...]) Load layup from Excel File.
Model.graph_report()
Model.import_composite_cae_h5(path[, mode, ...]) Import a composite layup definition from a .hdf5 file.
Model.import_section_data_from_legacy_model(path) Import and convert the layup of a legacy (Mechanical APDL) shell model into ACP composite definitions.
Model.mesh_query(name, position[, ...]) Query arbitrary data from the mesh of the model.
Model.plot_dependencies([path, parent, levels]) Generates a graph with all dependencies.
Model.reference_element(globalID)
Model.refresh_material_apdl_file(apdl_file_path)
Model.refresh_material_data(matml_file_path, ...) Refresh material external data sources in the model .acph5 database.
Model.reload_mesh([path, format]) Reloads the mesh (nodes, elements, and named selections).
Model.reorder_modeling_groups([source, ...]) Reorders the modeling groups by placing source before or after the target.
Model.save([path, cache_data]) Save ACP model to .acph5 file.
Model.save_analysis_model(path) Save actual analysis model to disc.
Model.save_apdl_commands(path) Save APDL commands for composite definitions of actual model.
Model.save_h5(path[, cache_data]) Save ACP model in .acph5 format.
Model.save_layup(path[, format, objects]) Function that saves the layup data to a .csv file.
Model.save_layup_to_csv_file(path[, objects]) Function that saves the layup data to a .csv file.
Model.save_layup_to_excel_file(path[, objects]) Function that saves the layup data to an excel file (Windows only).
Model.select_elements([selection, op, ...]) Selects element within active model and marks the selection as SELECTED.
Model.select_nodes([selection, op, labels, ...]) Function selects nodes in graph and marks the given selection as SELECTED.
Model.select_solid_elements_from_shells([...]) Selects the solid element within given selection and deselects the shell elements.
Model.solve([wait]) Convenience function to directly solve the current model.
Model.sphere_widget_radius()
Model.update([objects, relations_only]) Main update function.
Model.visit(visitor) Walk through the tree and let the visitor perform action on every descendant node.
Model.wbupdate([objects, relations_only]) Generate all output files of ACP for the Workbench application.

Connect with Ansys