## 6.3. DB Database

`class compolyx.DB`

Class to represent ComPoLyX database

Access:

    >>> import compolyx
    >>> db = compolyx.DB()

`active_model`

  Active model

`clear`()

  Clear database

`close`(model=None)

  Close model

  Parameters

  - model : model to close (optional) if no model is given all models were closed

`import_model`(name, path, format, reduced_integration=True, ignored_entities=None, post_processing_model=None, unit_system_type=None, reference_surface_input_unit_system_type=None)

  Create a model from file

  Parameters

  - name : Custom name of the model

  - path : Path to the data file

  - format : File format string. Choose one of 'abaqus:inp','ansys:cdb', 'ansys:dat', 'nastran:bdf', 'ansys:h5'

  - reduced_integration : Whether to use reduced integration schemes for 4-node layered shells. Default: True

  - ignored_entities : Entities to ignore. Can be a subset of the following list: ['mesh', 'element_sets', 'materials', 'coordinate_systems', 'shell_sections']

  - post_processing_model : Whether to handle this model as static and only post-processing functionality can be performed. Default: True

  - unit_system_type : Set the unit system of the model to this type. Ignored if a unit system was already defined in the data file.

  - reference_surface_input_unit_system_type : Set the unit system of the reference surface if the unit system cannot be read from the input

`material_data`

  Material Data Base

`models`

  Models

`open`(path, replace_mesh_kwargs=None, replace_workbench_inputs=None, pre_db=None, unit_system_type=None, load_cached_data=False)

  Open ACP file and append the model to models container :Parameters: - path : Path to ACP file - replace_mesh_kwargs Optional keyword arguments to replace the mesh to load in db.import_model(...) upfront - replace_workbench_inputs Optional dictionary with Workbench inputs to replace before executing the .acp file

`reload`(model)

  Reloads the model

  Parameters

  - model : the model to be reloaded

`save`(path=None, model=None, cache_data=False)

  Save active model

  Parameters

  - path : file path

  - model : active model

`set_unit_system`(unit_system_type)

  Set the unit system of all models opened in the database

Release 18.2 - © ANSYS, Inc. All rights reserved.