Skip to content

Allsolve SDK API Reference

def deprecated(reason)

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

Shared constants for output YAML aliases used by import, export, and codegen.

Contains a PoC of a convenience import format parser.

def import_project(file_or_data: str | dict,
project_to_modify: Project | None = None) -> Project

Import a project from a file or a dictionary.

Takes a file in YAML or JSON format, an example with all supported fields etc. is given in example/import_project/project-format.yaml.

Arguments:

  • file_or_data - The path to the file to import or a dictionary.
  • project_to_modify - The project to modify. If not provided, a new project is created.

Returns:

The imported project object.

def parse_tuple(
value: dict | tuple | list | None,
expected_dimensions: int = 3) -> tuple[float | str, ...] | None

Parse a tuple value from YAML/JSON dictionary format. Accepts dictionary format with x, y, z keys (or x, y for 2D).

def import_physics_and_interactions(project: Project,
physics_list: list[dict] | None,
regions: dict[str, Region],
verbose: bool = False)

Import physics and nested interactions.

Expected format: physics: - type: solidMechanics # or solid_mechanics target: cubes # region name or id interactions: - type: load name: Load target: some_surface_region force: “[0; 0; -1000]“

def import_interactions_for_physics(project: Project,
physic: Physic,
interactions: list[dict],
regions: dict[str, Region],
verbose: bool = False)

Import interactions nested under a physics entry.

Parameters are provided at the top level of each interaction entry (camelCase or snake_case keys).

def import_outputs_for_simulation(project: Project,
simulation: Simulation,
outputs: list[dict] | None,
verbose: bool = False)

Import simulation output interactions (e.g. fieldOutput) nested under a simulation entry.

Output parameters are provided at the top level (camelCase or snake_case keys). Friendly aliases are supported::

expression → {outputType} (e.g. fieldOutput)
skinOnly → {outputType}SkinOnly (e.g. fieldOutputSkinOnly)
deformedMesh→ {outputType}DeformedMesh(e.g. fieldOutputDeformedMesh)

A filter key is expanded into the raw filter parameters; see :func:_expand_output_filter.

class MaterialProperty()

MaterialProperty is a base class for managing material properties.

class Material()

Material is a class for managing materials in a project.

@classmethod
def create(cls,
name: str,
color: str,
description: str | None = None,
properties: List[MaterialProperty.PhysicalProperty] = [],
target_region: Region | None = None,
abbreviation: str | None = None,
orientation: str | Tuple[float | int, float | int, float | int]
| None = None,
enabled: str | None = None,
project_id: str | None = None) -> Self

Create a new material.

Arguments:

  • name - The name of the material.
  • color - The color of the material. Format: “#RRGGBB”
  • description - Optional description of the material.
  • properties - List of PhysicalProperty objects of the material.
  • target_region - The target Region of the material.
  • abbreviation - Optional abbreviation of the material.
  • orientation - Optional orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]”
  • enabled - Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”
  • project_id - The ID of the project.

Returns:

The created Material.

@classmethod
def get(cls, material_id: str, project_id: str | None = None) -> Self

Get a material by its ID.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all materials in a project.

@classmethod
def get_all_from_library(cls) -> List[rawapi.Material]

Get all library materials.

Returns:

List of library rawapi.Material objects.

@classmethod
def create_from_library(cls,
name: str,
target_region: Region | None = None,
enabled: str | None = None,
project_id: str | None = None) -> Self

Create a new material from a library material by name.

Arguments:

  • name - The name of the library material to copy.
  • target_region - The target Region of the material.
  • enabled - Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”
  • project_id - The ID of the project.

Returns:

The created Material.

Raises:

  • ValueError - If no library material with the given name is found.
@property
@prevent_deleted
def id() -> str

Get the ID of the material.

@property
@prevent_deleted
def name() -> str

Get the name of the material.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the material. Use save() to commit the change.

@property
@prevent_deleted
def description() -> str | None

Get the description of the material.

@description.setter
@prevent_deleted
def description(description: str) -> None

Set the description of the material. Use save() to commit the change.

@property
@prevent_deleted
def color() -> str

Get the color of the material.

@color.setter
@prevent_deleted
def color(color: str) -> None

Set the color of the material. Use save() to commit the change.

@property
@prevent_deleted
def target() -> str | None

Get the target of the material.

@target.setter
@prevent_deleted
def target(target: str) -> None

Set the target of the material. Use save() to commit the change.

@property
@prevent_deleted
def properties() -> List[rawapi.PhysicalProperty]

Get the properties of the material.

@properties.setter
@prevent_deleted
def properties(properties: List[rawapi.PhysicalProperty]) -> None

Set the properties of the material. Use save() to commit the change.

@property
@prevent_deleted
def abbreviation() -> str | None

Get the abbreviation of the material.

@abbreviation.setter
@prevent_deleted
def abbreviation(abbreviation: str) -> None

Set the abbreviation of the material. Use save() to commit the change.

@property
@prevent_deleted
def orientation() -> str | None

Get the orientation of the material.

@orientation.setter
@prevent_deleted
def orientation(
orientation: str | Tuple[float | int, float | int, float | int] | None
) -> None

Set the orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]” Use save() to commit the change.

@property
@prevent_deleted
def enabled() -> str | None

Get the enabled status of the material.

@enabled.setter
@prevent_deleted
def enabled(enabled: str) -> None

Set the enabled status of the material. Use save() to commit the change.

@prevent_deleted
def delete() -> None

Delete the material.

@prevent_deleted
def save() -> None

Explicitly save the changes to the cloud made by setting properties name, description, color, and properties.

Integer compression library for efficient storage of integer sequences.

Uses differential encoding combined with optional zstd compression or RLE.

class Scheme(IntEnum)

Compression scheme used for encoding.

Simple differential encoding

Differential + run-length encoding

Differential + zstd compression

def encode(ints: List[int],
zstd_compressor: Optional[zstd.ZstdCompressor] = None) -> bytes

Encode a list of integers using differential compression.

Automatically selects the best compression scheme:

  • DIFF for small arrays (≤4 elements)
  • DIFF_RLE for constant-difference sequences
  • DIFF_ZSTD for larger variable arrays

Arguments:

  • ints - List of integers to compress.
  • zstd_compressor - Optional pre-created zstd compressor for reuse. If None, a new one will be created when needed.

Returns:

Compressed bytes.

def decode(
encoded: bytes,
zstd_decompressor: Optional[zstd.ZstdDecompressor] = None
) -> List[int]

Decode compressed integer data.

Arguments:

  • encoded - Compressed bytes from encode().
  • zstd_decompressor - Optional pre-created zstd decompressor for reuse. If None, a new one will be created when needed.

Returns:

List of decoded integers.

class NotInitializedError(Exception)

Exception for when a class or data is not initialized.

class DeletedError(Exception)

Exception for when an object is deleted.

class NotProjectAPIKeyError(Exception)

Exception for when a project API key is not set.

def prevent_deleted(f)

Decorator to prevent access to methods/properties of deleted objects. Raises DeletedError if the object’s _deleted attribute is True.

class Job()

Job for a project.

Jobs are created when a geometry or a mesh is processed, or when a simulation is run.

@property
def id() -> str

Get the job ID

def get_status() -> str | None

Get the current status of the job.

Returns:

The status of the job.

def refresh_status(delay_s: float = DEFAULT_DELAY_S) -> str | None

Refresh the status of the job from the server.

Arguments:

  • delay_s - Optional time to wait before refreshing the status

Returns:

The status of the job.

def is_running(refresh_delay_s: float | None = None) -> bool

Check if the job is still running.

Arguments:

  • refresh_delay_s - Optional time to wait before checking the status

Returns:

True if the job is still running, False otherwise.

def get_logs(limit: int = 100) -> List[str]

Get log messages, starting from where we left off previously

Arguments:

  • limit - Optional maximum number of logs to retrieve

Returns:

A list of log messages.

def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print new log lines to the specified output

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to retrieve and print.
def get_status_reason() -> str | None

Get the reason for the current job status, if available

Returns:

The reason for the current job status, if available.

class RegionOperation(Enum)

Enum for the RegionOperation.

class Region()

Region of a geometry.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all regions in the project.

Arguments:

  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

A list of Region objects.

@classmethod
def create(cls,
name: str,
entity_type: rawapi.EntityType,
entity_tags: List[int],
region_rule: rawapi.RegionRule | None = None,
project_id: str | None = None) -> Self

Create a region in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • entity_tags - The tags of the entity.
  • region_rule - Optional region rule of the region.
  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

The created region.

@property
@prevent_deleted
def id() -> str

Get the ID of the region.

@property
@prevent_deleted
def name() -> str

Get the name of the region.

@property
@prevent_deleted
def entity_tags() -> List[int]

Get the entity tags of the region.

@property
@prevent_deleted
def entity_type() -> rawapi.EntityType

Get the entity type of the region.

@prevent_deleted
def delete() -> None

Delete the region.

class KeyValueAttributePath(rawapi.AttributePath)

KeyValueAttributePath.

class RegionRule(Region)

RegionRule.

@classmethod
def create(cls,
name: str,
entity_type: rawapi.EntityType,
attribute_path: rawapi.AttributePath | list[tuple[str, str]]
| None = None,
bounding_box: rawapi.ExpressionBoundingBox | None = None,
min_size: rawapi.ExpressionVector | None = None,
max_size: rawapi.ExpressionVector | None = None,
project_id: str | None = None) -> Self

Create a region rule in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • attribute_path - The attribute path of the region. Can be a list of tuples (key, value).
  • Example - [(“LayerName”, “Polysilicon”)]
  • bounding_box - The bounding box of the region.
  • min_size - The minimum size of the region.
  • max_size - The maximum size of the region.
  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

The created region rule.

class ComputedRegion(Region)

ComputedRegion.

@classmethod
def create(cls,
name: str,
entity_type: rawapi.EntityType,
operation: rawapi.RegionRuleOperation,
source_region_ids: List[str],
project_id: str | None = None) -> Self

Create a computed region in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • operation - The operation to perform on the source regions.
  • source_region_ids - The IDs of the source regions.
  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

The created computed region.

def get_quota() -> rawapi.OrganizationQuota

Get the organization’s quota information.

Returns the current quota status including core hours, used core seconds, and concurrent core limits.

class CPU(Enum)

Enum for the type of CPU.

class Runtime()

Runtime for a simulation.

class DisableableSection(Enum)

Enum for generated simulation script sections that can be disabled. The generated script can be seen in Allsolve GUI.

A simulation script is generated from the project configuration. It consists of generated sections interleaved with custom injection points (see CustomSection). Disabling a generated section causes its code to be emitted as comments, allowing users to replace it entirely using the surrounding custom sections.

Use Simulation.disabled_script_sections to disable sections.

Values:

  • SETUP — Namespace declarations (variables, mesh, fields, etc.) and pre-mesh configuration.
  • MESH — Mesh loading, PML layers, skin meshes, partitioning.
  • FIELDS — Field creation for all physics.
  • DERIVED_FIELDS — Derived field definitions.
  • CONSTRAINTS — Physics boundary conditions and constraints.
  • PORTS — Port and lump interaction definitions.
  • FIELD_INITS — Field state initializations (initial conditions).
  • FORMULATIONS — Formulation assembly and regular interaction definitions.
  • SOLVE — Solver execution (transient loop, eigenvalue solve, or steady-state solve).
class CustomSection(Enum)

Enum for injection points for custom Python code in the generated simulation script. The generated script can be seen in Allsolve GUI.

A simulation script is composed of generated sections interleaved with custom sections. Custom sections let you insert your own Python code at specific points in the script. Use Simulation.set_scripts to assign code to a section.

Script structure example::

# imports
import quanscient as qs
from utils import Mesh, Variables, Empty, Fields, DerivedFields
# AFTER_IMPORTS
# setup
var = Variables()
mesh = Mesh()
# BEFORE_MESH_LOAD
# mesh
mesh.mesh = qs.mesh()
mesh.mesh.setphysicalregions(*reg.get_region_data())
# AFTER_MESH_LOAD
# fields
fld.u = qs.field("h1xyz", [1])
fld.u.setorder(reg.all, 2)
# AFTER_FIELDS_CREATED
# derivedFields
df.sigma = qs.parameter(6, 1)
df.vm = qs.parameter(1, 1)
# AFTER_DERIVED_FIELDS_CREATED
# constraints
fld.u.setconstraint(reg.clamp)
# AFTER_CONSTRAINTS_CREATED
# ports
port.lump.V = qs.port([2, 3])
# AFTER_PORTS_CREATED
# fieldInits
# AFTER_FIELD_INITS
# formulations
form = qs.formulation()
form += qs.integral(reg.solid_mechanics, qs.predefinedelasticity(qs.dof(fld.u), qs.tf(fld.u), par.H()))
# AFTER_FORMULATIONS_CREATED
# solve. Contains analysis-type-specific sub-sections
form.allsolve(relrestol=1e-06, maxnumit=1000, nltol=1e-05, maxnumnlit=-1, relaxvalue=-1)
# AFTER_SOLVE and other analysis-type-specific sections
#AFTER_ALL

Values:

  • AFTER_IMPORTS — After all module imports. Import additional Python modules or define global variables.
  • BEFORE_MESH_LOAD — After setup (namespace and variable declarations). Modify setup variables before mesh loading.
  • AFTER_MESH_LOAD — After the mesh is loaded and partitioned. Inspect or modify the mesh object.
  • AFTER_FIELDS_CREATED — After all fields are created. Modify field properties or add custom fields.
  • AFTER_DERIVED_FIELDS_CREATED — After derived fields are created. Modify derived field definitions.
  • AFTER_CONSTRAINTS_CREATED — After physics constraints are applied. Add or modify boundary conditions.
  • AFTER_PORTS_CREATED — After port/lump interaction definitions. Modify port configurations.
  • AFTER_FIELD_INITS — After field state initializations. Override initial conditions.
  • AFTER_FORMULATIONS_CREATED — After formulations and regular interactions are created. Modify the formulation before solving.
  • AFTER_SOLVE — After the solve section.
  • AFTER_ALL — After the solve section and all outputs. Post-processing, custom outputs, or cleanup.

Analysis-type-specific sections (only available when the analysis type matches):

  • AFTER_TIMESTEPPER_CREATED — Transient only. After the timestepper is created and configured, before the time loop.
  • BEFORE_TRANSIENT_SOLVE — Transient only. Inside the time loop, before each solve step. Update time-dependent parameters or log per-step info.
  • AFTER_EIGENVALUE_SOLVER_CREATED — Eigenmode only. After the eigenvalue solver is created, before eigenfrequency computation.
  • AFTER_SOLVE_REAL — Eigenmode only. After the real part of the eigenmode solve.
  • AFTER_SOLVE_IMAGINARY — Eigenmode only. After the imaginary part of the eigenmode solve.
class Script()

A script attached to a simulation.

The script can be a custom section script, a module, or a main script replacement.

  • Custom section script: Injects code at a specific CustomSection point in the generated simulation script. Set section_name to the desired injection point.
  • Module: A helper file that other scripts can import. Created when section_name is None and is_main is False (the defaults).
  • Main script replacement: Replaces the entire generated main script with your own. Set is_main=True.

Provide code via content (inline string) or filepath (path to a .py file on disk). When using filepath, the file is read at the time Simulation.set_scripts is called.

Arguments:

  • filepath - Path to a .py file whose contents will be used as the script.

  • is_main - If True, this script replaces the generated main script.

  • section_name - The CustomSection injection point where this script’s code will be inserted. None for main scripts and modules.

  • name - Script file name (e.g. "afterMeshLoad.py"). Required when using content; inferred from filepath otherwise. A .py suffix is added automatically if missing.

  • content - Inline Python code as a string.

    Example::

    sim.set_scripts([ allsolve.Script( name=“afterMeshLoad.py”, section_name=allsolve.CustomSection.AFTER_MESH_LOAD, content=“print(‘mesh loaded’)”, ) ])

class SolverMode()

Solver mode for a simulation.

class TimestepAlgorithm()

Timestep algorithm for a transient simulation.

class AnalysisType()

Simulation analysis type.

class Simulation(JobMixin)

Simulation of a project.

@classmethod
def get(cls, simulation_id: str, project_id: str | None = None) -> Self

Get a simulation by its ID.

Arguments:

  • simulation_id - The ID of the simulation.
  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

The simulation.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all simulations in the given project.

Arguments:

  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

A list of simulations.

@classmethod
def copy_simulation(cls,
simulation_id: str,
project_id: str | None = None) -> Self

Make a copy of the given simulation identified by its ID. Useful for creating simulations from a template.

Arguments:

  • simulation_id - The id of the source simulation.
  • project_id - The id of the project where the source and target simulation exist. If project API key is used, this is optional.

Returns:

The copied simulation.

@classmethod
def create(cls,
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
analysis_type: rawapi.AnalysisType | None = None,
harmonics: List[int] | None = None,
physics: List[str] | None = None,
transient_start_time: str | None = None,
transient_end_time: str | None = None,
transient_timestep_size: str | None = None,
timestep_algorithm: rawapi.TimestepAlgorithm | None = None,
fundamental_frequency: str | None = None,
num_fft_samples: int | None = None,
num_requested_eigenmodes: str | None = None,
target_eigenfrequency: str | None = None,
eigenmode_port_analysis: bool | None = None,
solver_tolerance: str | None = None,
nonlinear_solver_tolerance: str | None = None,
nonlinear_solver_max_iterations: str | None = None,
eigenmode_solver_tolerance: str | None = None,
eigenmode_solver_max_iterations: str | None = None,
target_frequency: str | None = None,
numerical_jacobian: bool | None = None,
project_id: str | None = None) -> Self

Create a new simulation in the given project.

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use in the simulation.
  • analysis_type - The analysis type of the simulation. Defaults to STATIC.
  • harmonics - The harmonics of the simulation.
  • physics - List of physics IDs to simulate.
  • transient_start_time - The transient start time expression (for transient simulations).
  • transient_end_time - The transient end time expression (for transient simulations).
  • transient_timestep_size - The transient timestep size expression (for transient simulations).
  • timestep_algorithm - The timestep algorithm (for transient simulations).
  • fundamental_frequency - The fundamental frequency expression (for harmonic simulations).
  • num_fft_samples - The number of FFT samples (minimum 3).
  • num_requested_eigenmodes - The number of requested eigenmodes expression.
  • target_eigenfrequency - The target eigenfrequency expression.
  • eigenmode_port_analysis - Whether eigenmode port analysis is enabled.
  • solver_tolerance - The solver tolerance expression.
  • nonlinear_solver_tolerance - The nonlinear solver tolerance expression.
  • nonlinear_solver_max_iterations - The nonlinear solver maximum iterations expression.
  • eigenmode_solver_tolerance - The eigenmode solver tolerance expression.
  • eigenmode_solver_max_iterations - The eigenmode solver maximum iterations expression.
  • target_frequency - The target frequency expression.
  • numerical_jacobian - Whether numerical Jacobian is enabled.
  • project_id - The id of the project where the new simulation should be created. If project API key is used, this is optional.

Returns:

The created simulation.

@property
@prevent_deleted
def id() -> str

Get the ID of the simulation.

@property
@prevent_deleted
def name() -> str

Get the name of the simulation.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the simulation.

@property
@prevent_deleted
def description() -> str | None

Get the description of the simulation.

@description.setter
@prevent_deleted
def description(description: str) -> None

Set the description of the simulation.

@property
@prevent_deleted
def mesh_id() -> str | None

Get the ID of the mesh used in the simulation.

@mesh_id.setter
@prevent_deleted
def mesh_id(mesh_id: str) -> None

Set the ID of the mesh used in the simulation.

@property
@prevent_deleted
def max_run_time_minutes() -> int

Get the maximum run time of the simulation.

@max_run_time_minutes.setter
@prevent_deleted
def max_run_time_minutes(max_run_time_minutes: int) -> None

Set the maximum run time of the simulation.

@property
@prevent_deleted
def solver_mode() -> rawapi.DistributedSolverMode

Get the solver mode of the simulation.

@solver_mode.setter
@prevent_deleted
def solver_mode(solver_mode: rawapi.DistributedSolverMode) -> None

Set the solver mode of the simulation.

@property
@prevent_deleted
def node_count() -> int | None

Get the number of nodes used in the simulation.

@property
@prevent_deleted
def node_type() -> CPU

Get the type of nodes used in the simulation.

@property
@prevent_deleted
def shared_files() -> List[rawapi.InputFile]

Get the shared files used in the simulation.

@property
@prevent_deleted
def files() -> List[rawapi.InputFile]

Get the files used in the simulation.

@prevent_deleted
def get_input_files() -> List[rawapi.SimulationInputFile]

Get all input files used in the simulation.

Returns:

Unified list of all simulation input files.

@prevent_deleted
def set_input_files(input_files: List[rawapi.SimulationInputFile]) -> None

Set all input files used in the simulation.

Any existing input files missing from the provided list are removed.

Arguments:

  • input_files - Full list of input files to use in the simulation.
@property
@prevent_deleted
def variable_overrides() -> VariableOverrides | None

Get the variable overrides of the simulation.

@variable_overrides.setter
@prevent_deleted
def variable_overrides(variable_overrides: VariableOverrides | None) -> None

Set the variable overrides of the simulation.

@property
@prevent_deleted
def analysis_type() -> rawapi.AnalysisType | None

Get the analysis type of the simulation.

@analysis_type.setter
@prevent_deleted
def analysis_type(value: rawapi.AnalysisType | None) -> None

Set the analysis type of the simulation.

@property
@prevent_deleted
def harmonics() -> List[int] | None

Get the harmonics of the simulation.

@harmonics.setter
@prevent_deleted
def harmonics(value: List[int] | None) -> None

Set the harmonics of the simulation.

@property
@prevent_deleted
def disabled_script_sections() -> List[DisableableSection]

Generated script sections that are currently disabled.

When a section is disabled, its generated code is emitted as comments in the simulation script. This lets you replace the generated logic entirely by providing your own code in the surrounding CustomSection injection points.

Returns:

List of disabled sections.

See Also:

DisableableSection for the list of sections and what each one generates.

@disabled_script_sections.setter
@prevent_deleted
def disabled_script_sections(value: List[DisableableSection]) -> None

Set which generated script sections to disable.

Disabled sections have their generated code commented out, allowing you to replace them with custom code via Simulation.set_scripts.

Arguments:

  • value - List of sections to disable.

    Example::

    sim.disabled_script_sections = [ allsolve.DisableableSection.SETUP, allsolve.DisableableSection.MESH, ] sim.save()

@property
@prevent_deleted
def physics() -> List[str] | None

Get the list of physics IDs to simulate.

@physics.setter
@prevent_deleted
def physics(value: List[str] | None) -> None

Set the list of physics IDs to simulate.

@property
@prevent_deleted
def transient_start_time() -> str | None

Get the transient start time expression.

@transient_start_time.setter
@prevent_deleted
def transient_start_time(value: str | None) -> None

Set the transient start time expression.

@property
@prevent_deleted
def transient_end_time() -> str | None

Get the transient end time expression.

@transient_end_time.setter
@prevent_deleted
def transient_end_time(value: str | None) -> None

Set the transient end time expression.

@property
@prevent_deleted
def transient_timestep_size() -> str | None

Get the transient timestep size expression.

@transient_timestep_size.setter
@prevent_deleted
def transient_timestep_size(value: str | None) -> None

Set the transient timestep size expression.

@property
@prevent_deleted
def timestep_algorithm() -> rawapi.TimestepAlgorithm | None

Get the timestep algorithm.

@timestep_algorithm.setter
@prevent_deleted
def timestep_algorithm(value: rawapi.TimestepAlgorithm | None) -> None

Set the timestep algorithm.

@property
@prevent_deleted
def fundamental_frequency() -> str | None

Get the fundamental frequency expression.

@fundamental_frequency.setter
@prevent_deleted
def fundamental_frequency(value: str | None) -> None

Set the fundamental frequency expression.

@property
@prevent_deleted
def num_fft_samples() -> int | None

Get the number of FFT samples.

@num_fft_samples.setter
@prevent_deleted
def num_fft_samples(value: int | None) -> None

Set the number of FFT samples (minimum 3).

@property
@prevent_deleted
def num_requested_eigenmodes() -> str | None

Get the number of requested eigenmodes expression.

@num_requested_eigenmodes.setter
@prevent_deleted
def num_requested_eigenmodes(value: str | None) -> None

Set the number of requested eigenmodes expression.

@property
@prevent_deleted
def target_eigenfrequency() -> str | None

Get the target eigenfrequency expression.

@target_eigenfrequency.setter
@prevent_deleted
def target_eigenfrequency(value: str | None) -> None

Set the target eigenfrequency expression.

@property
@prevent_deleted
def eigenmode_port_analysis() -> bool | None

Get whether eigenmode port analysis is enabled.

@eigenmode_port_analysis.setter
@prevent_deleted
def eigenmode_port_analysis(value: bool | None) -> None

Set whether eigenmode port analysis is enabled.

@property
@prevent_deleted
def solver_tolerance() -> str | None

Get the solver tolerance expression.

@solver_tolerance.setter
@prevent_deleted
def solver_tolerance(value: str | None) -> None

Set the solver tolerance expression.

@property
@prevent_deleted
def nonlinear_solver_tolerance() -> str | None

Get the nonlinear solver tolerance expression.

@nonlinear_solver_tolerance.setter
@prevent_deleted
def nonlinear_solver_tolerance(value: str | None) -> None

Set the nonlinear solver tolerance expression.

@property
@prevent_deleted
def nonlinear_solver_max_iterations() -> str | None

Get the nonlinear solver maximum iterations expression.

@nonlinear_solver_max_iterations.setter
@prevent_deleted
def nonlinear_solver_max_iterations(value: str | None) -> None

Set the nonlinear solver maximum iterations expression.

@property
@prevent_deleted
def eigenmode_solver_tolerance() -> str | None

Get the eigenmode solver tolerance expression.

@eigenmode_solver_tolerance.setter
@prevent_deleted
def eigenmode_solver_tolerance(value: str | None) -> None

Set the eigenmode solver tolerance expression.

@property
@prevent_deleted
def eigenmode_solver_max_iterations() -> str | None

Get the eigenmode solver maximum iterations expression.

@eigenmode_solver_max_iterations.setter
@prevent_deleted
def eigenmode_solver_max_iterations(value: str | None) -> None

Set the eigenmode solver maximum iterations expression.

@property
@prevent_deleted
def target_frequency() -> str | None

Get the target frequency expression.

@target_frequency.setter
@prevent_deleted
def target_frequency(value: str | None) -> None

Set the target frequency expression.

@property
@prevent_deleted
def numerical_jacobian() -> bool | None

Get whether numerical Jacobian is enabled.

@numerical_jacobian.setter
@prevent_deleted
def numerical_jacobian(value: bool | None) -> None

Set whether numerical Jacobian is enabled.

@property
@prevent_deleted
def field_initializations() -> List[rawapi.FieldInitialization] | None

Get the field initializations of the simulation.

@prevent_deleted
def get_outputs() -> List[OutputInteraction]

Get the output interactions of the simulation.

@prevent_deleted
def add_outputs(outputs: List[OutputInteraction]) -> List[OutputInteraction]

Add output interactions to the simulation.

@prevent_deleted
def set_scripts(scripts: List[Script]) -> None

Upload scripts attached to this simulation.

Scripts can inject custom Python code at specific points in the generated simulation script (see CustomSection for the full list of injection points), or replace the main script entirely.

Arguments:

  • scripts - List of Script objects to upload.

    Example::

    sim.set_scripts([ allsolve.Script( name=“afterMeshLoad.py”, section_name=allsolve.CustomSection.AFTER_MESH_LOAD, content=“print(‘mesh loaded’)”, ), allsolve.Script( name=“afterAll.py”, section_name=allsolve.CustomSection.AFTER_ALL, filepath=“my_postprocessing.py”, ), ])

@prevent_deleted
def get_scripts() -> List[Script]

Retrieve all scripts attached to this simulation.

Returns user-provided custom scripts. Each returned Script has its name, content, and section_name (if applicable) populated.

Returns:

List of Script objects.

@prevent_deleted
def refresh_status(delay_s: float = 1) -> str | None

Refresh the status of the processing of the simulation.

Arguments:

  • delay_s - Optional delay in seconds between checking the status of the simulation.

Returns:

The status of the processing of the simulation.

@prevent_deleted
def get_status() -> str | None

Get the status of the processing of the simulation.

Returns:

The status of the processing of the simulation.

@prevent_deleted
def is_running(refresh_delay_s: float | None = None) -> bool

Check if the processing of the simulation is running.

Arguments:

  • refresh_delay_s - Optional delay in seconds between checking the status of the simulation.

Returns:

True if the simulation is running, False otherwise.

@prevent_deleted
def get_status_reason() -> str | None

Get the status reason of the simulation.

Returns:

The status reason of the simulation.

@prevent_deleted
def get_logs(limit: int = 100) -> List[str]

Get the logs of the simulation.

Arguments:

  • limit - Optional maximum number of logs to return.

Returns:

The logs of the simulation.

@prevent_deleted
def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print the new log lines of the simulation.

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to print.
@prevent_deleted
def set_runtime(runtime: Runtime) -> None

Set the runtime of the simulation.

@prevent_deleted
def save() -> None

Explicitly save the changes to the cloud made by set_runtime or by setting any of the following properties:

name, description, mesh_id, max_run_time_minutes, solver_mode, variable_overrides, analysis_type, harmonics, disabled_script_sections, physics, transient_start_time, transient_end_time, transient_timestep_size, timestep_algorithm, fundamental_frequency, num_fft_samples, num_requested_eigenmodes, target_eigenfrequency, eigenmode_port_analysis, solver_tolerance, nonlinear_solver_tolerance, nonlinear_solver_max_iterations, eigenmode_solver_tolerance, eigenmode_solver_max_iterations, target_frequency, numerical_jacobian.

Otherwise the changes are saved automatically when start() is called.

@prevent_deleted
def set_shared_files(handles: List[rawapi.InputFile]) -> None

Takes a list of project shared file handles and marks them to be used with this simulation. To remove files, remove them from the list and set again.

Arguments:

  • handles - List of project shared file handles to use in the simulation
@prevent_deleted
def add_input_file_from_simulation(
source_simulation: Self | str,
source_file_name: str,
target_file_name: str,
source_sweep_step: int | None = None,
target_sweep_step: int | None = None,
target_rank: int | None = None) -> rawapi.SimulationInputFile

Add a simulation output file written by another simulation as an input file for this simulation.

Arguments:

  • source_simulation - Source simulation or source simulation ID.
  • source_file_name - Source file name in the source simulation.
  • target_file_name - Target file name in this simulation.
  • source_sweep_step - Optional source sweep step index.
  • target_sweep_step - Optional target sweep step index in this simulation.
  • target_rank - Optional target rank index.

Returns:

The created input file handle.

@prevent_deleted
def add_input_value_outputs_from_simulation(
source_simulation: Self | str,
target_file_name: str,
source_sweep_step: int | None = None,
target_sweep_step: int | None = None,
target_rank: int | None = None) -> rawapi.SimulationInputFile

Add a simulation value outputs written by another simulation as an input for this simulation.

Arguments:

  • source_simulation - Source simulation or source simulation ID.
  • target_file_name - Target file name in this simulation.
  • source_sweep_step - Optional source sweep step index.
  • target_sweep_step - Optional target sweep step index in this simulation.
  • target_rank - Optional target rank index.

Returns:

The created input file handle.

@prevent_deleted
def add_file(filepath: str) -> rawapi.InputFile

Add the file in the given path to the simulation as an input file.

Arguments:

  • filepath - path to a file in the local system. If used in a simulation, it is available with its basename.

Returns:

The file handle.

Raises:

  • FileExistsError - If a file with the same name already exists and is fully uploaded.
@prevent_deleted
def add_json_file(name: str, content: dict) -> rawapi.InputFile

Add a JSON file to the simulation with the given dictionary serialized into JSON as content.

Arguments:

  • name - The name for the file during the simulation
  • content - dictionary containing your data

Returns:

The file handle.

Raises:

  • FileExistsError - If a file with the same name already exists and is fully uploaded.
@prevent_deleted
def run(print_logs: bool = False, refresh_delay_s: float = 1) -> None

Runs the simulation and returns when the processing is complete.

Arguments:

  • print_logs - If True, print logs to the console.
  • refresh_delay_s - Optional delay in seconds between checking the status of the job.
@prevent_deleted
def start() -> None

Start the simulation.

@prevent_deleted
def abort() -> None

Abort the simulation.

@prevent_deleted
def get_output_csv(
delimiter=",",
refresh: bool = False,
csv_format: CsvExportFormat = CsvExportFormat.EXPLODED) -> str

Get the output of the simulation in CSV format.

Arguments:

  • delimiter - The delimiter to use in the CSV file.
  • refresh - Whether to refresh the output data.
  • csv_format - The format of the CSV file.

Returns:

String containing the output of the simulation in CSV format.

@prevent_deleted
def get_output_data(refresh: bool = True) -> SimulationOutputData

Returns the output data of the simulation.

Arguments:

  • refresh - Whether to refresh the output data.

Returns:

allsolve.sim.SimulationOutputData object

@prevent_deleted
def get_output_values(sweep_index: int = 0, refresh: bool = False) -> dict

Get the output values of the simulation.

Arguments:

  • sweep_index - The index of the sweep.
  • refresh - Whether to refresh the output values.

Returns:

The output values of the simulation.

@prevent_deleted
def clean_output_data_cache() -> None

Clean the output data cache for this simulation. This invalidates any existing SimulationOutputData objects for this simulation.

@prevent_deleted
def save_output_field(name: str,
output_dir: str = "./",
sweep_index: int = 0,
step_index: int | None = None) -> None

Save the output field of the simulation.

Arguments:

  • name - The name of the field to save.
  • output_dir - The directory to save the field to.
  • sweep_index - The optional index of the sweep.
  • step_index - The optional index of the step or None.
@prevent_deleted
def save_output_mesh(name: str,
output_dir: str = "./",
sweep_index: int = 0,
step_index: int | None = None) -> None

Save the output mesh of the simulation.

Arguments:

  • name - The name of the mesh to save.
  • output_dir - The directory to save the mesh to.
  • sweep_index - The optional index of the sweep.
  • step_index - The optional index of the step or None.
@prevent_deleted
def save_output_files(filenames: List[str],
output_dir: str = "./",
sweep_index: int = 0,
step_index: int | None = None) -> None

Save the output files of the simulation.

Arguments:

  • filenames - The names of the files to save.
  • output_dir - The directory to save the files to.
  • sweep_index - The optional index of the sweep.
  • step_index - The optional index of the step or None.
@prevent_deleted
def copy() -> Self

Make a copy of the simulation. Useful for creating simulations from a template.

Returns:

The copied simulation.

@prevent_deleted
def delete() -> None

Delete the simulation from the project. After deletion, the Simulation object cannot be used and should be discarded.

allsolve.simulation.simulation_output_database

Section titled “allsolve.simulation.simulation_output_database”
class InfoRow(_Row)

The root job id in case of sweep simulations.

class SimulationOutput()

Sweep step job id or the main job id in case of non-sweep simulations.

Sweep step index.

Sweep step overrides by variable name.

class SimulationStepRow(_Row)

The raw string representation of the step. This is needed to preserve the format used in the field output files.

The step as a float. None if no step was specified when the value was created in the simulation.

class FieldOutputDefinitionRow(_Row)

The type of the field.

The user specified name for the field output.

An optional specifier added by the user or by the code generator. For example, some field outputs produce both real and imaginary parts, even though the user has just specified a single output. In this case the name of both fields will be the user specified name, but the specifier will be "real" or "imaginary".

Users can also give any specifier they want in modified or custom scripts.

A format string to produce the file names of field outputs. The format string will have placeholders {step} and {rank}. To get the file name, use the raw string step SimulationStepRow._step to replace {step} and the rank integer to replace {rank}.

The prefix part of file_name_format. Only contains the name and optionally the specifier in a filename friendly format.

The ranks that produced this field output.

class ValueOutputDefinitionRow(_Row)

The user specified name for the value output.

An optional specifier added by the user or by the code generator. For example, some value outputs produce both real and imaginary parts, even though the user has just specified a single output. In this case the name of both values will be the user specified name, but the specifier will be "real" or "imaginary".

class BlobDatabase()

All the data of the blob database. To get the data of the blob with id blob_id, use db.data[db.offsets[blob_id - 1] : db.offsets[blob_id]])].

class SimulationOutputDatabase()
def get_value_data(value: ValueOutput) -> array.array[float]

Get data for a value output.

allsolve.simulation.simulation_output_data

Section titled “allsolve.simulation.simulation_output_data”
class CsvExportFormat(Enum)

The format of the CSV file. EXPLODED format outputs one row per value. Exploded format is slower with large datasets. NORMAL format outputs one row per step. When multiple values are present per step, the values are output as an array. Normal format is faster with large datasets.

Value identifier consists of the name and the specifier.

Value header or value id. Value header is the value name followed by the specifier in parentheses. If the specifier is None, the parentheses are not included.

class SimulationOutputData()
def refresh() -> None

Download the simulation output data. Data is stored in the cache directory.

def clean_cache() -> None

Clean the local output data cache directory for this simulation. To use output data again, you need to call refresh to download the data again.

def to_dict(
sweep_index: int = 0,
include_overrides: bool = False) -> dict[str, dict[str, list[float]]]

Returns the value output data of a single sweep step as a dictionary.

Arguments:

  • sweep_index - The sweep step index.
  • include_overrides - If True, variable override values for the sweep step are included as additional entries in each step’s dictionary.
def to_csv_stream(delimiter=",",
stream: TextIO | None = None,
csv_format: CsvExportFormat = CsvExportFormat.EXPLODED,
include_overrides: bool = False) -> StringIO | None

Write CSV data to a stream.

Arguments:

  • delimiter - The delimiter to use in the CSV output.
  • stream - Optional stream to write to.
  • include_overrides - If True, variable override values for each sweep step are included as additional columns in the CSV output.

Returns:

None if stream was provided, StringIO if no stream was provided.

Examples:

csv_stream = data.to_csv_stream()

with open(“output.csv”, “w”) as f: data.to_csv_stream(stream=f)

def get_value_headers() -> list[str]

Returns header strings of all value outputs. The header equals the name of the value output plus the specifier if it was provided. The specifier is included after the name in parentheses.

Examples:

  • Name “Resistance” and no specifier —> “Resistance”
  • Name “Impedance” and specifier “real” —> “Impedance (real)“
def get_value_ids() -> list[ValueId]

Returns the identifier tuples of all value outputs. An identifier tuple consists of the name and the specifier.

Examples:

  • Name “Resistance” and no specifier —> (“Resistance”, None)
  • Name “Impedance” and specifier “real” —> (“Impedance”, “real”)
def get_sweep_step_overrides() -> list[dict[str, list[float]]]

Returns the variable overrides for each sweep step. The returned list can be used to find the sweep index based on a variable’s value.

The following example finds the index of the sweep step where “my_variable” had the value 42:

overrides = data.get_sweep_step_overrides()
sweep_index = -1
for i, step_overrides in enumerate(overrides):
if step_overrides["my_variable"][0] == 42:
sweep_index = i
break

The found sweep index can then be passed into various methods of this class to get the data of that sweep step.

For simple key-value pairs, use the get_sweep_index method.

def get_sweep_index(variable_name: str, value: float | list[float]) -> int

Finds the sweep index based on a variable name and a value.

If multiple sweep steps have the same variable name and value, the first one found is returned.

Examples:

# Get the sweep index for the variable "my_variable" with the value 42
sweep_index = data.get_sweep_index("my_variable", 42)
# Get the sweep index for the variable "my_variable" with the value [1.0, 2.0]
sweep_index = data.get_sweep_index("my_variable", [1.0, 2.0])

If you meed more fine-grained control, use the get_sweep_step_overrides method.

def get_sweep_count() -> int

Returns the total number of sweep steps.

def get_step_count(sweep_index: int | None = None) -> int

Returns the total number of steps. This function returns the number of time steps in transient simulations and the number of eigenmodes in eigenvalue simulations. This is not to be confused with sweep steps. Each sweep step can have multiple steps.

If no value is passed in, the total number of steps is returned. Note that each sweep step can have different set of steps. All steps are not necessarily present in all sweep steps.

If a sweep index is passed in, the number of steps in that sweep step is returned.

def get_step_labels() -> list[str]

Returns the labels of all steps. A label is the string representation of a step. A step here means the time step in a transient simulation or the eigenmode index in an eigenvalue simulation. This is not to be confused with sweep steps. Each sweep step can have multiple steps.

The label can either be a stringified numeric value or the special string SimulationOutputData.NO_STEP. NO_STEP is used as the step label when data is saved without specifying a step.

def get_step_label(step_index: int) -> str

Returns the step_indexth value of the get_step_labels list.

def get_step_index(step_label: str | float | int | None) -> int

Finds the step index based on a label or a numeric value. A step here means the time step in a transient simulation or the eigenmode index in an eigenvalue simulation. This is not to be confused with sweep steps. Each sweep step can have multiple steps.

Examples:

# Get the step index for the step label "0.2"
step_index = data.get_step_index("0.2")
# Get the step index for the step whose numeric value is 1.0
step_index = data.get_step_index(1.0)
# Get the the step index for data that was saved without specifying a step
step_index = data.get_step_index(SimulationOutputData.NO_STEP)
  • NOTE - It’s always better find using a float value than the string string label. If you use the string representation of a float value, it needs to be exactly the same as the one stored in the database. There’s no guarantee that the string representation was produced using str(float_value).
def get_array_index_count_at(sweep_index: int, step_index: int,
value_header: ValueHeaderOrId) -> int

Equivalent to len(get_values_at(sweep_index, step_index, value_header)).

def get_value_at(sweep_index: int,
step_index: int,
value_header: ValueHeaderOrId,
array_index: int | None = None) -> float | None

Equivalent to get_values_at(sweep_index, step_index, value_header)[array_index].

def get_values_at(sweep_index: int, step_index: int,
value_header: ValueHeaderOrId) -> list[float] | None

Returns the value output data of the value identified by value_header at the given sweep index and step index. See the get_sweep_index and get_step_index methods for more information on how to determine the sweep index and step index.

The value_header can either be:

  • A string representing the value header. For example, “Impedance (real)” where “Impedance” is the name and “real” is the specifier. If there’s no specifier, the header is just the value output’s name, so in this case “Impedance”.

  • A tuple consisting of the name and the specifier. For example, (“Impedance”, “real”) where “Impedance” is the name and “real” is the specifier. If there’s no specifier, the tuple still needs to contain two elements: the name and None. For example (“Impedance”, None). But in case there’s no specifier, you can just pass in the name as a string since it matches the header format.

Examples:

sweep_index = data.get_sweep_index("my_variable", 42)
step_index = data.get_step_index(0.1)
# Get the resistance at the given sweep index and step index.
values = data.get_values_at(sweep_index, step_index, "Resistance")
# Get the real part of the impedance at the given sweep index and step index.
values = data.get_values_at(sweep_index, step_index, ("Impedance", "real"))
# Get the real part of the impedance using a header string
values = data.get_values_at(sweep_index, step_index, "Impedance (real)")
class ExtrusionLayerDefinition()

A layer definition for SlantedExtrusion, PathExtrusion and FlattenAndRebuildExtrusion.

Arguments:

  • relative_height - The relative height of the layer.
  • sublayer_count - The number of sublayers in the layer.
class MeshRefinement()

A refinement for a mesh.

Arguments:

  • region - The region to refine.
  • max_size - The maximum size of the refinement.
class SlantedExtrusion()

A slanted extrusion for a mesh.

Arguments:

  • volumes - The volumes to extrude.
  • from_surfaces - The surfaces to extrude from.
  • to_surfaces - The surfaces to extrude to.
  • layers - The layers of the extrusion.
  • quadrangles - Whether to use quadrangles for the extrusion.
class PathExtrusion()

A path extrusion for a mesh.

Arguments:

  • volumes - The volumes to extrude.
  • from_surfaces - The surfaces to extrude from.
  • to_surfaces - The surfaces to extrude to.
  • layers - The layers of the extrusion.
  • quadrangles - Whether to use quadrangles for the extrusion.
class FlattenAndRebuildExtrusion()

A flatten and rebuild extrusion for a mesh.

Arguments:

  • volumes - The volumes to extrude.
  • layers - The layers of the extrusion.
  • quadrangles - Whether to use quadrangles for the extrusion.
  • direction_vector - The direction vector for the extrusion.
class MeshExtrusion()

A simple extrusion for a mesh.

Arguments:

  • regions - The regions to extrude.
  • sub_layer_counts - The number of sublayers for each layer.
  • extrusion_overlap_mode - The overlap mode for the extrusion.
class MeshDensity(Enum)

Enum for the density of a mesh.

class MeshQuality(Enum)

Enum for the quality of a mesh. @deprecated: Use MeshDensity instead.

class MeshSettings()

Container for settings that can be configured when creating a mesh.

class Mesh(JobMixin)

Mesh of a project geometry.

@classmethod
def create(cls,
project_id: str,
mesh_settings: MeshSettings | None = None) -> Self

Create a new mesh in the project.

Arguments:

  • project_id - The ID of the project to create the mesh in.
  • mesh_settings - Optional settings for the mesh.

Returns:

The created mesh.

@classmethod
def get(cls, mesh_id: str, project_id: str | None = None) -> Self

Get a mesh by its ID.

Arguments:

  • mesh_id - The ID of the mesh.
  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

The mesh.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all meshes in the project.

Arguments:

  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

A list of Mesh objects.

@property
@prevent_deleted
def id() -> str

Get the ID of the mesh.

@property
@prevent_deleted
def name() -> str

Get the name of the mesh.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def quality() -> MeshQuality

Get the quality of the mesh.

@quality.setter
@prevent_deleted
def quality(quality: MeshQuality) -> None

Set the quality of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def density() -> MeshDensity

Get the density of the mesh.

@density.setter
@prevent_deleted
def density(density: MeshDensity) -> None

Set the density of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def node_type() -> str | None

Get the node type of the mesh.

@node_type.setter
@prevent_deleted
def node_type(node_type: str) -> None

Set the node type of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def max_run_time_minutes() -> int

Get the maximum run time of the mesh.

@max_run_time_minutes.setter
@prevent_deleted
def max_run_time_minutes(max_run_time_minutes: int) -> None

Set the maximum run time of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def use_mesh_refiner() -> bool

Get whether the mesh uses the mesh refiner.

@use_mesh_refiner.setter
@prevent_deleted
def use_mesh_refiner(use_mesh_refiner: bool) -> None

Set whether the mesh uses the mesh refiner. Use save() to commit the change.

@property
@prevent_deleted
def mesh_size_min() -> float | None

Get the minimum mesh size of the mesh.

@mesh_size_min.setter
@prevent_deleted
def mesh_size_min(mesh_size_min: float) -> None

Set the minimum mesh size of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def mesh_size_max() -> float | None

Get the maximum mesh size of the mesh.

@mesh_size_max.setter
@prevent_deleted
def mesh_size_max(mesh_size_max: float) -> None

Set the maximum mesh size of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def scale_factor() -> float | None

Get the scale factor of the mesh.

@scale_factor.setter
@prevent_deleted
def scale_factor(scale_factor: float) -> None

Set the scale factor of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def curvature_enhancement() -> float | None

Get the curvature enhancement of the mesh.

@curvature_enhancement.setter
@prevent_deleted
def curvature_enhancement(curvature_enhancement: float) -> None

Set the curvature enhancement of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def curved_mesh() -> bool

Get whether the mesh is curved.

@curved_mesh.setter
@prevent_deleted
def curved_mesh(curved_mesh: bool) -> None

Set whether the mesh is curved. Use save() to commit the change.

@property
@prevent_deleted
def target_width_to_height_ratio() -> float | None

Get the target width to height ratio of the mesh.

@target_width_to_height_ratio.setter
@prevent_deleted
def target_width_to_height_ratio(target_width_to_height_ratio: float) -> None

Set the target width to height ratio of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def refinements() -> List[MeshRefinement] | None

Get the refinements of the mesh.

@refinements.setter
@prevent_deleted
def refinements(refinements: List[MeshRefinement]) -> None

Set the refinements of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def extrusion() -> MeshExtrusion | None

Get the extrusion of the mesh.

@extrusion.setter
@prevent_deleted
def extrusion(extrusion: MeshExtrusion) -> None

Set the extrusion of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def slanted_extrusions() -> List[SlantedExtrusion] | None

Get the extrusions of the mesh.

@slanted_extrusions.setter
@prevent_deleted
def set_slanted_extrusions(
slanted_extrusions: List[SlantedExtrusion] | None) -> None

Set the slanted extrusions of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def path_extrusions() -> List[PathExtrusion] | None

Get the path extrusions of the mesh.

@path_extrusions.setter
@prevent_deleted
def set_path_extrusions(path_extrusions: List[PathExtrusion] | None) -> None

Set the path extrusions of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def flatten_and_rebuild_extrusions(
) -> List[FlattenAndRebuildExtrusion] | None

Get the flatten and rebuild extrusions of the mesh.

@flatten_and_rebuild_extrusions.setter
@prevent_deleted
def set_flatten_and_rebuild_extrusions(
flatten_and_rebuild_extrusions: List[FlattenAndRebuildExtrusion] | None
) -> None

Set the flatten and rebuild extrusions of the mesh. Use save() to commit the change.

@property
@prevent_deleted
def variable_overrides() -> List[VariableOverrides] | None

Get the variable overrides of the mesh.

@variable_overrides.setter
@prevent_deleted
def variable_overrides(
variable_overrides: List[VariableOverrides] | None) -> None

Set the variable overrides of the mesh. Use save() to commit the change.

@prevent_deleted
def save() -> None

Explicitly save the changes to the cloud made by setting properties name, quality, node_type, max_run_time_minutes, mesh_size_min, mesh_size_max, scale_factor, curvature_enhancement, curved_mesh, refinements and variable_overrides.

@prevent_deleted
def start(variable_overrides_id: str | None = None) -> None

Start processing the mesh.

Arguments:

  • variable_overrides_id - Optional VariableOverrides id to use for the mesh.
@prevent_deleted
def run(variable_overrides_id: str | None = None,
print_logs: bool = False,
refresh_delay_s: float = 1) -> None

Process the mesh and returns when the processing is complete.

Arguments:

  • variable_overrides_id - Optional VariableOverrides id to use for the mesh.
  • print_logs - If True, print logs to the console.
  • refresh_delay_s - Optional delay in seconds between checking the status of the job.
@prevent_deleted
def abort() -> None

Abort the processing of the mesh.

@prevent_deleted
def get_status() -> str | None

Get the status of the processing of the mesh.

Returns:

The status of the processing of the mesh.

@prevent_deleted
def is_running(refresh_delay_s: float | None = None) -> bool

Check if the processing of the mesh is running.

Arguments:

  • refresh_delay_s - Optional delay in seconds between checking the status of the job.

Returns:

True if the processing of the mesh is running, False otherwise.

@prevent_deleted
def refresh_status(delay_s: float = 1) -> str | None

Refresh the status of the processing of the mesh.

Arguments:

  • delay_s - Optional delay in seconds between checking the status of the job.

Returns:

The status of the processing of the mesh.

@prevent_deleted
def get_logs(limit: int = 100) -> List[str]

Get the logs of the processing of the mesh.

Arguments:

  • limit - Optional maximum number of logs to return.

Returns:

The logs of the processing of the mesh.

@prevent_deleted
def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print the new log lines of the processing of the mesh.

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to print.
@prevent_deleted
def delete() -> None

Delete the mesh from the project.

@prevent_deleted
def copy(name: str | None = None) -> Self

Copy the mesh.

Arguments:

  • name - Optional name of the new mesh.

Returns:

The copied mesh.

@prevent_deleted
def save_mesh_file(output_dir: str = "./",
filename: str = "mesh.msh",
variable_overrides_id: str | None = None) -> None

Save the mesh file to a file on local file system.

By default, the mesh file is saved to the current working directory as mesh.msh.

Arguments:

  • output_dir - The optional directory to save the mesh file to.
  • filename - The optional filename to save the mesh file to.
  • variable_overrides_id - The optional variable overrides id to use for the mesh.

Export project data to a dictionary format compatible with import_project().

This module provides functionality to export project data including:

  • Project metadata (name, description, dimension, labels)
  • Variables and functions
  • Geometries (CAD elements)
  • Regions (basic, computed, region rules)
  • Materials
  • Physics (with nested interactions)
  • Variable overrides
  • Meshes
  • Simulations (with output interactions)

Notes:

CAD file paths and shared file paths are exported as placeholders. When re-importing, you must provide the actual files at those paths. Future versions may support optional file downloading.

def export_project_data(project: Project, include_meshes: bool = True) -> dict

Export project data to a dictionary compatible with import_project().

The exported dictionary contains:

  • Project metadata (name, description, dimension, labels)
  • Variables (topologically sorted)
  • Functions (regular and interpolated)
  • Geometries (CAD elements with placeholder paths for files)
  • Regions (basic, computed, region rules)
  • Materials
  • Physics (with nested interactions)
  • Variable overrides
  • Meshes (optional)
  • Simulations (optional, with output interactions)

Arguments:

  • project - The project to export.
  • include_meshes - Whether to include mesh definitions (default True).
  • Note - Exported meshes are definitions only; mesh data is not included.

Returns:

Dictionary containing the project data, compatible with import_project().

Notes:

CAD file paths (STEP, IGES, etc.) and shared file paths are exported as placeholders in the format “placeholder:original_path”. When re-importing, you must provide the actual files at the specified paths.

Future versions may support optional file downloading.

Example:

from allsolve import Project project = Project.get(“my-project-id”) data = export_project_data(project)

data[“name”] = “Modified Project”

from allsolve import import_project new_project = import_project(data)

def is_setup() -> bool

Check if the Allsolve API client has been initialized.

def get_cache_dir() -> str | None

Get the cache directory path. The cache directory is created in the cache_base_dir directory, which can be set in setup method.

def setup(api_key: str,
api_secret: str,
host="http://localhost:3001",
cache_base_dir: str = os.getcwd())

Initialize the Allsolve API client and perform authentication.

Arguments:

  • api_key - The API key.
  • api_secret - The API secret.
  • host - The host to use.
  • cache_base_dir - Optional directory path for caching simulation data. If not provided, then cache directory will be created in the current working directory.

Raises:

Can raise exception if the authentication request to the Allsolve API fails.

def clean_cache() -> None

Delete the cache directory used by all Allsolve projects.

def delete_file(handle: rawapi.InputFile,
project_id: str | None = None) -> None

Delete a file from the project.

Arguments:

  • handle - The handle of the file to delete.
  • project_id - The project ID. Can be omitted when using a project API key.
class GDSUnit()

GDSUnit describes a unit in GDS2 file.

@property
def value() -> str | None

Get the value of the GDS unit.

@value.setter
def value(value: str | None) -> None

Set the value of the GDS unit.

class GDSAbsoluteLayer()

GDSAbsoluteLayer describes a layer in GDS2 file with thickness and absolute z0.

@property
def name() -> str

Get the name of the layer.

@name.setter
def name(value: str) -> None

Set the name of the layer.

@property
def absolute_z0() -> GDSUnit

Get the absolute z0 of the layer.

@absolute_z0.setter
def absolute_z0(value: GDSUnit) -> None

Set the absolute z0 of the layer.

@property
def disabled() -> bool

Get the disabled state of the layer.

@disabled.setter
def disabled(value: bool) -> None

Set the disabled state of the layer.

class GDSStackedLayer()

GDSStackedLayer describes a layer in GDS2 file with thickness. Z0 is calculated from previous layers.

@property
def name() -> str

Get the name of the layer.

@name.setter
def name(value: str) -> None

Set the name of the layer.

@property
def thickness() -> GDSUnit

Get the thickness of the layer.

@thickness.setter
def thickness(value: GDSUnit) -> None

Set the thickness of the layer.

@property
def disabled() -> bool

Get the disabled state of the layer.

@disabled.setter
def disabled(value: bool) -> None

Set the disabled state of the layer.

class GDS2ImportConfig()

GDS2ImportConfig holds parameters for importing a geometry from a GDS2 file. Configuration requires an unit and layers defined in absolute or/and stacked order. Each layer should have thickness and a name as defined in the GDS2 file. Absolute layers should have also absolute z0.

@property
def unit() -> GeometryUnit

Get the unit of the GDSImportConfig.

class GeometryElement()

GeometryElement is a base class for importing a geometry to a project.

class ImportGeometry()

ImportGeometry is a base class for importing a geometry to a project from a file.

class ImportStep(ImportGeometry)

ImportStep is a class for importing a STEP file to a project.

class ImportIges(ImportGeometry)

ImportIges is a class for importing an IGES file to a project.

class ImportBrep(ImportGeometry)

ImportBrep is a class for importing a BREP file to a project.

class ImportSat(ImportGeometry)

ImportSat is a class for importing a SAT file to a project.

class ImportMsh(ImportGeometry)

ImportMsh is a class for importing a MSH file to a project.

class ImportNas(ImportGeometry)

ImportNas is a class for importing a NAS file to a project.

class ImportGds2(ImportGeometry)

ImportGds2 is a class for importing a GDS2 file to a project.

class CadGeometryType(Enum)

Enum for CAD geometry element types.

class CadGeometryElement(abc.ABC)

CadGeometryElement is a base class for creating CAD geometry programmatically. Subclasses provide convenient ways to create specific geometry types like boxes, cylinders, etc.

@property
@prevent_deleted
def id() -> str | None

Get the ID of the geometry element.

@property
@prevent_deleted
def project_id() -> str

Get the project ID of the geometry element.

@property
@prevent_deleted
def name() -> str | None

Get the name of the geometry element.

@name.setter
def name(value: str | None) -> None

Set the name of the geometry element.

@property
@prevent_deleted
def enabled() -> str | bool | None

Get the enabled state of the geometry element. Can be a boolean or a string expression.

@enabled.setter
def enabled(value: str | bool | None) -> None

Set the enabled state of the geometry element. Can be a boolean or a string expression.

@property
@abc.abstractmethod
def type() -> CadGeometryType

Get the type of the geometry element.

Returns:

The CadGeometryType enum value for this geometry element.

@prevent_deleted
def delete() -> None

Delete the geometry element from the project.

@prevent_deleted
def save() -> None

Save the changes to the geometry element. Calling save() on a geometry element that is not added to the project using GeometryBuilder will raise a ValueError.

class CadTranslate(CadGeometryElement)

CadTranslate represents a translate of a CAD geometry element.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def entity_tags() -> list[int] | None

Get the entity tags of the translate.

@entity_tags.setter
@prevent_deleted
def entity_tags(entity_tags: list[int] | None) -> None

Set the entity tags of the translate.

@property
@prevent_deleted
def cad_names() -> list[str] | None

Get the CAD names of the union.

@cad_names.setter
@prevent_deleted
def cad_names(cad_names: list[str] | None) -> None

Set the CAD names of the translate.

@property
@prevent_deleted
def cad_paths() -> list[CadPath] | None

Get the CAD paths of the translate.

@cad_paths.setter
@prevent_deleted
def cad_paths(cad_paths: list[CadPath] | None) -> None

Set the CAD paths of the translate.

@property
@prevent_deleted
def translation() -> tuple[float | str, float | str, float | str] | None

Get the translation vector.

@translation.setter
@prevent_deleted
def translation(
translation: tuple[float | str, float | str, float | str]) -> None

Set the translation vector.

@property
@prevent_deleted
def copy_object() -> bool

Get the copy_object flag.

@copy_object.setter
@prevent_deleted
def copy_object(copy_object: bool) -> None

Set the copy_object flag.

@property
@prevent_deleted
def repeat() -> int | str | None

Get the repeat count.

@repeat.setter
@prevent_deleted
def repeat(repeat: int | str | None) -> None

Set the repeat count.

class CadRotate(CadGeometryElement)

CadRotate represents a rotation of a CAD geometry element.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def entity_tags() -> list[int] | None

Get the entity tags of the rotate.

@entity_tags.setter
@prevent_deleted
def entity_tags(entity_tags: list[int] | None) -> None

Set the entity tags of the rotate.

@property
@prevent_deleted
def cad_names() -> list[str] | None

Get the CAD names of the rotate.

@cad_names.setter
@prevent_deleted
def cad_names(cad_names: list[str] | None) -> None

Set the CAD names of the rotate.

@property
@prevent_deleted
def cad_paths() -> list[CadPath] | None

Get the CAD paths of the rotate.

@cad_paths.setter
@prevent_deleted
def cad_paths(cad_paths: list[CadPath] | None) -> None

Set the CAD paths of the rotate.

@property
@prevent_deleted
def axis() -> tuple[float | str, float | str, float | str]

Get the rotation axis vector.

@axis.setter
@prevent_deleted
def axis(axis: tuple[float | str, float | str, float | str]) -> None

Set the rotation axis vector.

@property
@prevent_deleted
def center() -> tuple[float | str, float | str, float | str]

Get the center point for rotation.

@center.setter
@prevent_deleted
def center(center: tuple[float | str, float | str, float | str]) -> None

Set the center point for rotation.

@property
@prevent_deleted
def angle() -> float | str

Get the rotation angle.

@angle.setter
@prevent_deleted
def angle(angle: float | str) -> None

Set the rotation angle.

@property
@prevent_deleted
def copy_object() -> bool

Get the copy_object flag.

@copy_object.setter
@prevent_deleted
def copy_object(copy_object: bool) -> None

Set the copy_object flag.

@property
@prevent_deleted
def repeat() -> int | str | None

Get the repeat count.

@repeat.setter
@prevent_deleted
def repeat(repeat: int | str | None) -> None

Set the repeat count.

class CadGrid(CadGeometryElement)

CadGrid represents a grid pattern of CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def entity_tags() -> list[int] | None

Get the entity tags of the grid.

@entity_tags.setter
@prevent_deleted
def entity_tags(entity_tags: list[int] | None) -> None

Set the entity tags of the grid.

@property
@prevent_deleted
def cad_names() -> list[str] | None

Get the CAD names of the grid.

@cad_names.setter
@prevent_deleted
def cad_names(cad_names: list[str] | None) -> None

Set the CAD names of the grid.

@property
@prevent_deleted
def cad_paths() -> list[CadPath] | None

Get the CAD paths of the grid.

@cad_paths.setter
@prevent_deleted
def cad_paths(cad_paths: list[CadPath] | None) -> None

Set the CAD paths of the grid.

@property
@prevent_deleted
def translation() -> tuple[float | str, float | str, float | str]

Get the translation vector for grid spacing.

@translation.setter
@prevent_deleted
def translation(
translation: tuple[float | str, float | str, float | str]) -> None

Set the translation vector for grid spacing.

@property
@prevent_deleted
def size() -> tuple[int | str, int | str, int | str]

Get the grid size as a tuple of 3 positive integers (x, y, z).

@size.setter
@prevent_deleted
def size(size: tuple[int | str, int | str, int | str]) -> None

Set the grid size as a tuple of 3 positive integers (x, y, z).

class CadRemove(CadGeometryElement)

CadRemove represents a removal of CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def entity_tags() -> list[int] | None

Get the entity tags of the remove.

@entity_tags.setter
@prevent_deleted
def entity_tags(entity_tags: list[int] | None) -> None

Set the entity tags of the remove.

@property
@prevent_deleted
def cad_names() -> list[str] | None

Get the CAD names of the remove.

@cad_names.setter
@prevent_deleted
def cad_names(cad_names: list[str] | None) -> None

Set the CAD names of the remove.

@property
@prevent_deleted
def cad_paths() -> list[CadPath] | None

Get the CAD paths of the remove.

@cad_paths.setter
@prevent_deleted
def cad_paths(cad_paths: list[CadPath] | None) -> None

Set the CAD paths of the remove.

class CadUnion(CadGeometryElement)

CadUnion represents a union of two or more CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def entity_tags() -> list[int] | None

Get the entity tags of the union.

@entity_tags.setter
@prevent_deleted
def entity_tags(entity_tags: list[int] | None) -> None

Set the entity tags of the union.

@property
@prevent_deleted
def cad_names() -> list[str] | None

Get the CAD names of the union.

@cad_names.setter
@prevent_deleted
def cad_names(cad_names: list[str] | None) -> None

Set the CAD names of the union.

@property
@prevent_deleted
def cad_paths() -> list[CadPath] | None

Get the CAD paths of the union.

@cad_paths.setter
@prevent_deleted
def cad_paths(cad_paths: list[CadPath] | None) -> None

Set the CAD paths of the union.

class CadDifference(_CadBinaryBooleanOperation)

CadDifference represents a difference of two or more CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadIntersection(_CadBinaryBooleanOperation)

CadIntersectionOperation represents an intersection of two or more CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadFragments(_CadBinaryBooleanOperation)

CadFragments represents a fragments operation of two or more CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadFragmentAll(CadGeometryElement)

CadFragmentAll represents a fragment all operation that fragments all CAD geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

Utility functions for converting between Python types and CAD geometry API types.

This module provides conversion functions for creating and extracting values from raw API CAD geometry objects.

def to_str_list(value: str | list[str] | None) -> list[str] | None

Python runtime allows for a single string to be passed as a list of strings. This function converts a single string to a list of strings.

def extract_entities_from_elements(
elements: list[rawapi.CadEntity]
) -> tuple[list[int], list[str], list[CadPath]]

Extract entity_tags, cad_names from rawapi CadEntity elements.

def validate_cad_path(cad_path: CadPath) -> None

Validate a CAD path.

def validate_entity_set(entity_tags: list[int] | None,
cad_names: list[str] | None,
cad_paths: list[CadPath] | None, set_name: str,
operation_name: str) -> None

Validate that at least one entity set is provided and non-empty.

def create_cad_entities_from_lists(
entity_tags: list[int] | None, cad_names: list[str] | None,
cad_paths: list[CadPath] | None) -> list[rawapi.CadEntity]

Create CadEntity list from entity_tags, cad_names, cad_paths.

def create_boolean(value: bool | str | None) -> rawapi.CadBoolean | None

Create a CadBoolean from a boolean or string expression.

def create_scalar(value: float | str) -> rawapi.CadScalar

Create a CadScalar from a numeric value or expression string.

def create_angular_unit(unit: str | None) -> rawapi.CadAngularUnit | None

Create a CadAngularUnit from a string. Allowed values are: degree, radian.

def create_distance_unit(unit: str | None) -> rawapi.CadDistanceUnit | None

Create a CadDistanceUnit from a string. Allowed values are: m, meter, mm, millimeter, um, micrometer, nm, nanometer, yard, foot, inch.

def create_distance(value: float | str | tuple[float | str, str],
default_unit: str | None = None) -> rawapi.CadDistance

Create a CadDistance from a value with optional unit.

def create_angle(value: float | str,
default_unit: str | None = "degree") -> rawapi.CadAngle

Create a CadAngle from a value with optional unit.

def create_vector(
coords: tuple[float | str, float | str,
float | str]) -> rawapi.CadVector

Create a CadVector from a tuple of coordinates.

def create_vector_2d(
coords: tuple[float | str, float | str]) -> rawapi.CadVector

Create a CadVector from a 2D tuple of coordinates (z will be 0).

def create_euler_angles(
angles: tuple[float | str, float | str,
float | str]) -> rawapi.CadEulerAngles

Create CadEulerAngles from a tuple of angles in degrees.

def from_boolean(boolean: rawapi.CadBoolean | None) -> bool | str | None

Convert a CadBoolean to a boolean or string expression.

def from_scalar(scalar: rawapi.CadScalar) -> float | str

Convert a CadScalar to a float or string.

Returns:

The numeric value if set, or the expression string if set.

Raises:

  • ValueError - If neither value nor expression is set.
def from_distance(distance: rawapi.CadDistance) -> float | str

Convert a CadDistance to a value or expression.

Note: Unit information is not preserved in the conversion.

Returns:

The numeric value if set, or the expression string if set.

Raises:

  • ValueError - If the distance value is not set.
def from_angle(angle: rawapi.CadAngle) -> float | str

Convert a CadAngle to a float or string.

Returns:

The numeric value if set, or the expression string if set.

Raises:

  • ValueError - If the angle value is not set.
def from_vector(
vector: rawapi.CadVector
) -> tuple[float | str, float | str, float | str]

Convert a CadVector to a tuple of coordinates.

Returns:

Tuple of (x, y, z) where each is float or str.

Raises:

  • ValueError - If any component is not set.
def from_vector_2d(
vector: rawapi.CadVector) -> tuple[float | str, float | str]

Convert a CadVector to a tuple of 2D coordinates.

def from_euler_angles(
angles: rawapi.CadEulerAngles | None
) -> tuple[float | str, float | str, float | str] | None

Convert CadEulerAngles to a tuple of angles.

Returns:

Tuple of (x, y, z) angles, or None if input is None.

Raises:

  • ValueError - If angles is not None but any component is not set.
class Geometry(JobMixin)

Geometry for a project.

@classmethod
@deprecated("Use geometry pipeline version V2 for new projects")
def create(cls, geometry_imports: List[GeometryElement.ImportGeometry],
project_id: str) -> Self

Create a new geometry element in the given project. Uploads the geometry file to the project.

Arguments:

  • geometry_imports - A list of geometry import objects. Currently only one geometry import per project is supported.
  • project_id - The id of the project where the new geometry element should be created.

Returns:

The created geometry element.

@classmethod
def get(cls, project_id: str) -> List[Self]

Get list of Geometry objects in the given project. Currently only one Geometry per project is supported.

Arguments:

  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

A list of Geometry objects.

@classmethod
def delete_geometry(cls: type[Self], project_id: str) -> None

Delete the geometry from the project.

@property
@prevent_deleted
def id() -> str

Get the ID of the geometry element.

@property
@prevent_deleted
def name() -> str

Get the name of the geometry element.

@property
@prevent_deleted
def file_uploaded_at() -> datetime | None

Get the time the geometry file was uploaded.

@deprecated("Use geometry pipeline version V2 for new projects")
@prevent_deleted
def start() -> None

Start processing the imported geometry file.

@deprecated("Use geometry pipeline version V2 for new projects")
@prevent_deleted
def run(print_logs: bool = False, refresh_delay_s: float = 1) -> None

Processes the imported geometry file and returns when the processing is complete.

Arguments:

  • print_logs - If True, print logs to the console.
  • refresh_delay_s - Optional delay in seconds between checking the status of the job.
@prevent_deleted
def abort() -> None

Abort the processing of the geometry file.

@prevent_deleted
def get_status() -> str | None

Get the status of the processing of the geometry file.

Returns:

The status of the processing of the geometry file.

@prevent_deleted
def is_running(refresh_delay_s: float | None = None) -> bool

Check if the processing of the geometry file is running.

Arguments:

  • refresh_delay_s - Optional delay in seconds between checking the status of the job.

Returns:

True if the processing of the geometry file is running, False otherwise.

@prevent_deleted
def refresh_status(delay_s: float = 1) -> str | None

Refresh the status of the processing of the geometry file.

Arguments:

  • delay_s - Optional delay in seconds between checking the status of the job.

Returns:

The status of the processing of the geometry file.

@prevent_deleted
def get_logs(limit: int = 100) -> List[str]

Get the logs of the processing of the imported geometry file.

Arguments:

  • limit - Optional maximum number of logs to return.

Returns:

A list of log messages.

@prevent_deleted
def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print the new log lines of the processing of the imported geometry file.

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to print.
@prevent_deleted
def delete() -> None

Delete the geometry from the project.

class CadPoint()

CadPoint is a class for representing a CAD point.

@classmethod
def from_region(cls, region: Region) -> Self

Create a CadPoint from a Region. Region must contain exactly one point entity tag.

class CadBox(CadGeometryElement)

Box represents a rectangular box geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str, float | str]

Get the position of the box.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str, float | str]) -> None

Set the position of the box.

@property
@prevent_deleted
def size() -> tuple[float | str, float | str, float | str]

Get the size of the box.

@size.setter
@prevent_deleted
def size(size: tuple[float | str, float | str, float | str]) -> None

Set the size of the box.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the box.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the box.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadCylinder(CadGeometryElement)

Cylinder represents a cylindrical geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str, float | str]

Get the position of the cylinder.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str, float | str]) -> None

Set the position of the cylinder.

@property
@prevent_deleted
def axis() -> tuple[float | str, float | str, float | str]

Get the axis of the cylinder.

@axis.setter
@prevent_deleted
def axis(axis: tuple[float | str, float | str, float | str]) -> None

Set the axis of the cylinder.

@property
@prevent_deleted
def radius() -> float | str

Get the radius of the cylinder.

@radius.setter
@prevent_deleted
def radius(radius: float | str) -> None

Set the radius of the cylinder.

@property
@prevent_deleted
def angle() -> float | str | None

Get the angle of the cylinder.

@angle.setter
@prevent_deleted
def angle(angle: float | str | None) -> None

Set the angle of the cylinder.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the cylinder.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the cylinder.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadSphere(CadGeometryElement)

Sphere represents a spherical geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str, float | str]

Get the position of the sphere.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str, float | str]) -> None

Set the position of the sphere.

@property
@prevent_deleted
def radius() -> float | str

Get the radius of the sphere.

@radius.setter
@prevent_deleted
def radius(radius: float | str) -> None

Set the radius of the sphere.

@property
@prevent_deleted
def angle1() -> float | str | None

Get the first angle of the sphere.

@angle1.setter
@prevent_deleted
def angle1(angle1: float | str | None) -> None

Set the first angle of the sphere.

@property
@prevent_deleted
def angle2() -> float | str | None

Get the second angle of the sphere.

@angle2.setter
@prevent_deleted
def angle2(angle2: float | str | None) -> None

Set the second angle of the sphere.

@property
@prevent_deleted
def angle3() -> float | str | None

Get the third angle of the sphere.

@angle3.setter
@prevent_deleted
def angle3(angle3: float | str | None) -> None

Set the third angle of the sphere.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the sphere.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the sphere.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadCone(CadGeometryElement)

Cone represents a conical geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str, float | str]

Get the position of the cone.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str, float | str]) -> None

Set the position of the cone.

@property
@prevent_deleted
def axis() -> tuple[float | str, float | str, float | str]

Get the axis of the cone.

@axis.setter
@prevent_deleted
def axis(axis: tuple[float | str, float | str, float | str]) -> None

Set the axis of the cone.

@property
@prevent_deleted
def radius1() -> float | str

Get the base radius of the cone.

@radius1.setter
@prevent_deleted
def radius1(radius1: float | str) -> None

Set the base radius of the cone.

@property
@prevent_deleted
def radius2() -> float | str

Get the top radius of the cone.

@radius2.setter
@prevent_deleted
def radius2(radius2: float | str) -> None

Set the top radius of the cone.

@property
@prevent_deleted
def angle() -> float | str | None

Get the angle of the cone.

@angle.setter
@prevent_deleted
def angle(angle: float | str | None) -> None

Set the angle of the cone.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the cone.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the cone.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadTorus(CadGeometryElement)

Torus represents a toroidal geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str, float | str]

Get the position of the torus.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str, float | str]) -> None

Set the position of the torus.

@property
@prevent_deleted
def radius1() -> float | str

Get the outer radius of the torus.

@radius1.setter
@prevent_deleted
def radius1(radius1: float | str) -> None

Set the outer radius of the torus.

@property
@prevent_deleted
def radius2() -> float | str

Get the width of the torus ring.

@radius2.setter
@prevent_deleted
def radius2(radius2: float | str) -> None

Set the width of the torus ring.

@property
@prevent_deleted
def angle() -> float | str | None

Get the angle of the torus.

@angle.setter
@prevent_deleted
def angle(angle: float | str | None) -> None

Set the angle of the torus.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the torus.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the torus.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadSurfaceRectangle(CadGeometryElement)

CadSurfaceRectangle represents a surface rectangle geometry.

@property
@prevent_deleted
def size() -> tuple[float | str, float | str]

Get the size of the surface rectangle.

@size.setter
@prevent_deleted
def size(size: tuple[float | str, float | str]) -> None

Set the size of the surface rectangle.

@property
@prevent_deleted
def offset() -> tuple[float | str, float | str, float | str]

Get the offset of the surface rectangle.

@offset.setter
@prevent_deleted
def offset(offset: tuple[float | str, float | str, float | str]) -> None

Set the offset of the surface rectangle.

@property
@prevent_deleted
def origin_point() -> CadPoint

Get the origin point CAD entity.

@origin_point.setter
@prevent_deleted
def origin_point(origin_point: CadPoint) -> None

Set the origin point CAD entity.

@property
@prevent_deleted
def main_axis_point() -> CadPoint

Get the main axis point CAD entity.

@main_axis_point.setter
@prevent_deleted
def main_axis_point(main_axis_point: CadPoint) -> None

Set the main axis point CAD entity.

@property
@prevent_deleted
def secondary_axis_point() -> CadPoint

Get the secondary axis point CAD entity.

@secondary_axis_point.setter
@prevent_deleted
def secondary_axis_point(secondary_axis_point: CadPoint) -> None

Set the secondary axis point CAD entity.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadDisk(CadGeometryElement)

Disk represents a circular disk geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str]

Get the position of the disk.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str]) -> None

Set the position of the disk.

@property
@prevent_deleted
def radius() -> float | str

Get the radius of the disk.

@radius.setter
@prevent_deleted
def radius(radius: float | str) -> None

Set the radius of the disk.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the disk.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the disk.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadRectangle(CadGeometryElement)

Rectangle represents a rectangular geometry.

@property
@prevent_deleted
def position() -> tuple[float | str, float | str]

Get the position of the rectangle.

@position.setter
@prevent_deleted
def position(position: tuple[float | str, float | str]) -> None

Set the position of the rectangle.

@property
@prevent_deleted
def size() -> tuple[float | str, float | str]

Get the size of the rectangle.

@size.setter
@prevent_deleted
def size(size: tuple[float | str, float | str]) -> None

Set the size of the rectangle.

@property
@prevent_deleted
def rotation() -> tuple[float | str, float | str, float | str] | None

Get the rotation of the rectangle.

@rotation.setter
@prevent_deleted
def rotation(
rotation: tuple[float | str, float | str, float | str] | None) -> None

Set the rotation of the rectangle.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadGlob(Enum)

Wildcard patterns for CAD path matching.

Matches a single level in the CAD hierarchy.

Matches zero or more levels in the CAD hierarchy.

A path to select CAD entities in a hierarchical structure.

A CAD path is a list of segments, where each segment can be:

  • A string: Name of a geometry element at that level
  • A tuple of (key, value): Attribute filter matching entities with the given attribute
  • A CadGlob enum: Wildcard pattern for matching multiple entities

CAD paths are used in geometry operations (union, difference, intersection, translate, rotate, grid, remove, etc.) to select which entities to operate on.

class CadFileImport(CadGeometryElement)
@property
@prevent_deleted
def cleanup() -> bool

Get the cleanup setting.

class CadStepFile(CadFileImport)

CadStepFile represents a STEP file geometry import.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadIgesFile(CadFileImport)

CadIgesFile represents an IGES file geometry import.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadSatFile(CadFileImport)

CadSatFile represents a SAT (ACIS) file geometry import.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadBrepFile(CadFileImport)

CadBrepFile represents a BREP (OpenCASCADE) file geometry import.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadMshFile(CadFileImport)

CadMshFile represents a Gmsh MSH file geometry import. Only one MSH file can exist in a project and it cannot coexist with other geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadNasFile(CadFileImport)

CadNasFile represents a NASTRAN NAS file geometry import. Only one NAS file can exist in a project and it cannot coexist with other geometry elements.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

class CadGdsExtrudeParameters()

Parameters controlling the GDS boundary curve processing pipeline: layer unification, merge tolerance, feature detection thresholds, circle recognition, and spline fitting.

class CadGds2File(CadFileImport)

CadGds2File represents a GDS2 file geometry import.

@property
@prevent_deleted
def type() -> CadGeometryType

Get the type of the geometry element.

@property
@prevent_deleted
def layers() -> List[CadGdsLayer]

Get the GDS2 import configuration.

@property
@prevent_deleted
def extrude_parameters() -> CadGdsExtrudeParameters | None

Get the GDS2 extrude parameters.

@property
@prevent_deleted
def unit() -> rawapi.CadDistanceUnit

Get the default distance unit for all GDS numeric values.

class GeometryBuilder(JobMixin)

Geometry builder for a project. Use with projects that have the GeometryPipelineVersion.V2

def add(geometry: List[CadElement] | CadElement) -> Self

Creates new geometry elements in the project.

Arguments:

  • geometry - A list of CAD geometry elements or a single CAD geometry element.

Returns:

The GeometryBuilder object.

def add_box(name: str,
position: tuple[float | str, float | str, float | str],
size: tuple[float | str, float | str, float | str],
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a box to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the box center as (x, y, z).
  • size - The size of the box as (width, height, depth).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_cone(name: str,
position: tuple[float | str, float | str, float | str],
axis: tuple[float | str, float | str, float | str],
radius1: float | str,
radius2: float | str,
angle: float | str | None = None,
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a cone to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the cone center as (x, y, z).
  • axis - The axis direction vector as (x, y, z).
  • radius1 - The base radius of the cone.
  • radius2 - The top radius of the cone (0 for pointy cone).
  • angle - Optional angle for partial cones (in degrees by default).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_cylinder(name: str,
position: tuple[float | str, float | str, float | str],
axis: tuple[float | str, float | str, float | str],
radius: float | str,
angle: float | str | None = None,
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a cylinder to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the cylinder center as (x, y, z).
  • axis - The axis direction vector as (x, y, z).
  • radius - The radius of the cylinder.
  • angle - Optional angle for partial cylinders (in degrees by default).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_disk(name: str,
position: tuple[float | str, float | str],
radius: float | str,
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a disk to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the disk center as (x, y).
  • radius - The radius of the disk.
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_rectangle(name: str,
position: tuple[float | str, float | str],
size: tuple[float | str, float | str],
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a rectangle to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the rectangle center as (x, y).
  • size - The size of the rectangle as (width, height).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_sphere(name: str,
position: tuple[float | str, float | str, float | str],
radius: float | str,
angle1: float | str | None = None,
angle2: float | str | None = None,
angle3: float | str | None = None,
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a sphere to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the sphere center as (x, y, z).
  • radius - The radius of the sphere.
  • angle1 - Optional first angle for partial spheres (in degrees by default).
  • angle2 - Optional second angle for partial spheres (in degrees by default).
  • angle3 - Optional third angle for partial spheres (in degrees by default).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_surface_rectangle(name: str,
size: tuple[float | str, float | str],
offset: tuple[float | str, float | str, float | str],
origin_point: CadPoint,
main_axis_point: CadPoint,
secondary_axis_point: CadPoint,
enabled: str | bool | None = None) -> Self

Adds a surface rectangle to the project.

Arguments:

  • name - Name for the geometry element.
  • size - The size of the rectangle as (x, y).
  • offset - The offset from the origin point as (x, y, z).
  • origin_point - CAD entity reference for the origin point.
  • main_axis_point - CAD entity reference for the main axis point.
  • secondary_axis_point - CAD entity reference for the secondary axis point.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_torus(name: str,
position: tuple[float | str, float | str, float | str],
radius1: float | str,
radius2: float | str,
angle: float | str | None = None,
rotation: tuple[float | str, float | str, float | str]
| None = None,
enabled: str | bool | None = None) -> Self

Adds a torus to the project.

Arguments:

  • name - Name for the geometry element.
  • position - The position of the torus center as (x, y, z).
  • radius1 - The outer radius of the torus.
  • radius2 - The width of the torus ring.
  • angle - Optional angle for partial toruses (in degrees by default).
  • rotation - Optional rotation as Euler angles (x, y, z) in degrees.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_difference(name: str,
entity_tags_1: list[int] | None = None,
cad_names_1: list[str] | None = None,
cad_paths_1: list[CadPath] | None = None,
entity_tags_2: list[int] | None = None,
cad_names_2: list[str] | None = None,
cad_paths_2: list[CadPath] | None = None,
delete_tool: bool = True,
enabled: str | bool | None = None) -> Self

Adds a difference operation to the project.

Arguments:

  • name - Name for the geometry element.
  • entity_tags_1 - The list of entity tags for the first set.
  • cad_names_1 - The list of CAD names for the first set.
  • cad_paths_1 - The list of CAD paths for the first set.
  • entity_tags_2 - The list of entity tags for the second set.
  • cad_names_2 - The list of CAD names for the second set.
  • cad_paths_2 - The list of CAD paths for the second set.
  • delete_tool - Boolean flag to delete the tool entities after the operation. Default is True.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_fragment_all(name: str, enabled: str | bool | None = None) -> Self

Adds a fragment all operation to the project.

Arguments:

  • name - Name for the geometry element.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_fragments(name: str,
entity_tags_1: list[int] | None = None,
cad_names_1: list[str] | None = None,
cad_paths_1: list[CadPath] | None = None,
entity_tags_2: list[int] | None = None,
cad_names_2: list[str] | None = None,
cad_paths_2: list[CadPath] | None = None,
delete_tool: bool = True,
enabled: str | bool | None = None) -> Self

Adds a fragments operation to the project.

Arguments:

  • name - Name for the geometry element.
  • entity_tags_1 - The list of entity tags for the first set.
  • cad_names_1 - The list of CAD names for the first set.
  • cad_paths_1 - The list of CAD paths for the first set.
  • entity_tags_2 - The list of entity tags for the second set.
  • cad_names_2 - The list of CAD names for the second set.
  • cad_paths_2 - The list of CAD paths for the second set.
  • delete_tool - Boolean flag to delete the tool entities after the operation. Default is True.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_intersection(name: str,
entity_tags_1: list[int] | None = None,
cad_names_1: list[str] | None = None,
cad_paths_1: list[CadPath] | None = None,
entity_tags_2: list[int] | None = None,
cad_names_2: list[str] | None = None,
cad_paths_2: list[CadPath] | None = None,
delete_tool: bool = True,
enabled: str | bool | None = None) -> Self

Adds an intersection operation to the project.

Arguments:

  • name - Name for the geometry element.
  • entity_tags_1 - The list of entity tags for the first set.
  • cad_names_1 - The list of CAD names for the first set.
  • cad_paths_1 - The list of CAD paths for the first set.
  • entity_tags_2 - The list of entity tags for the second set.
  • cad_names_2 - The list of CAD names for the second set.
  • cad_paths_2 - The list of CAD paths for the second set.
  • delete_tool - Boolean flag to delete the tool entities after the operation. Default is True.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_union(name: str,
entity_tags: list[int] | None = None,
cad_names: list[str] | None = None,
cad_paths: list[CadPath] | None = None,
enabled: str | bool | None = None) -> Self

Adds a union operation to the project.

Arguments:

  • name - Name for the geometry element.
  • entity_tags - The list of entity tags to union.
  • cad_names - The list of CAD names to union.
  • cad_paths - The list of CAD paths to union.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_grid(name: str,
translation: tuple[float | str, float | str, float | str],
size: tuple[int | str, int | str, int | str],
entity_tags: list[int] | None = None,
cad_names: list[str] | None = None,
cad_paths: list[CadPath] | None = None,
enabled: str | bool | None = None) -> Self

Adds a grid pattern to the project.

Arguments:

  • name - Name for the geometry element.
  • translation - The translation vector for grid spacing.
  • size - The grid size as a tuple of 3 positive integers (x, y, z).
  • entity_tags - The list of entity tags to create grid from.
  • cad_names - The list of CAD names to create grid from.
  • cad_paths - The list of CAD paths to create grid from.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_remove(name: str,
entity_tags: list[int] | None = None,
cad_names: list[str] | None = None,
cad_paths: list[CadPath] | None = None,
enabled: str | bool | None = None) -> Self

Adds a remove operation to the project.

Arguments:

  • name - Name for the geometry element.
  • entity_tags - The list of entity tags to remove.
  • cad_names - The list of CAD names to remove.
  • cad_paths - The list of CAD paths to remove.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_rotate(name: str,
axis: tuple[float | str, float | str, float | str],
center: tuple[float | str, float | str, float | str],
angle: float | str,
entity_tags: list[int] | None = None,
cad_names: list[str] | None = None,
cad_paths: list[CadPath] | None = None,
copy_object: bool = False,
repeat: int | str | None = None,
enabled: str | bool | None = None) -> Self

Adds a rotation operation to the project.

Arguments:

  • name - Name for the geometry element.
  • axis - The rotation axis vector.
  • center - The center point for rotation.
  • angle - The rotation angle.
  • entity_tags - The list of entity tags to rotate.
  • cad_names - The list of CAD names to rotate.
  • cad_paths - The list of CAD paths to rotate.
  • copy_object - Copy the object instead of rotating. Default is False.
  • repeat - Number of times to repeat the rotation. Default is None.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_translate(name: str,
translation: tuple[float | str, float | str, float | str],
entity_tags: list[int] | None = None,
cad_names: list[str] | None = None,
cad_paths: list[CadPath] | None = None,
copy_object: bool = False,
repeat: int | str | None = None,
enabled: str | bool | None = None) -> Self

Adds a translate operation to the project.

Arguments:

  • name - Name for the geometry element.
  • translation - The translation vector.
  • entity_tags - The list of entity tags to translate.
  • cad_names - The list of CAD names to translate.
  • cad_paths - The list of CAD paths to translate.
  • copy_object - Copy the object instead of translating. Default is False.
  • repeat - Number of times to repeat the translation. Default is None.
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_brep_file(filepath: str,
name: str | None = None,
cleanup: bool = True,
enabled: str | bool | None = None) -> Self

Adds a BREP file import to the project.

Arguments:

  • filepath - Path to a local BREP file. The file will be uploaded automatically.
  • name - Optional name for the geometry element.
  • cleanup - Whether to clean up the imported file (default: True).
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_gds2_file(
filepath: str,
layers: List[CadGdsLayer]
| List[Tuple[int, int, int | float, int | float]],
name: str | None = None,
cleanup: bool = True,
enabled: str | bool | None = None,
extrude_parameters: CadGdsExtrudeParameters | None = None,
unit: rawapi.CadDistanceUnit = rawapi.CadDistanceUnit.MICROMETER
) -> Self

Adds a GDS2 file import to the project.

Arguments:

  • filepath - Path to a local GDS2 file. The file will be uploaded automatically.
  • layers - List of CadGdsLayer or tuples of (layer number, layer type number, absolute_z0, thickness).
  • name - Optional name for the geometry element.
  • cleanup - Whether to clean up the imported file (default: True).
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
  • extrude_parameters - Optional GDS2 extrusion parameters.
  • unit - Default distance unit for distance values in layers and extrude_parameters. Defaults to CadDistanceUnit.MICROMETER.

Returns:

The GeometryBuilder object.

def add_iges_file(filepath: str,
name: str | None = None,
cleanup: bool = True,
enabled: str | bool | None = None) -> Self

Adds an IGES file import to the project.

Arguments:

  • filepath - Path to a local IGES file. The file will be uploaded automatically.
  • name - Optional name for the geometry element.
  • cleanup - Whether to clean up the imported file (default: True).
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_sat_file(filepath: str,
name: str | None = None,
cleanup: bool = True,
enabled: str | bool | None = None) -> Self

Adds a SAT file import to the project.

Arguments:

  • filepath - Path to a local SAT file. The file will be uploaded automatically.
  • name - Optional name for the geometry element.
  • cleanup - Whether to clean up the imported file (default: True).
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_step_file(filepath: str,
name: str | None = None,
cleanup: bool = True,
enabled: str | bool | None = None) -> Self

Adds a STEP file import to the project.

Arguments:

  • filepath - Path to a local STEP file. The file will be uploaded automatically.
  • name - Optional name for the geometry element.
  • cleanup - Whether to clean up the imported file (default: True).
  • enabled - Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.

Returns:

The GeometryBuilder object.

def add_msh_file(filepath: str) -> Self

Adds a MSH file import to the project. Only one MSH file can exist in a project and it cannot coexist with other geometry elements.

Arguments:

  • filepath - Path to a local MSH file. The file will be uploaded automatically.

Returns:

The GeometryBuilder object.

def add_nas_file(filepath: str) -> Self

Adds a NAS file import to the project. Only one NAS file can exist in a project and it cannot coexist with other geometry elements.

Arguments:

  • filepath - Path to a local NAS file. The file will be uploaded automatically.

Returns:

The GeometryBuilder object.

def build(print_logs: bool = False,
refresh_delay_s: float = 1,
raise_on_error: bool = False) -> Self

Processes the geometry elements in the project and returns when the processing is complete.

Arguments:

  • print_logs - If True, print logs to the console.
  • refresh_delay_s - Optional delay in seconds between checking the status of the job.
  • raise_on_error - If True, raise an error if the building of the geometry fails. If False, you can use get_status() to check the status of the geometry processing job.

Returns:

The GeometryBuilder object.

def create_element(geometry: CadElement) -> CadElement

Creates new geometry elements in the project.

Arguments:

  • geometry - A list of CAD geometry elements or a single CAD geometry element.

Returns:

A list of created CAD geometry elements or a single created CAD geometry element.

def create_elements(geometries: List[CadElement]) -> List[CadElement]

Creates new geometry elements in the project.

Arguments:

  • geometry - A list of CAD geometry elements or a single CAD geometry element.

Returns:

A list of created CAD geometry elements or a single created CAD geometry element.

def get_elements() -> List[CadElement]

Gets the list of CAD geometry elements in the project.

Returns:

A list of CAD geometry elements.

def start(last_element_id: str | None = None) -> None

Starts processing the geometry elements in the project.

Arguments:

  • last_element_id - Optional last geometry element id to process in the project. If not provided, all geometry elements in the project will be processed.
def run(print_logs: bool = False,
refresh_delay_s: float = 1,
last_element_id: str | None = None) -> None

Processes the geometry elements in the project and returns when the processing is complete. Use get_status() to check the status of the processing after running.

Arguments:

  • print_logs - If True, print logs to the console.
  • refresh_delay_s - Optional delay in seconds between checking the status of the job.
  • last_element_id - Optional last geometry element id to process in the project. If not provided, all geometry elements in the project will be processed.
def abort() -> None

Aborts the processing of the geometry.

def get_status() -> str | None

Get the status of the processing of the geometry elements in the project.

Returns:

The status of the processing of the geometry elements in the project.

def is_running(refresh_delay_s: float | None = None) -> bool

Check if the processing of the geometry elements in the project is running.

Arguments:

  • refresh_delay_s - Optional delay in seconds between checking the status of the job.

Returns:

True if the processing of the geometry file is running, False otherwise.

def refresh_status(delay_s: float = 1) -> str | None

Refresh the status of the processing of the geometry elements in the project.

Arguments:

  • delay_s - Optional delay in seconds between checking the status of the job.

Returns:

The status of the processing of the geometry file.

def get_logs(limit: int = 100) -> List[str]

Get the logs of the processing of the geometry elements in the project.

Arguments:

  • limit - Optional maximum number of logs to return.

Returns:

A list of log messages.

def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print the new log lines of the processing of the geometry elements in the project.

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to print.
def delete(geometry: CadElement | None = None) -> None

Deletes a geometry element in the project, or all geometry elements if no geometry element is provided.

Arguments:

  • geometry - Optional geometry element to delete. If not provided, all geometry elements in the project will be deleted.

Auto-generated enum definitions for interaction parameters.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

class AcousticWavesPeriodicityType(_Enum)

Translation

Rotation

class AcousticWavesPmlType(_Enum)

AML

Box PML

class CurrentFlowLumpActuationMode(_Enum)

Voltage

Current

Circuit coupling

class CurrentFlowLumpVICutActuationMode(_Enum)

Current

Voltage

Circuit coupling

class CurrentFlowPeriodicityType(_Enum)

Translation

Rotation

class ElasticWavesLumpActuationMode(_Enum)

Displacement

Force

Circuit coupling

class ElasticWavesPeriodicityType(_Enum)

Translation

Rotation

class ElasticWavesPmlType(_Enum)

AML

Box PML

ElectromagneticWavesEigenmodePortTargetEigenvalueType Objects

Section titled “ElectromagneticWavesEigenmodePortTargetEigenvalueType Objects”
class ElectromagneticWavesEigenmodePortTargetEigenvalueType(_Enum)

Target eigenvalue type

Propagation constant

Effective refractive index

ElectromagneticWavesLumpVIActuationMode Objects

Section titled “ElectromagneticWavesLumpVIActuationMode Objects”
class ElectromagneticWavesLumpVIActuationMode(_Enum)

Voltage

Current

Resistor

Inductor

Capacitor

Circuit coupling

ElectromagneticWavesPeriodicityType Objects

Section titled “ElectromagneticWavesPeriodicityType Objects”
class ElectromagneticWavesPeriodicityType(_Enum)

Translation

Rotation

class ElectromagneticWavesPmlType(_Enum)

AML

Box PML

ElectromagneticWavesRectangularPortModeType Objects

Section titled “ElectromagneticWavesRectangularPortModeType Objects”
class ElectromagneticWavesRectangularPortModeType(_Enum)

Mode type

TE

TM

class ElectrostaticsLumpActuationMode(_Enum)

Voltage

Charge

Circuit coupling

class ElectrostaticsPeriodicityType(_Enum)

Translation

Rotation

class FieldOutputFilterType(_Enum)

How to select which steps to save.

Output every step

Output every Nth step

Output specific steps

Filter by expression

class FieldStateFilterType(_Enum)

How to select which steps to save.

Output only the final state

Output every step

Output every Nth step

Output specific steps

Filter by expression

class HeatFluidPeriodicityType(_Enum)

Translation

Rotation

class HeatTransferLumpTPhiActuationMode(_Enum)

Temperature

Heat power

Circuit coupling

class HeatTransferPeriodicityType(_Enum)

Translation

Rotation

class LaminarFlowLumpPMActuationMode(_Enum)

Pressure

Mass flow rate

Circuit coupling

class LaminarFlowLumpVFvActuationMode(_Enum)

Velocity

Viscous force

Circuit coupling

LaminarFlowPressurePeriodicityType Objects

Section titled “LaminarFlowPressurePeriodicityType Objects”
class LaminarFlowPressurePeriodicityType(_Enum)

Translation

Rotation

LaminarFlowVelocityPeriodicityType Objects

Section titled “LaminarFlowVelocityPeriodicityType Objects”
class LaminarFlowVelocityPeriodicityType(_Enum)

Translation

Rotation

class MagnetismAPeriodicityType(_Enum)

Translation

Rotation

class MagnetismHPeriodicityType(_Enum)

Translation

Rotation

class MagnetismPhiLumpIVActuationMode(_Enum)

Current

Voltage

Circuit coupling

MagnetismPhiLumpPhiPhiBActuationMode Objects

Section titled “MagnetismPhiLumpPhiPhiBActuationMode Objects”
class MagnetismPhiLumpPhiPhiBActuationMode(_Enum)

Magnetic scalar potential

Magnetic flux

Circuit coupling

class MagnetismPhiPeriodicityType(_Enum)

Translation

Rotation

class MeshDeformationPeriodicityType(_Enum)

Translation

Rotation

class SolidMechanicsLumpActuationMode(_Enum)

Displacement

Force

Circuit coupling

class SolidMechanicsPeriodicityType(_Enum)

Translation

Rotation

Auto-generated physics helpers. Do not edit files in this package manually.

Auto-generated physics classes.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

class SolidMechanics(Physic)

Solid mechanics physics.

class CurrentFlow(Physic)

Current flow physics.

class AcousticWaves(Physic)

Acoustic waves physics.

class ElectromagneticWaves(Physic)

Electromagnetic waves physics.

class Electrostatics(Physic)

Electrostatics physics.

class MagnetismA(Physic)

Magnetism A physics.

class MagnetismPhi(Physic)

magnetism phi physics.

class MagnetismH(Physic)

Magnetism H physics.

class LaminarFlow(Physic)

Laminar flow physics.

class HeatTransfer(Physic)

Heat solid physics.

class HeatFluid(Physic)

Heat fluid physics.

class ElasticWaves(Physic)

Elastic waves physics.

class MeshDeformation(Physic)

Mesh deformation physics.

Auto-generated interaction classes.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

class SolidMechanicsLoad(Interaction)

Load interaction.

class SolidMechanicsConstraint(Interaction)

Constraint interaction.

class SolidMechanicsClamp(Interaction)

Clamp interaction.

class SolidMechanicsLump(Interaction)

Lump U/F interaction.

class SolidMechanicsThermalExpansion(Interaction)

Thermal expansion interaction.

class SolidMechanicsPiezoelectricity(Interaction)

Piezoelectricity interaction.

class SolidMechanicsElectricForce(Interaction)

Electric force interaction.

class SolidMechanicsMagneticForce(Interaction)

Magnetic force interaction.

class SolidMechanicsLargeDisplacement(Interaction)

Large displacement interaction.

class SolidMechanicsPressure(Interaction)

Pressure interaction.

class SolidMechanicsPrestress(Interaction)

Prestress interaction.

class SolidMechanicsPeriodicity(Interaction)

Periodicity interaction.

class SolidMechanicsSymmetry(Interaction)

Symmetry interaction.

class SolidMechanicsProportionalDamping(Interaction)

Proportional damping interaction.

SolidMechanicsGeometricNonlinearity Objects

Section titled “SolidMechanicsGeometricNonlinearity Objects”
class SolidMechanicsGeometricNonlinearity(Interaction)

Geometric nonlinearity interaction.

class SolidMechanicsContact(Interaction)

Contact interaction.

class CurrentFlowConstraint(Interaction)

Constraint interaction.

class CurrentFlowCurrentDensity(Interaction)

Current density source interaction.

class CurrentFlowLump(Interaction)

Lump V/I interaction.

class CurrentFlowLumpVICut(Interaction)

Lump V/I cut interaction.

class CurrentFlowPeriodicity(Interaction)

Periodicity interaction.

class AcousticWavesPml(Interaction)

Perfectly matched layer interaction.

class AcousticWavesConstraint(Interaction)

Constraint interaction.

class AcousticWavesAcousticStructure(Interaction)

Acoustic structure interaction.

AcousticWavesAcousticStructureForElasticWaves Objects

Section titled “AcousticWavesAcousticStructureForElasticWaves Objects”
class AcousticWavesAcousticStructureForElasticWaves(Interaction)

Acoustic structure interaction.

class AcousticWavesAbsorbingBoundary(Interaction)

Absorbing boundary interaction.

class AcousticWavesPeriodicity(Interaction)

Periodicity interaction.

class AcousticWavesAcousticDamping(Interaction)

Acoustic damping interaction.

class AcousticWavesNormalAcceleration(Interaction)

Normal acceleration interaction.

class AcousticWavesContinuity(Interaction)

Continuity interaction.

class ElectromagneticWavesConstraint(Interaction)

Constraint interaction.

class ElectromagneticWavesPml(Interaction)

Perfectly matched layer interaction.

ElectromagneticWavesRectangularPort Objects

Section titled “ElectromagneticWavesRectangularPort Objects”
class ElectromagneticWavesRectangularPort(Interaction)

Rectangular port interaction.

ElectromagneticWavesPerfectConductor Objects

Section titled “ElectromagneticWavesPerfectConductor Objects”
class ElectromagneticWavesPerfectConductor(Interaction)

Perfect conductor interaction.

class ElectromagneticWavesEigenmodePort(Interaction)

Eigenmode port interaction.

ElectromagneticWavesDielectricLoss Objects

Section titled “ElectromagneticWavesDielectricLoss Objects”
class ElectromagneticWavesDielectricLoss(Interaction)

Dielectric loss interaction.

class ElectromagneticWavesLumpVI(Interaction)

Lump V/I interaction.

class ElectromagneticWavesPeriodicity(Interaction)

Periodicity interaction.

ElectromagneticWavesAbsorbingBoundary Objects

Section titled “ElectromagneticWavesAbsorbingBoundary Objects”
class ElectromagneticWavesAbsorbingBoundary(Interaction)

Absorbing boundary interaction.

ElectromagneticWavesBoundaryImpedance Objects

Section titled “ElectromagneticWavesBoundaryImpedance Objects”
class ElectromagneticWavesBoundaryImpedance(Interaction)

Boundary impedance interaction.

class ElectrostaticsConstraint(Interaction)

Constraint interaction.

class ElectrostaticsPiezoelectricity(Interaction)

Piezoelectricity interaction.

class ElectrostaticsLump(Interaction)

Lump V/Q interaction.

class ElectrostaticsLargeDisplacement(Interaction)

Large displacement interaction.

ElectrostaticsElasticWavesPiezoelectricity Objects

Section titled “ElectrostaticsElasticWavesPiezoelectricity Objects”
class ElectrostaticsElasticWavesPiezoelectricity(Interaction)

Piezoelectricity interaction.

class ElectrostaticsPeriodicity(Interaction)

Periodicity interaction.

class MagnetismAMagneticWall(Interaction)

Magnetic wall interaction.

class MagnetismAElectromagneticCoupling(Interaction)

A-v coupling interaction.

class MagnetismABackgroundField(Interaction)

Remanence interaction.

class MagnetismAPeriodicity(Interaction)

Periodicity interaction.

class MagnetismPhiConstraint(Interaction)

Constraint interaction.

class MagnetismPhiBackgroundField(Interaction)

Remanence interaction.

class MagnetismPhiLumpPhiPhiB(Interaction)

magnetism phi lump phi phi b interaction.

class MagnetismPhiLumpIV(Interaction)

Lump I/V cut interaction.

class MagnetismPhiExternalField(Interaction)

External field interaction.

class MagnetismPhiPeriodicity(Interaction)

Periodicity interaction.

class MagnetismPhiContinuity(Interaction)

Continuity interaction.

class MagnetismHConstraint(Interaction)

Constraint interaction.

class MagnetismHHPhiCoupling(Interaction)

h phi coupling interaction.

class MagnetismHElectricalInsulator(Interaction)

Electrical insulator interaction.

class MagnetismHPeriodicity(Interaction)

Periodicity interaction.

class LaminarFlowVelocityConstraint(Interaction)

Velocity constraint interaction.

class LaminarFlowPressureConstraint(Interaction)

Pressure constraint interaction.

class LaminarFlowThermalFluid(Interaction)

Thermal fluid interaction.

class LaminarFlowForce(Interaction)

Force interaction.

class LaminarFlowVelocityPeriodicity(Interaction)

Velocity periodicity interaction.

class LaminarFlowPressurePeriodicity(Interaction)

Pressure periodicity interaction.

class LaminarFlowLargeDisplacement(Interaction)

Large displacement interaction.

class LaminarFlowFluidStructure(Interaction)

Fluid structure interaction.

class LaminarFlowVelocitySymmetry(Interaction)

Velocity symmetry interaction.

class LaminarFlowPressureSymmetry(Interaction)

Pressure symmetry interaction.

class LaminarFlowLumpPM(Interaction)

Lump P/M interaction.

class LaminarFlowLumpVFv(Interaction)

Lump V/Fv interaction.

class LaminarFlowLinear(Interaction)

Linear interaction.

class HeatTransferTemperatureConstraint(Interaction)

Constraint interaction.

class HeatTransferHeatSource(Interaction)

Heat source interaction.

class HeatTransferJouleHeating(Interaction)

Joule heating interaction.

class HeatTransferPeriodicity(Interaction)

Periodicity interaction.

class HeatTransferConvection(Interaction)

Convection interaction.

class HeatTransferLumpTPhi(Interaction)

heat transfer lump t phi interaction.

class HeatFluidConstraint(Interaction)

Constraint interaction.

class HeatFluidHeatSource(Interaction)

Heat source interaction.

class HeatFluidPeriodicity(Interaction)

Periodicity interaction.

class ElasticWavesLoad(Interaction)

Load interaction.

class ElasticWavesConstraint(Interaction)

Constraint interaction.

class ElasticWavesClamp(Interaction)

Clamp interaction.

class ElasticWavesLump(Interaction)

Lump U/F interaction.

class ElasticWavesPiezoelectricity(Interaction)

Piezoelectricity interaction.

class ElasticWavesPml(Interaction)

Perfectly matched layer interaction.

class ElasticWavesThermalExpansion(Interaction)

Thermal expansion interaction.

class ElasticWavesViscoelasticity(Interaction)

Viscoelasticity interaction.

class ElasticWavesPressure(Interaction)

Pressure interaction.

class ElasticWavesPeriodicity(Interaction)

Periodicity interaction.

class ElasticWavesAbsorbingBoundary(Interaction)

Absorbing boundary interaction.

class ElasticWavesSymmetry(Interaction)

Symmetry interaction.

class ElasticWavesElectricForce(Interaction)

Electric force interaction.

class ElasticWavesProportionalDamping(Interaction)

Proportional damping interaction.

class ElasticWavesContinuity(Interaction)

Continuity interaction.

class ElasticWavesViscousDamping(Interaction)

Viscous damping interaction.

class MeshDeformationConstraint(Interaction)

Constraint interaction.

class MeshDeformationClamp(Interaction)

Clamp interaction.

class MeshDeformationPeriodicity(Interaction)

Periodicity interaction.

class MeshDeformationSymmetry(Interaction)

Symmetry interaction.

Auto-generated registries for physics and interactions.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

Auto-generated namespaces for physics and interactions.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

class Physics()

Namespace for generated physics classes.

class Interaction()

Namespace for generated interaction classes.

class Output()

Namespace for generated output interaction classes.

Auto-generated output interaction classes.

This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.

class AcousticWavesRadiationPattern(OutputInteraction)

Acoustic radiation pattern output interaction.

class ValueOutput(OutputInteraction)

Value output output interaction.

class Eigenfrequencies(OutputInteraction)

Eigenfrequencies output interaction.

class Eigenvalues(OutputInteraction)

Eigenvalues output interaction.

ElectromagneticWavesRadiationPattern Objects

Section titled “ElectromagneticWavesRadiationPattern Objects”
class ElectromagneticWavesRadiationPattern(OutputInteraction)

EM radiation pattern output interaction.

class FieldOutput(OutputInteraction)

Field output output interaction.

class FieldState(OutputInteraction)

Field state output interaction.

class FinalHPhiState(OutputInteraction)

final h phi state output interaction.

class MagneticForce(OutputInteraction)

Magnetic force output interaction.

class QFactors(OutputInteraction)

Q-factors output interaction.

class SParameters(OutputInteraction)

S-parameters output interaction.

class TransientState(OutputInteraction)

Transient state output interaction.

class InteractionParameter()

InteractionParameter is a class for managing interaction parameters.

@property
def value() -> str

Get the value of the parameter.

@value.setter
def value(value: str) -> None

Set the value of the parameter.

@property
def definition() -> str

Get the definition of the parameter.

class InteractionBase()

InteractionBase is a base class for interactions and output interactions in a project.

Mapping of Python parameter name to target definition ID for multi-target interactions.

@property
@prevent_deleted
def id() -> str

Get the ID of the interaction.

@property
@prevent_deleted
def name() -> str

Get the name of the interaction.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def definition() -> str

Get the definition of the interaction.

@property
@prevent_deleted
def enabled() -> bool

Get whether the interaction is enabled.

@enabled.setter
@prevent_deleted
def enabled(enabled: bool) -> None

Set whether the interaction is enabled. Use save() to commit the change.

@property
@prevent_deleted
def namespace() -> str | None

Get the namespace of the interaction.

@namespace.setter
@prevent_deleted
def namespace(namespace: str | None) -> None

Set the namespace of the interaction. Use save() to commit the change.

@prevent_deleted
def target_region_id(target_definition: str | None = None) -> str | None

Get the targets of the interaction.

@prevent_deleted
def set_target_region_id(region_id: str,
target_definition: str | None = None) -> None

Set the target region ID for a specific target definition. Use save() to commit the change.

Arguments:

  • region_id - The region ID to set.
  • target_definition - The target definition to update. If None, updates the first target.
@property
@prevent_deleted
def parameters() -> List[InteractionParameter]

Get the parameters of the interaction.

@parameters.setter
@prevent_deleted
def parameters(parameters: List[InteractionParameter]) -> None

Set the parameters of the interaction. Use save() to commit the change.

@prevent_deleted
def save() -> None

Save the changes to the cloud made by setting properties like name, enabled, target_region_id, or parameters.

@prevent_deleted
def delete() -> None

Delete the interaction from the project.

class Interaction(InteractionBase)

Interaction is a class for managing interactions in a project.

@classmethod
def create(cls,
physics_id: str,
name: str,
definition: str,
target_region_id: str | None = None,
enabled: "BooleanValue | None" = None,
project_id: str | None = None,
parameters: List[InteractionParameter] | None = None,
target_definition: str | None = None,
interaction_targets: List[Tuple[str, str]] | None = None,
namespace: str | None = None) -> Self

Create a new interaction for a physics in the project.

Recommended to use the physics.add_interactions() method to create an interaction. First you need to add physics to the project.

Example:

physic = project.add_physics(allsolve.Physics.SolidMechanics())
physic.add_interactions([allsolve.Interaction.SolidMechanicsClamp(name="clamp", target=region_clamp_surface)])

Arguments:

  • physics_id - The ID of the physics this interaction belongs to.
  • name - The name of the interaction.
  • definition - The definition of the interaction (e.g., “clamp”).
  • enabled - The enabled expression for the interaction (bool or string).
  • target_region_id - The region ID this interaction targets (single-target).
  • project_id - The ID of the project. Can be omitted if project API key is used.
  • parameters - Optional list of interaction parameters.
  • target_definition - Optional target definition for single-target interactions (e.g., “clampTarget”).
  • interaction_targets - Optional list of (definition_id, region_id) tuples for multi-target interactions. Takes precedence over target_definition/target_region_id if provided.

Returns:

The created Interaction.

class OutputInteraction(InteractionBase)

OutputInteraction is a class for managing output interactions in a simulation.

@classmethod
def create(cls,
simulation_id: str,
name: str,
definition: str,
project_id: str | None = None,
parameters: List[InteractionParameter] | None = None,
enabled: bool = True) -> Self

Create a new output interaction for a simulation.

Arguments:

  • simulation_id - The ID of the simulation this interaction belongs to.
  • name - The name of the interaction.
  • definition - The definition of the interaction (e.g., “fieldOutput”).
  • project_id - The ID of the project. Can be omitted if project API key is used.
  • parameters - Optional list of interaction parameters.
  • enabled - Whether the interaction is enabled (default: True).

Returns:

The created Interaction.

def vector_to_str(value: VectorValue) -> str

Convert a vector value to allsolve string format.

Arguments:

  • value - A vector as a string, tuple, or list.
    • If string, returned as-is (assumed to be in correct format).
    • If tuple/list, converted to “[x; y; z]” format.

Returns:

The vector in allsolve format “[x; y; z]”.

Examples:

vector_to_str((0, 0, -1000)) ‘[0; 0; -1000]’ vector_to_str([1.5, 2.0, 3.0]) ‘[1.5; 2.0; 3.0]’ vector_to_str(“[0; 0; -1000]”) ‘[0; 0; -1000]‘

def vector_from_str(value: str) -> VectorValue

Parse a vector string back to a list of values.

Arguments:

  • value - A string in allsolve vector format “[x; y; z]”.

Returns:

A list of floats (or strings if not numeric).

Examples:

vector_from_str(“[0; 0; -1000]”) [0.0, 0.0, -1000.0] vector_from_str(“[1.5; 2.0; 3.0]”) [1.5, 2.0, 3.0] vector_from_str(“[x; y; z]”) [‘x’, ‘y’, ‘z’]

def matrix_to_str(value: MatrixValue) -> str

Convert a matrix value to allsolve string format.

Arguments:

  • value - A matrix as a string or nested sequence.
    • If string, returned as-is (assumed to be in correct format).
    • If nested sequence, converted to “[r0c0, r0c1; r1c0, r1c1; …]” format. Rows are separated by semicolons, columns by commas.

Returns:

The matrix in allsolve format.

Examples:

matrix_to_str([[1, 0], [0, 1], [0, 0]]) ‘[1, 0; 0, 1; 0, 0]’ matrix_to_str(“[1, 0; 0, 42; 0, 0]”) ‘[1, 0; 0, 42; 0, 0]‘

def matrix_from_str(value: str) -> MatrixValue

Parse a matrix string back to a nested list of values.

Arguments:

  • value - A string in allsolve matrix format “[r0c0, r0c1; r1c0, r1c1; …]”.

Returns:

A nested list of floats (or strings if not numeric).

Examples:

matrix_from_str(“[1, 0; 0, 1; 0, 0]”) [[1.0, 0.0], [0.0, 1.0], [0.0, 0.0]] matrix_from_str(“[1.5, 2.0; 3.0, 4.5]”) [[1.5, 2.0], [3.0, 4.5]]

def boolean_to_str(value: BooleanValue) -> str

Convert a boolean value to allsolve string format.

Arguments:

  • value - A boolean value as string or bool.
    • If string, returned as-is.
    • If bool, converted to “1” (True) or “0” (False).

Returns:

The boolean as “1” or “0”.

Examples:

boolean_to_str(True) ‘1’ boolean_to_str(False) ‘0’ boolean_to_str(“1”) ‘1’

def boolean_from_str(value: str) -> bool

Parse a boolean string back to a Python bool.

Arguments:

  • value - A string “1” or “0”.

Returns:

True if value is “1”, False if value is “0”.

Raises:

  • ValueError - If value is not “1” or “0”.

Examples:

boolean_from_str(“1”) True boolean_from_str(“0”) False

class Physic()

Physic is a class for managing physics in a project.

@classmethod
def get_all(cls, project_id: str | None = None) -> List["Physic"]

Get all physics in a project.

Arguments:

  • project_id - The ID of the project. Can be omitted if project API key is used.

Returns:

A list of Physics objects.

@classmethod
def create(cls,
definition: str,
project_id: str | None = None,
target_region_id: str | None = None) -> "Physic"

Create a new physic.

Arguments:

  • definition - The definition of the physic (e.g., “solidMechanics”).
  • project_id - The ID of the project. Can be omitted if project API key is used.
  • target_region_id - Optional target region ID.

Returns:

The created Physics.

@property
@prevent_deleted
def id() -> str

Get the ID of the physic.

@property
@prevent_deleted
def definition() -> str

Get the definition of the physic.

@property
@prevent_deleted
def target_region_id() -> str | None

Get the target region ID of the physic.

@target_region_id.setter
@prevent_deleted
def target_region_id(target_region_id: str | None) -> None

Set the target region ID of the physic. Use save() to commit the change.

@property
@prevent_deleted
def interactions() -> List[Interaction]

Get the interactions of the physic.

@prevent_deleted
def get_interactions() -> List[Interaction]

Get the interactions of the physic.

@prevent_deleted
def add_interactions(interactions: List[Interaction]) -> List[Interaction]

Add interactions to this physic.

@prevent_deleted
def interaction(definition: str) -> Interaction | None

Get the interaction of the physic by interaction definition.

@property
@prevent_deleted
def field_ids() -> List[str]

Get the field IDs of the physic.

Returns:

A list of field IDs.

@prevent_deleted
def get_field_interpolation_order(field_id: str | None = None) -> str | None

Get the interpolation order for a field.

Arguments:

  • field_id - The ID of the field. If None, uses the first field.

Returns:

The interpolation order of the field, or None if not set.

Raises:

  • ValueError - If the physic has no fields or the field_id is not found.
@prevent_deleted
def set_field_interpolation_order(interpolation_order: str | int,
field_id: str | None = None) -> None

Set the interpolation order for a field. Use save() to commit the change.

Arguments:

  • interpolation_order - The interpolation order to set.
  • field_id - The ID of the field. If None, uses the first field.

Raises:

  • ValueError - If the physic has no fields or the field_id is not found.
@prevent_deleted
def save() -> None

Explicitly save the changes to the cloud made by setting properties like target_region_id or set_field_interpolation_order.

@prevent_deleted
def delete() -> None

Delete the physic from the project.

Variable-length integer encoding (varint) implementation.

Uses 7-bit groups with continuation bits, and zig-zag encoding for signed integers.

def encode_one(value: int) -> bytes

Encode a single unsigned integer using variable-length encoding.

Uses 7 bits for data and 1 bit (MSB) as continuation flag for bytes 1-8. The 9th byte (if needed) uses all 8 bits.

def encode_one_signed(value: int) -> bytes

Encode a single signed integer using zig-zag encoding followed by varint encoding.

Zig-zag encoding maps negative numbers to positive ones: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4, …

def encode(values: List[int]) -> bytes

Encode multiple unsigned integers using variable-length encoding.

def encode_signed(values: List[int]) -> bytes

Encode multiple signed integers using zig-zag encoding followed by varint encoding.

Zig-zag encoding maps negative numbers to positive ones: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4, …

def decode(buffer: bytes | bytearray | memoryview) -> List[int]

Decode all variable-length encoded unsigned integers from the buffer.

Returns a list of decoded values. Raises ValueError if the buffer is invalid.

def decode_signed(buffer: bytes | bytearray | memoryview) -> List[int]

Decode all zig-zag encoded signed integers from the buffer.

Returns a list of decoded values.

def decode_one(buffer: bytes | bytearray | memoryview) -> Tuple[int, int]

Decode a single variable-length encoded unsigned integer from the buffer.

Returns a tuple of (decoded_value, bytes_consumed). Raises ValueError if the buffer is invalid.

def decode_one_signed(
buffer: bytes | bytearray | memoryview) -> Tuple[int, int]

Decode a single zig-zag encoded signed integer from the buffer.

Returns a tuple of (decoded_value, bytes_consumed).

class SharedExpression()

SharedExpression is for managing shared expressions.

The “Shared” means that they are stored in the system so that they can referred to in other places using their identifier.

@classmethod
def get(cls, expr_id: str, project_id: str | None = None) -> Self

Get a shared expression by its ID.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all shared expressions in a project.

@property
@prevent_deleted
def id() -> str

Get the ID of the shared expression.

@property
@prevent_deleted
def name() -> str

Get the name of the shared expression.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def description() -> str

Get the description of the shared expression.

@description.setter
@prevent_deleted
def description(description: str) -> None

Set the description of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def type() -> rawapi.SharedExpressionType

Get the type of the shared expression.

@type.setter
@prevent_deleted
def type(expression_type: rawapi.SharedExpressionType) -> None

Set the type of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def origin() -> Optional[str]

Get the origin (original shared expression ID if this is a copy).

@origin.setter
@prevent_deleted
def origin(origin: Optional[str]) -> None

Set the origin of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def args() -> Optional[List[rawapi.SharedExpressionArg]]

Get the arguments of the shared expression.

@args.setter
@prevent_deleted
def args(args: Optional[List[rawapi.SharedExpressionArg]]) -> None

Set the arguments of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def expression() -> Optional[str]

Get the expression string.

@expression.setter
@prevent_deleted
def expression(expression: Optional[str]) -> None

Set the expression string. Use save() to commit the change.

@property
@prevent_deleted
def values() -> Optional[List[Union[float, int]]]

Get the values of the shared expression.

@values.setter
@prevent_deleted
def values(values: Optional[List[Union[float, int]]]) -> None

Set the values of the shared expression. Use save() to commit the change.

@property
@prevent_deleted
def cubic_interpolation() -> Optional[bool]

Get whether cubic spline interpolation is used (for interpolated functions). When True, values are interpolated using a natural cubic spline. When False or None, linear interpolation is used.

@cubic_interpolation.setter
@prevent_deleted
def cubic_interpolation(cubic_interpolation: Optional[bool]) -> None

Set whether cubic spline interpolation is used. Use save() to commit the change.

@prevent_deleted
def delete() -> None

Delete the shared expression.

@prevent_deleted
def save() -> None

Explicitly save the changes to the cloud made by setting properties like name, description, type, expression, args, origin, values and cubic_interpolation.

class Variable(SharedExpression)

A variable expression in the project. Variables are SharedExpressions with type EXPRESSION.

@classmethod
def create(cls,
name: str,
expression: str | float | int,
description: str = "",
project_id: str | None = None) -> Self

Create a variable in the project.

Arguments:

  • name - The name of the variable.
  • expression - The expression of the variable.
  • description - The description of the variable.
  • project_id - The ID of the project.

Returns:

The created variable.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all variables in a project.

@classmethod
def get_by_name(cls, name: str, project_id: str | None = None) -> Self | None

Get a variable by its name. Returns None if no variable matches the given name.

Arguments:

  • name - The name of the variable.
  • project_id - The ID of the project.

Returns:

The variable that matches the given name.

class Function(SharedExpression)

A function expression in the project. Functions are SharedExpressions with type FUNCTION.

@classmethod
def create(cls,
name: str,
args: List[str],
expression: str,
description: str = "",
project_id: str | None = None) -> Self

Create a function in the project.

Arguments:

  • name - The name of the function.
  • args - The arguments of the function.
  • expression - The expression of the function.
  • description - The description of the function.
  • project_id - The ID of the project.

Returns:

The created function.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all functions in a project.

@classmethod
def get_by_name(cls, name: str, project_id: str | None = None) -> Self | None

Get a function by its name. Returns None if no function matches the given name.

Arguments:

  • name - The name of the function.
  • project_id - The ID of the project.

Returns:

The function that matches the given name.

class InterpolatedFunction(SharedExpression)

An interpolated function expression in the project. Interpolated functions are SharedExpressions with type INTERPOLATED_FUNCTION.

@classmethod
def create(cls,
name: str,
args: List[Tuple[str, List[float]]],
values: List[float],
description: str = "",
cubic_interpolation: bool | None = None,
project_id: str | None = None) -> Self

Create an interpolated function in the project.

Arguments:

  • name - The name of the interpolated function.
  • args - The arguments of the interpolated function.
  • values - The values of the interpolated function.
  • description - The description of the interpolated function.
  • cubic_interpolation - If True, values are interpolated using a natural cubic spline. If False or None, linear interpolation is used.
  • project_id - The ID of the project.

Returns:

The created interpolated function.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all interpolated functions in a project.

@classmethod
def get_by_name(cls, name: str, project_id: str | None = None) -> Self | None

Get an interpolated function by its name. Returns None if no interpolated function matches the given name.

Arguments:

  • name - The name of the interpolated function.
  • project_id - The ID of the project.

Returns:

The interpolated function that matches the given name.

class JobMixin()

Mixin class that provides common job-related methods for classes that manage a Job instance.

Classes using this mixin should have a _job attribute of type Job | None. Subclasses can override _get_job() to customize job retrieval logic.

def abort() -> None

Abort the processing of the job.

def get_status() -> str | None

Get the status of the processing of the job.

Returns:

The status of the processing, or Job.NOT_STARTED if no job exists.

def is_running(refresh_delay_s: float | None = None) -> bool

Check if the processing of the job is running.

Arguments:

  • refresh_delay_s - Optional delay in seconds between checking the status of the job.

Returns:

True if the processing is running, False otherwise.

def refresh_status(delay_s: float = 1) -> str | None

Refresh the status of the processing of the job.

Arguments:

  • delay_s - Optional delay in seconds between checking the status of the job.

Returns:

The status of the processing, or Job.NOT_STARTED if no job exists.

def get_logs(limit: int = 100) -> List[str]

Get the logs of the processing of the job.

Arguments:

  • limit - Optional maximum number of logs to return.

Returns:

A list of log messages, or an empty list if no job exists.

def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> None

Print the new log lines of the processing of the job.

Arguments:

  • file - Optional file to print the logs to.
  • limit - Optional maximum number of logs to print.
class ProjectType(Enum)

Enum for the type of project.

class GeometryPipelineVersion(Enum)

Enum for the version of the geometry pipeline. For new projects, use V2 (default). V1 is deprecated.

class Project()

A project in the AllSolve.

@classmethod
def from_token(cls) -> Self

Get the project associated with the project API key.

Returns:

The project associated with the project API key.

Raises:

  • NotProjectAPIKeyError - If not authenticated with a project API key.
@classmethod
def get(cls, project_id: str) -> Self

Get a project using the project ID.

Arguments:

  • project_id - The ID of the project to get.

Returns:

The project with the given ID.

@classmethod
def get_all(cls) -> List[Self]

Get all projects.

Returns:

A list of projects that the authentication has access to.

@classmethod
def get_all_by_name(cls, name: str) -> List[Self]

Get all projects that match the given name.

Arguments:

  • name - The name of the project to search for.

Returns:

A list of projects that match the given name.

@classmethod
def get_by_name(cls, name: str) -> Self | None

Get project that matches the given name. Returns None if no project matches the given name. Raises ValueError if multiple projects match the given name.

Arguments:

  • name - The name of the project to search for.

Returns:

The project that matches the given name.

@classmethod
def create(cls,
name: str,
description: str = "",
organization_write_access: bool | None = None,
labels: List[str] | None = None,
type: ProjectType = ProjectType.NORMAL,
geometry_pipeline_version:
GeometryPipelineVersion = GeometryPipelineVersion.V2,
dimension: int = 3,
geometry_no_implicit_fragment: bool = False) -> Self

Create a new project.

Arguments:

  • name - The name of the project.
  • description - The description of the project.
  • organization_write_access - Optional boolean whether the organization has write access to the project.
  • labels - Optional list of labels for the project.
  • type - Optional ProjectType. Default is ProjectType.NORMAL. Use ProjectType.SCRIPT_ONLY for projects that do not have geometry.
  • geometry_pipeline_version - Optional GeometryPipelineVersion. Default is V2.
  • dimension - Optional dimension of the project. Default is 3.
  • geometry_no_implicit_fragment - Optional boolean whether to disable the automatic final Fragment All operation. Default is False. By default, the final Fragment All operation splits intersecting geometric entities into non-intersecting, disjoint parts. Setting parameter to True prevents automatic splitting, preserving the original geometric entities as-is.

Returns:

The created project.

@property
@prevent_deleted
def id() -> str

Get the ID of the project.

@property
@prevent_deleted
def name() -> str

Get the name of the project.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the project.

@property
@prevent_deleted
def description() -> str

Get the description of the project.

@description.setter
@prevent_deleted
def description(description: str) -> None

Set the description of the project.

@property
@prevent_deleted
def readonly() -> bool

Get whether the project is read-only.

@property
@prevent_deleted
def labels() -> List[str]

Get the labels of the project.

@property
@prevent_deleted
def script_only() -> bool

Get whether the project is script-only.

@property
@prevent_deleted
def geometry_pipeline_version() -> GeometryPipelineVersion

Get the geometry pipeline version of the project.

@property
@prevent_deleted
def dimension() -> int

Get the dimension of the project.

@property
@prevent_deleted
def geometry_no_implicit_fragment() -> bool

Get whether the project geometry has NO implicit Fragment all operation.

@property
@prevent_deleted
def pml_num_layers() -> int | None

Get the number of Perfectly Matched Layers, or None if not set.

@pml_num_layers.setter
@prevent_deleted
def pml_num_layers(value: int | None) -> None

Set the number of Perfectly Matched Layers. Use save() to commit.

@property
@prevent_deleted
def pml_thickness() -> float | int | None

Get the thickness of the PML region, or None if not set.

@pml_thickness.setter
@prevent_deleted
def pml_thickness(value: float | int | None) -> None

Set the thickness of the PML region. Use save() to commit.

@prevent_deleted
def geometry_builder() -> GeometryBuilder

Get the geometry builder for the project. Use with GeometryPipelineVersion.V2

@prevent_deleted
@deprecated("Use geometry pipeline version V2 for new projects")
def get_geometry() -> List[Geometry]

Get geometry elements in the project. Currently only one geometry element per project is supported. Use with deprecated geometry pipeline version V1.

Returns:

A list of geometry elements in the project.

@prevent_deleted
def import_step(filepath: str,
name: str | None = None) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system
  • name - Optional name for the geometry element

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_iges(filepath: str,
name: str | None = None) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system
  • name - Optional name for the geometry element

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_brep(filepath: str,
name: str | None = None) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system
  • name - Optional name for the geometry element

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_sat(filepath: str,
name: str | None = None) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system
  • name - Optional name for the geometry element

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_msh(filepath: str) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_nas(filepath: str) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def import_gds2(filepath: str,
config: GDS2ImportConfig | None = None,
layers: (List[CadGdsLayer]) | None = None,
name: str | None = None) -> Geometry | GeometryBuilder

Import the geometry file in the given path to the project.

Arguments:

  • filepath - path to a file in the local system
  • config - Optional configuration for the GDS import. Use only for deprecated GeometryPipelineVersion.V1.
  • layers - Optional layers for the GDS import. Use only for GeometryPipelineVersion.V2.
  • name - Optional name for the geometry element

Returns:

The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,

@prevent_deleted
def add_shared_file(filepath: str) -> rawapi.InputFile

Add the file in the given path to the project as shared file

Arguments:

  • filepath - path to a file in the local system. If used in a simulation, it is available with its basename.

Returns:

A handle to the created file.

Raises:

  • FileExistsError - If a file with the same name already exists and is fully uploaded.
@prevent_deleted
def add_shared_json_file(name: str, content: dict) -> rawapi.InputFile

Add shared file to the project with the given dictionary serialized into JSON as content.

Arguments:

  • name - The name for the file during the simulation
  • content - The content of the file

Returns:

A handle to the created file.

Raises:

  • FileExistsError - If a file with the same name already exists and is fully uploaded.
@prevent_deleted
def get_files() -> List[rawapi.InputFile]

Get all files in the project.

Returns:

A list of files in the project.

@prevent_deleted
def get_meshes() -> List[Mesh]

Get all meshes in the project.

Returns:

A list of meshes in the project.

@prevent_deleted
def create_mesh(mesh_settings: MeshSettings | None = None) -> Mesh

Create a new mesh in the project.

Arguments:

  • mesh_settings - The settings for the mesh.

Returns:

The created mesh.

@prevent_deleted
def get_physics() -> List[Physic]

Get all physics in the project.

@prevent_deleted
def add_physics(physic: Physic) -> Physic

Add a physics definition to the project.

Example::

solid_mechanics_physics = project.add_physics( allsolve.Physics.SolidMechanics( target=solid_mechanics_region ) ) solid_mechanics_physics.add_interactions( [ allsolve.Interaction.SolidMechanicsClamp( name=“Clamp”, target=clamp_surface_region, ), ] )

@prevent_deleted
def get_simulation(simulation_id: str) -> Simulation

Get a simulation using the simulation ID.

Arguments:

  • simulation_id - The ID of the simulation to get.

Returns:

The simulation with the given ID.

@prevent_deleted
def get_simulations() -> List[Simulation]

Get all simulations in the project.

Returns:

A list of simulations in the project.

@prevent_deleted
def create_simulation_static(
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode = rawapi.
DistributedSolverMode.DIRECT,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
physics: list[str] | None = None,
solver_tolerance: str | None = None,
nonlinear_solver_tolerance: str | None = None,
nonlinear_solver_max_iterations: str | None = None,
numerical_jacobian: bool | None = None) -> Simulation

Create a new steady-state (static) simulation in the project.

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use.
  • physics - List of physics IDs to simulate.
  • solver_tolerance - The solver tolerance expression (used when solver_mode is iterative).
  • nonlinear_solver_tolerance - The nonlinear solver tolerance expression.
  • nonlinear_solver_max_iterations - The nonlinear solver maximum iterations expression.
  • numerical_jacobian - Whether numerical Jacobian is enabled.

Returns:

The created simulation.

@prevent_deleted
def create_simulation_harmonic(
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode = rawapi.
DistributedSolverMode.DIRECT,
fundamental_frequency: str | None = None,
num_fft_samples: int | None = None,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
physics: list[str] | None = None,
solver_tolerance: str | None = None,
nonlinear_solver_tolerance: str | None = None,
nonlinear_solver_max_iterations: str | None = None,
numerical_jacobian: bool | None = None) -> Simulation

Create a new harmonic simulation in the project.

Harmonic-specific parameters: fundamental_frequency: The fundamental frequency expression. num_fft_samples: The number of FFT samples (minimum 3).

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use.
  • physics - List of physics IDs to simulate.
  • solver_tolerance - The solver tolerance expression (used when solver_mode is iterative).
  • nonlinear_solver_tolerance - The nonlinear solver tolerance expression.
  • nonlinear_solver_max_iterations - The nonlinear solver maximum iterations expression.
  • numerical_jacobian - Whether numerical Jacobian is enabled.

Returns:

The created simulation.

@prevent_deleted
def create_simulation_multiharmonic(
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode = rawapi.
DistributedSolverMode.DIRECT,
fundamental_frequency: str | None = None,
harmonics: list[int] | None = None,
num_fft_samples: int | None = None,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
physics: list[str] | None = None,
solver_tolerance: str | None = None,
nonlinear_solver_tolerance: str | None = None,
nonlinear_solver_max_iterations: str | None = None,
numerical_jacobian: bool | None = None) -> Simulation

Create a new multiharmonic simulation in the project.

Multiharmonic-specific parameters: fundamental_frequency: The fundamental frequency expression. harmonics: The list of harmonics. num_fft_samples: The number of FFT samples (minimum 3).

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use.
  • physics - List of physics IDs to simulate.
  • solver_tolerance - The solver tolerance expression (used when solver_mode is iterative).
  • nonlinear_solver_tolerance - The nonlinear solver tolerance expression.
  • nonlinear_solver_max_iterations - The nonlinear solver maximum iterations expression.
  • numerical_jacobian - Whether numerical Jacobian is enabled.

Returns:

The created simulation.

@prevent_deleted
def create_simulation_transient(
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode = rawapi.
DistributedSolverMode.DIRECT,
transient_start_time: str | None = None,
transient_end_time: str | None = None,
transient_timestep_size: str | None = None,
timestep_algorithm: rawapi.TimestepAlgorithm | None = None,
target_frequency: str | None = None,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
physics: list[str] | None = None,
solver_tolerance: str | None = None,
nonlinear_solver_tolerance: str | None = None,
nonlinear_solver_max_iterations: str | None = None,
numerical_jacobian: bool | None = None) -> Simulation

Create a new transient simulation in the project.

Transient-specific parameters: transient_start_time: The transient start time expression. transient_end_time: The transient end time expression. transient_timestep_size: The transient timestep size expression. timestep_algorithm: The timestep algorithm. target_frequency: The target frequency expression.

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use.
  • physics - List of physics IDs to simulate.
  • solver_tolerance - The solver tolerance expression (used when solver_mode is iterative).
  • nonlinear_solver_tolerance - The nonlinear solver tolerance expression.
  • nonlinear_solver_max_iterations - The nonlinear solver maximum iterations expression.
  • numerical_jacobian - Whether numerical Jacobian is enabled.

Returns:

The created simulation.

@prevent_deleted
def create_simulation_eigenmode(
name: str,
description: str,
max_run_time_minutes: int,
solver_mode: rawapi.DistributedSolverMode = rawapi.
DistributedSolverMode.DIRECT,
num_requested_eigenmodes: str | None = None,
target_eigenfrequency: str | None = None,
eigenmode_solver_tolerance: str | None = None,
eigenmode_solver_max_iterations: str | None = None,
mesh_id: str | None = None,
variable_overrides_id: str | None = None,
physics: list[str] | None = None,
solver_tolerance: str | None = None) -> Simulation

Create a new eigenmode simulation in the project.

Eigenmode-specific parameters: num_requested_eigenmodes: The number of requested eigenmodes expression. target_eigenfrequency: The target eigenfrequency expression. eigenmode_solver_tolerance: The eigenmode solver tolerance expression. eigenmode_solver_max_iterations: The eigenmode solver maximum iterations expression.

Arguments:

  • name - The name of the new simulation.
  • description - The description of the new simulation.
  • max_run_time_minutes - The maximum run time of the simulation.
  • solver_mode - The solver mode of the simulation.
  • mesh_id - The ID of the mesh to use in the simulation.
  • variable_overrides_id - The optional ID of the VariableOverrides to use.
  • physics - List of physics IDs to simulate.
  • solver_tolerance - The solver tolerance expression (used when solver_mode is iterative).

Returns:

The created simulation.

@prevent_deleted
def copy_simulation(simulation_id: str) -> Simulation

Create a copy of a simulation in the project.

Arguments:

  • simulation_id - The ID of the simulation to copy.

Returns:

The copied simulation.

@prevent_deleted
def get_regions() -> List[Region]

Get all regions in the project.

Returns:

A list of regions in the project.

@prevent_deleted
def create_region_basic(name: str, entity_type: rawapi.EntityType,
entity_tags: List[int]) -> Region

Create a basic region in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • entity_tags - The tags of the entity.

Returns:

The created region.

@prevent_deleted
def create_region_computed(name: str, entity_type: rawapi.EntityType,
operation: RegionOperation,
source_region_ids: List[str]) -> ComputedRegion

Create a computed region in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • operation - The operation to perform on the source regions.
  • source_region_ids - The IDs of the source regions.

Returns:

The created computed region.

@prevent_deleted
def create_region_rule(
name: str,
entity_type: rawapi.EntityType,
attribute_path: rawapi.AttributePath | list[tuple[str, str]]
| None = None,
bounding_box: rawapi.ExpressionBoundingBox | None = None,
min_size: rawapi.ExpressionVector | None = None,
max_size: rawapi.ExpressionVector | None = None) -> Region

Create a region rule in the project.

Arguments:

  • name - The name of the region.
  • entity_type - The type of the entity.
  • attribute_path - The attribute path to use for the region. Can be a list of tuples (key, value).
  • Example - [(“LayerName”, “Polysilicon”)]
  • bounding_box - The bounding box to use for the region.
  • min_size - The minimum size to use for the region.
  • max_size - The maximum size to use for the region.

Returns:

The created region rule.

@prevent_deleted
def create_variable(name: str,
expression: str | float | int,
description: str = "") -> Variable

Create a variable in the project.

Arguments:

  • name - The name of the variable.
  • expression - The expression of the variable.
  • description - The description of the variable.

Returns:

The created variable.

@prevent_deleted
def create_function(name: str,
args: List[str],
expression: str,
description: str = "") -> Function

Create a function in the project.

Arguments:

  • name - The name of the function.
  • args - The arguments of the function.
  • expression - The expression of the function.
  • description - The description of the function.

Returns:

The created function.

@prevent_deleted
def create_interpolated_function(
name: str,
args: List[Tuple[str, List[float]]],
values: List[float],
description: str = "",
cubic_interpolation: bool | None = None) -> InterpolatedFunction

Create an interpolated function in the project.

Arguments:

  • name - The name of the interpolated function.
  • args - The arguments of the interpolated function.
  • values - The values of the interpolated function.
  • description - The description of the interpolated function.
  • cubic_interpolation - If True, values are interpolated using a natural cubic spline. If False or None, linear interpolation is used.

Returns:

The created interpolated function.

@prevent_deleted
def get_variables() -> List[Variable]

Get all variables in the project.

@prevent_deleted
def get_functions() -> List[Function]

Get all functions in the project.

@prevent_deleted
def get_interpolated_functions() -> List[InterpolatedFunction]

Get all interpolated functions in the project.

@prevent_deleted
def create_variable_overrides(
name: str,
overrides: List[Tuple[Variable | str,
str | float | int | List[str | float | int]]],
sweep_type: rawapi.SweepType | None = None) -> VariableOverrides

Create a VariableOverrides in the project. It can be used to override a value of a single or multiple variables, or to create a sweep over variables.

Arguments:

  • name - The name of the set of variable overrides.
  • overrides - A list of variable overrides. The first element of the tuple is the variable to override. The variable can be a Variable object or a string with the name of the variable. The second element is the new value for the variable. The value can be a string, float, int, or list of strings, floats, or ints.
  • sweep_type - The type of the sweep. Only valid for sweep overrides. If not provided, it will be set to SPECIFIC_VALUES.

Returns:

The created variable overrides.

@prevent_deleted
def get_variable_overrides() -> List[VariableOverrides]

Get all variable overrides in the project.

@prevent_deleted
def get_materials() -> List[Material]

Get all materials in the project.

Returns:

A list of materials in the project.

@prevent_deleted
def create_material(
name: str,
description: str = "",
color: str = "#535050FF",
abbreviation: str | None = None,
target_region: Region | None = None,
coefficient_of_thermal_expansion: str | float | None = None,
coefficient_of_thermal_expansion_anisotropic: List[float | str]
| None = None,
density: str | float | None = None,
dynamic_viscosity: str | float | None = None,
dynamic_viscosity_anisotropic: List[List[float | str]] | None = None,
elasticity_matrix_youngs_modulus_poissons_ratio: (
MaterialProperty.ElasticityMatrixYoungsModulusPoissonsRatio
| None) = None,
elasticity_matrix_pressure_shear_velocity: (
MaterialProperty.ElasticityMatrixPressureShearVelocity
| None) = None,
elasticity_matrix: MaterialProperty.ElasticityMatrix | None = None,
electric_conductivity: str | float | None = None,
electric_conductivity_anisotropic: List[List[float | str]]
| None = None,
electric_permittivity: str | float | None = None,
electric_permittivity_anisotropic: List[List[float | str]]
| None = None,
heat_capacity: str | float | None = None,
magnetic_permeability: str | float | None = None,
magnetic_permeability_anisotropic: List[List[float | str]]
| None = None,
mass_damping_coefficient: str | float | None = None,
piezoelectric_coupling: List[List[float | str]] | None = None,
prony_series: MaterialProperty.PronySeries | None = None,
speed_of_sound: str | float | None = None,
stiffness_damping_coefficient: str | float | None = None,
thermal_conductivity: str | float | None = None,
thermal_conductivity_anisotropic: List[List[float | str]]
| None = None,
orientation: str | Tuple[float | int, float | int, float | int]
| None = None,
enabled: str | None = None) -> Material

Create a material in the project.

Arguments:

  • name - The name of the material.
  • description - Optional description of the material.
  • color - The color of the material. Format: “#RRGGBB”
  • abbreviation - Optional abbreviation of the material.
  • target_region - The target Region of the material.
  • coefficient_of_thermal_expansion - Optional coefficient of thermal expansion. Can be a float or string expression.
  • coefficient_of_thermal_expansion_anisotropic - Optional anisotropic coefficient of thermal expansion. A list of 3 floats or strings.
  • density - Optional density of the material. Can be a float or string expression.
  • dynamic_viscosity - Optional dynamic viscosity. Can be a float or string expression. Mutually exclusive with dynamic_viscosity_anisotropic.
  • dynamic_viscosity_anisotropic - Optional anisotropic dynamic viscosity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with dynamic_viscosity.
  • elasticity_matrix_youngs_modulus_poissons_ratio - Optional elasticity matrix defined by Young’s modulus and Poisson’s ratio. Mutually exclusive with elasticity_matrix and elasticity_matrix_pressure_shear_velocity.
  • elasticity_matrix_pressure_shear_velocity - Optional elasticity matrix defined by pressure and shear wave velocities. Mutually exclusive with elasticity_matrix and elasticity_matrix_youngs_modulus_poissons_ratio.
  • elasticity_matrix - Optional elasticity matrix. A MaterialProperty.ElasticityMatrix object. Mutually exclusive with elasticity_matrix_youngs_modulus_poissons_ratio and elasticity_matrix_pressure_shear_velocity.
  • electric_conductivity - Optional electric conductivity. Can be a float or string expression. Mutually exclusive with electric_conductivity_anisotropic.
  • electric_conductivity_anisotropic - Optional anisotropic electric conductivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with electric_conductivity.
  • electric_permittivity - Optional electric permittivity. Can be a float or string expression. Mutually exclusive with electric_permittivity_anisotropic.
  • electric_permittivity_anisotropic - Optional anisotropic electric permittivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with electric_permittivity.
  • heat_capacity - Optional heat capacity. Can be a float or string expression.
  • magnetic_permeability - Optional magnetic permeability. Can be a float or string expression. Mutually exclusive with magnetic_permeability_anisotropic.
  • magnetic_permeability_anisotropic - Optional anisotropic magnetic permeability. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with magnetic_permeability.
  • mass_damping_coefficient - Optional mass damping coefficient. Can be a float or string expression.
  • piezoelectric_coupling - Optional piezoelectric coupling matrix. A 6x3 matrix as a list of lists of floats or strings.
  • prony_series - Optional Prony series for viscoelastic material properties. A MaterialProperty.PronySeries object.
  • speed_of_sound - Optional speed of sound. Can be a float or string expression.
  • stiffness_damping_coefficient - Optional stiffness damping coefficient. Can be a float or string expression.
  • thermal_conductivity - Optional thermal conductivity. Can be a float or string expression. Mutually exclusive with thermal_conductivity_anisotropic.
  • thermal_conductivity_anisotropic - Optional anisotropic thermal conductivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with thermal_conductivity.
  • orientation - Optional orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]”
  • enabled - Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”
  • project_id - The ID of the project.

Returns:

The created material.

@prevent_deleted
def create_material_from_library(name: str,
target_region: Region | None = None,
enabled: str | None = None) -> Material

Create a material from the library by name.

Arguments:

  • name - The name of the library material to copy.
  • target_region - The target Region of the material.
  • enabled - Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”

Returns:

The created Material.

Raises:

  • ValueError - If no library material with the given name is found.
@prevent_deleted
def save() -> None

Explictly save the changes to the cloud made by setting properties like name, description, pml_num_layers and pml_thickness.

@prevent_deleted
def delete() -> None

Delete the project.

@prevent_deleted
def copy(with_results: bool = False,
name: str | None = None,
wait_for_completion: bool = True) -> Self

Copies the project and returns the copied project.

Arguments:

  • with_results - If True then files of the original project are copied to the new project.
  • name - The name of the new project.
  • wait_for_completion - If True, the copied project is returned after the copy job is completed. If False, get_copy_job() should be used to check the status of the copy job.

Returns:

The copied project.

@prevent_deleted
def get_copy_job() -> Job | None

Get the copy job for the project. The copy job exists only if the project was copied from another project with results.

Returns:

The copy job for the project.

@prevent_deleted
def export(include_meshes: bool = True) -> dict

Export project data as a dictionary.

The returned dict is compatible with import_project() and can be:

  • Modified programmatically before saving
  • Serialized to YAML or JSON
  • Used directly with import_project(data_dict, project_to_modify=…)

Arguments:

  • include_meshes - Whether to include mesh definitions (default True).
  • Note - Exported meshes are definitions only; mesh data is not included.

Returns:

Dictionary containing the project data.

Notes:

CAD file paths (STEP, IGES, etc.) and shared file paths are exported as placeholders in the format “placeholder:original_path”. When re-importing, you must provide the actual files at the specified paths.

Future versions may support optional file downloading.

Example:

project = Project.get(“my-project-id”) data = project.export() data[“name”] = “Modified Project”

from allsolve import import_project new_project = import_project(data)

@prevent_deleted
def export_yaml(output_path: str, include_meshes: bool = True) -> None

Export project to a YAML file.

Arguments:

  • output_path - Path to write the YAML file.
  • include_meshes - Whether to include mesh definitions (default True).

Notes:

CAD file paths are exported as placeholders. See export() docstring for details.

Example:

project = Project.get(“my-project-id”) project.export_yaml(”./my_project.yaml”)

@prevent_deleted
def export_json(output_path: str,
include_meshes: bool = True,
indent: int = 2) -> None

Export project to a JSON file.

Arguments:

  • output_path - Path to write the JSON file.
  • include_meshes - Whether to include mesh definitions (default True).
  • indent - JSON indentation level (default 2).

Notes:

CAD file paths are exported as placeholders. See export() docstring for details.

Example:

project = Project.get(“my-project-id”) project.export_json(”./my_project.json”)

class VariableOverrides()

VariableOverrides is for managing variable overrides. It can be used to override a value of a single or multiple variables in a project, or to create a sweep over variables.

@classmethod
def create(cls,
name: str,
overrides: List[Tuple[Variable | str,
str | float | int | List[str | float | int]]],
override_type: rawapi.SharedExpressionOverrideType = rawapi.
SharedExpressionOverrideType.SWEEP,
sweep_type: rawapi.SweepType | None = None,
project_id: str | None = None) -> Self

Create a new VariableOverrides.

Arguments:

  • name - The name of the set of variable overrides.
  • overrides - A list of overrides of the VariableOverrides. The first element of the tuple is the variable to override. The variable can be a Variable object or a string with the name of the variable. The second element is the new value for the variable. The value can be a string, float, int, or list of strings, floats, or ints.
  • override_type - The type of the VariableOverrides. Normal or Sweep.
  • project_id - The ID of the project.

Returns:

The created VariableOverrides.

@classmethod
def get(cls,
variable_overrides_id: str,
project_id: str | None = None) -> Self

Get a VariableOverrides by its ID.

@classmethod
def get_all(cls, project_id: str | None = None) -> List[Self]

Get all VariableOverrides in a project.

@property
@prevent_deleted
def id() -> str

Get the ID of the VariableOverrides.

@property
@prevent_deleted
def name() -> str

Get the name of the VariableOverrides.

@name.setter
@prevent_deleted
def name(name: str) -> None

Set the name of the VariableOverrides.

@property
@prevent_deleted
def type() -> rawapi.SharedExpressionOverrideType

Get the type of the VariableOverrides.

@property
@prevent_deleted
def sweep_type() -> rawapi.SweepType | None

Get the sweep type of the VariableOverrides. Only valid for sweep overrides.

@sweep_type.setter
@prevent_deleted
def sweep_type(sweep_type: rawapi.SweepType | None) -> None

Set the sweep type of the VariableOverrides. Only valid for sweep overrides.

@property
@prevent_deleted
def overrides() -> List[Tuple[Variable, str]]

Get the overrides of the VariableOverrides. The list is a copy of the overrides in the VariableOverrides. It the list is modified, use overrides setter to save the change. The list is a list of tuples, where the first element is the variable and the second is the new value for the variable.

@overrides.setter
@prevent_deleted
def overrides(
overrides: List[Tuple[Variable | str,
str | float | int | List[str | float | int]]]
) -> None

Set the overrides of the VariableOverrides.

@prevent_deleted
def delete() -> None

Delete the VariableOverrides.