Allsolve SDK API Reference
allsolve SDK 0.2.2-beta
Section titled “allsolve SDK 0.2.2-beta”allsolve.import_project
Section titled “allsolve.import_project”Contains a PoC of a convenience import format parser.
import_project
Section titled “import_project”def import_project(file_or_data: str | dict, project_to_modify: Project | None = None) -> ProjectImport 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.
parse_tuple
Section titled “parse_tuple”def parse_tuple( value: dict | tuple | list | None, expected_dimensions: int = 3) -> tuple[float | str, ...] | NoneParse a tuple value from YAML/JSON dictionary format. Accepts dictionary format with x, y, z keys (or x, y for 2D).
allsolve.material
Section titled “allsolve.material”MaterialProperty Objects
Section titled “MaterialProperty Objects”class MaterialProperty()MaterialProperty is a base class for managing material properties.
Material Objects
Section titled “Material Objects”class Material()Material is a class for managing materials in a project.
@classmethoddef 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) -> SelfCreate 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.
@classmethoddef get(cls, material_id: str, project_id: str | None = None) -> SelfGet a material by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all materials in a project.
@property@prevent_deleteddef id() -> strGet the ID of the material.
@property@prevent_deleteddef name() -> strGet the name of the material.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the material. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the material.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the material. Use save() to commit the change.
@property@prevent_deleteddef color() -> strGet the color of the material.
@color.setter@prevent_deleteddef color(color: str) -> NoneSet the color of the material. Use save() to commit the change.
@property@prevent_deleteddef target() -> str | NoneGet the target of the material.
@target.setter@prevent_deleteddef target(target: str) -> NoneSet the target of the material. Use save() to commit the change.
properties
Section titled “properties”@property@prevent_deleteddef properties() -> List[rawapi.PhysicalProperty]Get the properties of the material.
properties
Section titled “properties”@properties.setter@prevent_deleteddef properties(properties: List[rawapi.PhysicalProperty]) -> NoneSet the properties of the material. Use save() to commit the change.
abbreviation
Section titled “abbreviation”@property@prevent_deleteddef abbreviation() -> str | NoneGet the abbreviation of the material.
abbreviation
Section titled “abbreviation”@abbreviation.setter@prevent_deleteddef abbreviation(abbreviation: str) -> NoneSet the abbreviation of the material. Use save() to commit the change.
orientation
Section titled “orientation”@property@prevent_deleteddef orientation() -> str | NoneGet the orientation of the material.
orientation
Section titled “orientation”@orientation.setter@prevent_deleteddef orientation( orientation: str | Tuple[float | int, float | int, float | int] | None) -> NoneSet 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.
enabled
Section titled “enabled”@property@prevent_deleteddef enabled() -> str | NoneGet the enabled status of the material.
enabled
Section titled “enabled”@enabled.setter@prevent_deleteddef enabled(enabled: str) -> NoneSet the enabled status of the material. Use save() to commit the change.
@prevent_deleteddef delete() -> NoneDelete the material.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties name, description, color, and properties.
allsolve.token
Section titled “allsolve.token”allsolve.intcomp
Section titled “allsolve.intcomp”Integer compression library for efficient storage of integer sequences.
Uses differential encoding combined with optional zstd compression or RLE.
Scheme Objects
Section titled “Scheme Objects”class Scheme(IntEnum)Compression scheme used for encoding.
Simple differential encoding
DIFF_RLE
Section titled “DIFF_RLE”Differential + run-length encoding
DIFF_ZSTD
Section titled “DIFF_ZSTD”Differential + zstd compression
def encode(ints: List[int], zstd_compressor: Optional[zstd.ZstdCompressor] = None) -> bytesEncode 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.
allsolve.util
Section titled “allsolve.util”NotInitializedError Objects
Section titled “NotInitializedError Objects”class NotInitializedError(Exception)Exception for when a class or data is not initialized.
DeletedError Objects
Section titled “DeletedError Objects”class DeletedError(Exception)Exception for when an object is deleted.
NotProjectAPIKeyError Objects
Section titled “NotProjectAPIKeyError Objects”class NotProjectAPIKeyError(Exception)Exception for when a project API key is not set.
prevent_deleted
Section titled “prevent_deleted”def prevent_deleted(f)Decorator to prevent access to methods/properties of deleted objects. Raises DeletedError if the object’s _deleted attribute is True.
allsolve.job
Section titled “allsolve.job”Job Objects
Section titled “Job Objects”class Job()Job for a project.
Jobs are created when a geometry or a mesh is processed, or when a simulation is run.
@propertydef id() -> strGet the job ID
get_status
Section titled “get_status”def get_status() -> str | NoneGet the current status of the job.
Returns:
The status of the job.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = DEFAULT_DELAY_S) -> str | NoneRefresh 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.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
get_logs
Section titled “get_logs”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.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint 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.
get_status_reason
Section titled “get_status_reason”def get_status_reason() -> str | NoneGet the reason for the current job status, if available
Returns:
The reason for the current job status, if available.
allsolve.region
Section titled “allsolve.region”RegionOperation Objects
Section titled “RegionOperation Objects”class RegionOperation(Enum)Enum for the RegionOperation.
Region Objects
Section titled “Region Objects”class Region()Region of a geometry.
get_all
Section titled “get_all”@classmethoddef 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.
@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, entity_tags: List[int], region_rule: rawapi.RegionRule | None = None, project_id: str | None = None) -> SelfCreate 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_deleteddef id() -> strGet the ID of the region.
@property@prevent_deleteddef name() -> strGet the name of the region.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> List[int]Get the entity tags of the region.
entity_type
Section titled “entity_type”@property@prevent_deleteddef entity_type() -> rawapi.EntityTypeGet the entity type of the region.
@prevent_deleteddef delete() -> NoneDelete the region.
KeyValueAttributePath Objects
Section titled “KeyValueAttributePath Objects”class KeyValueAttributePath(rawapi.AttributePath)KeyValueAttributePath.
RegionRule Objects
Section titled “RegionRule Objects”class RegionRule(Region)RegionRule.
@classmethoddef 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) -> SelfCreate 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.
ComputedRegion Objects
Section titled “ComputedRegion Objects”class ComputedRegion(Region)ComputedRegion.
@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, operation: rawapi.RegionRuleOperation, source_region_ids: List[str], project_id: str | None = None) -> SelfCreate 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.
allsolve.simulation.simulation
Section titled “allsolve.simulation.simulation”CPU Objects
Section titled “CPU Objects”class CPU(Enum)Enum for the type of CPU.
Runtime Objects
Section titled “Runtime Objects”class Runtime()Runtime for a simulation.
Script Objects
Section titled “Script Objects”class Script()Script for a simulation.
SolverMode Objects
Section titled “SolverMode Objects”class SolverMode()Solver mode for a simulation.
Simulation Objects
Section titled “Simulation Objects”class Simulation(JobMixin)Simulation of a project.
@classmethoddef get(cls, simulation_id: str, project_id: str | None = None) -> SelfGet 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.
get_all
Section titled “get_all”@classmethoddef 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.
copy_simulation
Section titled “copy_simulation”@classmethoddef copy_simulation(cls, simulation_id: str, project_id: str | None = None) -> SelfMake 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.
@classmethoddef 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, project_id: str | None = None) -> SelfCreate 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.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_deleteddef id() -> strGet the ID of the simulation.
@property@prevent_deleteddef name() -> strGet the name of the simulation.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the simulation.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the simulation.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the simulation.
mesh_id
Section titled “mesh_id”@property@prevent_deleteddef mesh_id() -> str | NoneGet the ID of the mesh used in the simulation.
mesh_id
Section titled “mesh_id”@mesh_id.setter@prevent_deleteddef mesh_id(mesh_id: str) -> NoneSet the ID of the mesh used in the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the simulation.
solver_mode
Section titled “solver_mode”@property@prevent_deleteddef solver_mode() -> rawapi.DistributedSolverModeGet the solver mode of the simulation.
solver_mode
Section titled “solver_mode”@solver_mode.setter@prevent_deleteddef solver_mode(solver_mode: rawapi.DistributedSolverMode) -> NoneSet the solver mode of the simulation.
node_count
Section titled “node_count”@property@prevent_deleteddef node_count() -> int | NoneGet the number of nodes used in the simulation.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> CPUGet the type of nodes used in the simulation.
shared_files
Section titled “shared_files”@property@prevent_deleteddef shared_files() -> List[rawapi.InputFile]Get the shared files used in the simulation.
@property@prevent_deleteddef files() -> List[rawapi.InputFile]Get the files used in the simulation.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> VariableOverrides | NoneGet the variable overrides of the simulation.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides(variable_overrides: VariableOverrides | None) -> NoneSet the variable overrides of the simulation.
set_scripts
Section titled “set_scripts”@prevent_deleteddef set_scripts(scripts: List[Script]) -> NoneSet the scripts used in the simulation.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh 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.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the simulation.
Returns:
The status of the processing of the simulation.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
get_status_reason
Section titled “get_status_reason”@prevent_deleteddef get_status_reason() -> str | NoneGet the status reason of the simulation.
Returns:
The status reason of the simulation.
get_logs
Section titled “get_logs”@prevent_deleteddef 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.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the simulation.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
set_runtime
Section titled “set_runtime”@prevent_deleteddef set_runtime(runtime: Runtime) -> NoneSet the runtime of the simulation.
@prevent_deleteddef save() -> NoneExplictly save the changes to the cloud made by set_runtime method
or setting properties name, description, mesh_id, max_run_time_minutes, solver_mode and variable_overrides.
Otherwise the changes are saved automatically when start() is called.
set_shared_files
Section titled “set_shared_files”@prevent_deleteddef set_shared_files(handles: List[rawapi.InputFile]) -> NoneTakes 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
add_file
Section titled “add_file”@prevent_deleteddef add_file(filepath: str) -> rawapi.InputFileAdd 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.
add_json_file
Section titled “add_json_file”@prevent_deleteddef add_json_file(name: str, content: dict) -> rawapi.InputFileAdd a JSON file to the simulation with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- dictionary containing your data
Returns:
The file handle.
Raises:
FileExistsError- If a file with the same name already exists and is fully uploaded.
@prevent_deleteddef start() -> NoneStart the simulation.
@prevent_deleteddef abort() -> NoneAbort the simulation.
get_output_csv
Section titled “get_output_csv”@prevent_deleteddef get_output_csv( delimiter=",", refresh: bool = False, csv_format: CsvExportFormat = CsvExportFormat.EXPLODED) -> strGet 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.
get_output_data
Section titled “get_output_data”@prevent_deleteddef get_output_data(refresh: bool = True) -> SimulationOutputDataReturns the output data of the simulation.
Arguments:
refresh- Whether to refresh the output data.
Returns:
allsolve.sim.SimulationOutputData object
get_output_values
Section titled “get_output_values”@prevent_deleteddef get_output_values(sweep_index: int = 0, refresh: bool = False) -> dictGet 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.
clean_output_data_cache
Section titled “clean_output_data_cache”@prevent_deleteddef clean_output_data_cache() -> NoneClean the output data cache for this simulation. This invalidates any existing SimulationOutputData objects for this simulation.
save_output_field
Section titled “save_output_field”@prevent_deleteddef save_output_field(name: str, output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave 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.
save_output_mesh
Section titled “save_output_mesh”@prevent_deleteddef save_output_mesh(name: str, output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave 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.
save_output_files
Section titled “save_output_files”@prevent_deleteddef save_output_files(filenames: List[str], output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave 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_deleteddef copy() -> SelfMake a copy of the simulation. Useful for creating simulations from a template.
Returns:
The copied simulation.
@prevent_deleteddef delete() -> NoneDelete 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”InfoRow Objects
Section titled “InfoRow Objects”class InfoRow(_Row)parent_job_id
Section titled “parent_job_id”The root job id in case of sweep simulations.
SimulationOutput Objects
Section titled “SimulationOutput Objects”class SimulationOutput()Sweep step job id or the main job id in case of non-sweep simulations.
job_index
Section titled “job_index”Sweep step index.
overrides
Section titled “overrides”Sweep step overrides by variable name.
SimulationStepRow Objects
Section titled “SimulationStepRow Objects”class SimulationStepRow(_Row)raw_step
Section titled “raw_step”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.
FieldOutputDefinitionRow Objects
Section titled “FieldOutputDefinitionRow Objects”class FieldOutputDefinitionRow(_Row)The type of the field.
The user specified name for the field output.
specifier
Section titled “specifier”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.
file_name_format
Section titled “file_name_format”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}.
file_name_prefix
Section titled “file_name_prefix”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.
ValueOutputDefinitionRow Objects
Section titled “ValueOutputDefinitionRow Objects”class ValueOutputDefinitionRow(_Row)The user specified name for the value output.
specifier
Section titled “specifier”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".
BlobDatabase Objects
Section titled “BlobDatabase Objects”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]])].
SimulationOutputDatabase Objects
Section titled “SimulationOutputDatabase Objects”class SimulationOutputDatabase()get_value_data
Section titled “get_value_data”def get_value_data(value: ValueOutput) -> array.array[float]Get data for a value output.
allsolve.simulation
Section titled “allsolve.simulation”allsolve.simulation.simulation_output_data
Section titled “allsolve.simulation.simulation_output_data”CsvExportFormat Objects
Section titled “CsvExportFormat Objects”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.
ValueId
Section titled “ValueId”Value identifier consists of the name and the specifier.
ValueHeaderOrId
Section titled “ValueHeaderOrId”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.
SimulationOutputData Objects
Section titled “SimulationOutputData Objects”class SimulationOutputData()refresh
Section titled “refresh”def refresh() -> NoneDownload the simulation output data. Data is stored in the cache directory.
clean_cache
Section titled “clean_cache”def clean_cache() -> NoneClean the local output data cache directory for this simulation. To use output data again, you need to call refresh to download the data again.
to_dict
Section titled “to_dict”def to_dict(sweep_index: int = 0) -> dict[str, dict[str, list[float]]]Returns the value output data of a single sweep step as a dictionary.
to_csv_stream
Section titled “to_csv_stream”def to_csv_stream( delimiter=",", stream: TextIO | None = None, csv_format: CsvExportFormat = CsvExportFormat.EXPLODED) -> StringIO | NoneWrite CSV data to a stream.
Arguments:
delimiter- The delimiter to use in the CSV output.stream- Optional stream to write to.
Returns:
None if stream was provided, StringIO if no stream was provided.
Examples:
Get a StringIO
Section titled “Get a StringIO”csv_stream = data.to_csv_stream()
Stream directly to a file
Section titled “Stream directly to a file”with open(“output.csv”, “w”) as f: data.to_csv_stream(stream=f)
get_value_headers
Section titled “get_value_headers”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)“
get_value_ids
Section titled “get_value_ids”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”)
get_sweep_step_overrides
Section titled “get_sweep_step_overrides”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 = -1for i, step_overrides in enumerate(overrides): if step_overrides["my_variable"][0] == 42: sweep_index = i breakThe 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.
get_sweep_index
Section titled “get_sweep_index”def get_sweep_index(variable_name: str, value: float | list[float]) -> intFinds 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 42sweep_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.
get_sweep_count
Section titled “get_sweep_count”def get_sweep_count() -> intReturns the total number of sweep steps.
get_step_count
Section titled “get_step_count”def get_step_count(sweep_index: int | None = None) -> intReturns 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.
get_step_labels
Section titled “get_step_labels”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.
get_step_label
Section titled “get_step_label”def get_step_label(step_index: int) -> strReturns the step_indexth value of the get_step_labels list.
get_step_index
Section titled “get_step_index”def get_step_index(step_label: str | float | int | None) -> intFinds 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.0step_index = data.get_step_index(1.0)
# Get the the step index for data that was saved without specifying a stepstep_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 usingstr(float_value).
get_array_index_count_at
Section titled “get_array_index_count_at”def get_array_index_count_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId) -> intEquivalent to len(get_values_at(sweep_index, step_index, value_header)).
get_value_at
Section titled “get_value_at”def get_value_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId, array_index: int | None = None) -> float | NoneEquivalent to get_values_at(sweep_index, step_index, value_header)[array_index].
get_values_at
Section titled “get_values_at”def get_values_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId) -> list[float] | NoneReturns 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 stringvalues = data.get_values_at(sweep_index, step_index, "Impedance (real)")allsolve.mesh
Section titled “allsolve.mesh”ExtrusionLayerDefinition Objects
Section titled “ExtrusionLayerDefinition Objects”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.
MeshRefinement Objects
Section titled “MeshRefinement Objects”class MeshRefinement()A refinement for a mesh.
Arguments:
region- The region to refine.max_size- The maximum size of the refinement.
SlantedExtrusion Objects
Section titled “SlantedExtrusion Objects”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.
PathExtrusion Objects
Section titled “PathExtrusion Objects”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.
FlattenAndRebuildExtrusion Objects
Section titled “FlattenAndRebuildExtrusion Objects”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.
MeshExtrusion Objects
Section titled “MeshExtrusion Objects”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.
MeshDensity Objects
Section titled “MeshDensity Objects”class MeshDensity(Enum)Enum for the density of a mesh.
MeshQuality Objects
Section titled “MeshQuality Objects”class MeshQuality(Enum)Enum for the quality of a mesh. @deprecated: Use MeshDensity instead.
MeshSettings Objects
Section titled “MeshSettings Objects”class MeshSettings()Container for settings that can be configured when creating a mesh.
Mesh Objects
Section titled “Mesh Objects”class Mesh(JobMixin)Mesh of a project geometry.
@classmethoddef create(cls, project_id: str, mesh_settings: MeshSettings | None = None) -> SelfCreate 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.
@classmethoddef get(cls, mesh_id: str, project_id: str | None = None) -> SelfGet 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.
get_all
Section titled “get_all”@classmethoddef 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_deleteddef id() -> strGet the ID of the mesh.
@property@prevent_deleteddef name() -> strGet the name of the mesh.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the mesh. Use save() to commit the change.
quality
Section titled “quality”@property@deprecated("Use density instead")@prevent_deleteddef quality() -> MeshQualityGet the quality of the mesh.
quality
Section titled “quality”@quality.setter@deprecated("Use density instead")@prevent_deleteddef quality(quality: MeshQuality) -> NoneSet the quality of the mesh. Use save() to commit the change.
density
Section titled “density”@property@prevent_deleteddef density() -> MeshDensityGet the density of the mesh.
density
Section titled “density”@density.setter@prevent_deleteddef density(density: MeshDensity) -> NoneSet the density of the mesh. Use save() to commit the change.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> str | NoneGet the node type of the mesh.
node_type
Section titled “node_type”@node_type.setter@prevent_deleteddef node_type(node_type: str) -> NoneSet the node type of the mesh. Use save() to commit the change.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the mesh.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the mesh. Use save() to commit the change.
use_mesh_refiner
Section titled “use_mesh_refiner”@property@prevent_deleteddef use_mesh_refiner() -> boolGet whether the mesh uses the mesh refiner.
use_mesh_refiner
Section titled “use_mesh_refiner”@use_mesh_refiner.setter@prevent_deleteddef use_mesh_refiner(use_mesh_refiner: bool) -> NoneSet whether the mesh uses the mesh refiner. Use save() to commit the change.
mesh_size_min
Section titled “mesh_size_min”@property@prevent_deleteddef mesh_size_min() -> float | NoneGet the minimum mesh size of the mesh.
mesh_size_min
Section titled “mesh_size_min”@mesh_size_min.setter@prevent_deleteddef mesh_size_min(mesh_size_min: float) -> NoneSet the minimum mesh size of the mesh. Use save() to commit the change.
mesh_size_max
Section titled “mesh_size_max”@property@prevent_deleteddef mesh_size_max() -> float | NoneGet the maximum mesh size of the mesh.
mesh_size_max
Section titled “mesh_size_max”@mesh_size_max.setter@prevent_deleteddef mesh_size_max(mesh_size_max: float) -> NoneSet the maximum mesh size of the mesh. Use save() to commit the change.
scale_factor
Section titled “scale_factor”@property@prevent_deleteddef scale_factor() -> float | NoneGet the scale factor of the mesh.
scale_factor
Section titled “scale_factor”@scale_factor.setter@prevent_deleteddef scale_factor(scale_factor: float) -> NoneSet the scale factor of the mesh. Use save() to commit the change.
curvature_enhancement
Section titled “curvature_enhancement”@property@prevent_deleteddef curvature_enhancement() -> float | NoneGet the curvature enhancement of the mesh.
curvature_enhancement
Section titled “curvature_enhancement”@curvature_enhancement.setter@prevent_deleteddef curvature_enhancement(curvature_enhancement: float) -> NoneSet the curvature enhancement of the mesh. Use save() to commit the change.
curved_mesh
Section titled “curved_mesh”@property@prevent_deleteddef curved_mesh() -> boolGet whether the mesh is curved.
curved_mesh
Section titled “curved_mesh”@curved_mesh.setter@prevent_deleteddef curved_mesh(curved_mesh: bool) -> NoneSet whether the mesh is curved. Use save() to commit the change.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@property@prevent_deleteddef target_width_to_height_ratio() -> float | NoneGet the target width to height ratio of the mesh.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@target_width_to_height_ratio.setter@prevent_deleteddef target_width_to_height_ratio(target_width_to_height_ratio: float) -> NoneSet the target width to height ratio of the mesh. Use save() to commit the change.
refinements
Section titled “refinements”@property@prevent_deleteddef refinements() -> List[MeshRefinement] | NoneGet the refinements of the mesh.
refinements
Section titled “refinements”@refinements.setter@prevent_deleteddef refinements(refinements: List[MeshRefinement]) -> NoneSet the refinements of the mesh. Use save() to commit the change.
extrusion
Section titled “extrusion”@property@prevent_deleteddef extrusion() -> MeshExtrusion | NoneGet the extrusion of the mesh.
extrusion
Section titled “extrusion”@extrusion.setter@prevent_deleteddef extrusion(extrusion: MeshExtrusion) -> NoneSet the extrusion of the mesh. Use save() to commit the change.
slanted_extrusions
Section titled “slanted_extrusions”@property@prevent_deleteddef slanted_extrusions() -> List[SlantedExtrusion] | NoneGet the extrusions of the mesh.
set_slanted_extrusions
Section titled “set_slanted_extrusions”@slanted_extrusions.setter@prevent_deleteddef set_slanted_extrusions( slanted_extrusions: List[SlantedExtrusion] | None) -> NoneSet the slanted extrusions of the mesh. Use save() to commit the change.
path_extrusions
Section titled “path_extrusions”@property@prevent_deleteddef path_extrusions() -> List[PathExtrusion] | NoneGet the path extrusions of the mesh.
set_path_extrusions
Section titled “set_path_extrusions”@path_extrusions.setter@prevent_deleteddef set_path_extrusions(path_extrusions: List[PathExtrusion] | None) -> NoneSet the path extrusions of the mesh. Use save() to commit the change.
flatten_and_rebuild_extrusions
Section titled “flatten_and_rebuild_extrusions”@property@prevent_deleteddef flatten_and_rebuild_extrusions() -> List[FlattenAndRebuildExtrusion] | NoneGet the flatten and rebuild extrusions of the mesh.
set_flatten_and_rebuild_extrusions
Section titled “set_flatten_and_rebuild_extrusions”@flatten_and_rebuild_extrusions.setter@prevent_deleteddef set_flatten_and_rebuild_extrusions( flatten_and_rebuild_extrusions: List[FlattenAndRebuildExtrusion] | None) -> NoneSet the flatten and rebuild extrusions of the mesh. Use save() to commit the change.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> List[VariableOverrides] | NoneGet the variable overrides of the mesh.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides( variable_overrides: List[VariableOverrides] | None) -> NoneSet the variable overrides of the mesh. Use save() to commit the change.
@prevent_deleteddef save() -> NoneExplicitly 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_deleteddef start(variable_overrides_id: str | None = None) -> NoneStart processing the mesh.
Arguments:
variable_overrides_id- Optional VariableOverrides id to use for the mesh.
@prevent_deleteddef run(variable_overrides_id: str | None = None, print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcess 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_deleteddef abort() -> NoneAbort the processing of the mesh.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the mesh.
Returns:
The status of the processing of the mesh.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh 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.
get_logs
Section titled “get_logs”@prevent_deleteddef 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.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint 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_deleteddef delete() -> NoneDelete the mesh from the project.
@prevent_deleteddef copy(name: str | None = None) -> SelfCopy the mesh.
Arguments:
name- Optional name of the new mesh.
Returns:
The copied mesh.
save_mesh_file
Section titled “save_mesh_file”@prevent_deleteddef save_mesh_file(output_dir: str = "./", filename: str = "mesh.msh", variable_overrides_id: str | None = None) -> NoneSave 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.
allsolve.api
Section titled “allsolve.api”is_setup
Section titled “is_setup”def is_setup() -> boolCheck if the Allsolve API client has been initialized.
get_cache_dir
Section titled “get_cache_dir”def get_cache_dir() -> str | NoneGet 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.
clean_cache
Section titled “clean_cache”def clean_cache() -> NoneDelete the cache directory used by all Allsolve projects.
allsolve.file
Section titled “allsolve.file”delete_file
Section titled “delete_file”def delete_file(handle: rawapi.InputFile, project_id: str | None = None) -> NoneDelete 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.
allsolve.geometry.geometry_element
Section titled “allsolve.geometry.geometry_element”GDSUnit Objects
Section titled “GDSUnit Objects”class GDSUnit()GDSUnit describes a unit in GDS2 file.
@propertydef value() -> str | NoneGet the value of the GDS unit.
@value.setterdef value(value: str | None) -> NoneSet the value of the GDS unit.
GDSAbsoluteLayer Objects
Section titled “GDSAbsoluteLayer Objects”class GDSAbsoluteLayer()GDSAbsoluteLayer describes a layer in GDS2 file with thickness and absolute z0.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
absolute_z0
Section titled “absolute_z0”@propertydef absolute_z0() -> GDSUnitGet the absolute z0 of the layer.
absolute_z0
Section titled “absolute_z0”@absolute_z0.setterdef absolute_z0(value: GDSUnit) -> NoneSet the absolute z0 of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDSStackedLayer Objects
Section titled “GDSStackedLayer Objects”class GDSStackedLayer()GDSStackedLayer describes a layer in GDS2 file with thickness. Z0 is calculated from previous layers.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
thickness
Section titled “thickness”@propertydef thickness() -> GDSUnitGet the thickness of the layer.
thickness
Section titled “thickness”@thickness.setterdef thickness(value: GDSUnit) -> NoneSet the thickness of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDS2ImportConfig Objects
Section titled “GDS2ImportConfig Objects”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.
@propertydef unit() -> GeometryUnitGet the unit of the GDSImportConfig.
GeometryElement Objects
Section titled “GeometryElement Objects”class GeometryElement()GeometryElement is a base class for importing a geometry to a project.
ImportGeometry Objects
Section titled “ImportGeometry Objects”class ImportGeometry()ImportGeometry is a base class for importing a geometry to a project from a file.
ImportStep Objects
Section titled “ImportStep Objects”class ImportStep(ImportGeometry)ImportStep is a class for importing a STEP file to a project.
ImportIges Objects
Section titled “ImportIges Objects”class ImportIges(ImportGeometry)ImportIges is a class for importing an IGES file to a project.
ImportBrep Objects
Section titled “ImportBrep Objects”class ImportBrep(ImportGeometry)ImportBrep is a class for importing a BREP file to a project.
ImportSat Objects
Section titled “ImportSat Objects”class ImportSat(ImportGeometry)ImportSat is a class for importing a SAT file to a project.
ImportMsh Objects
Section titled “ImportMsh Objects”class ImportMsh(ImportGeometry)ImportMsh is a class for importing a MSH file to a project.
ImportNas Objects
Section titled “ImportNas Objects”class ImportNas(ImportGeometry)ImportNas is a class for importing a NAS file to a project.
ImportGds2 Objects
Section titled “ImportGds2 Objects”class ImportGds2(ImportGeometry)ImportGds2 is a class for importing a GDS2 file to a project.
allsolve.geometry.cad_geometry_type
Section titled “allsolve.geometry.cad_geometry_type”CadGeometryType Objects
Section titled “CadGeometryType Objects”class CadGeometryType(Enum)Enum for CAD geometry element types.
allsolve.geometry.cad_geometry_element
Section titled “allsolve.geometry.cad_geometry_element”CadGeometryElement Objects
Section titled “CadGeometryElement Objects”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_deleteddef id() -> str | NoneGet the ID of the geometry element.
project_id
Section titled “project_id”@property@prevent_deleteddef project_id() -> strGet the project ID of the geometry element.
@property@prevent_deleteddef name() -> str | NoneGet the name of the geometry element.
@name.setterdef name(value: str | None) -> NoneSet the name of the geometry element.
enabled
Section titled “enabled”@property@prevent_deleteddef enabled() -> str | bool | NoneGet the enabled state of the geometry element. Can be a boolean or a string expression.
enabled
Section titled “enabled”@enabled.setterdef enabled(value: str | bool | None) -> NoneSet the enabled state of the geometry element. Can be a boolean or a string expression.
@property@abc.abstractmethoddef type() -> CadGeometryTypeGet the type of the geometry element.
Returns:
The CadGeometryType enum value for this geometry element.
@prevent_deleteddef delete() -> NoneDelete the geometry element from the project.
@prevent_deleteddef save() -> NoneSave 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.
allsolve.geometry.cad_simple_operation
Section titled “allsolve.geometry.cad_simple_operation”CadTranslate Objects
Section titled “CadTranslate Objects”class CadTranslate(CadGeometryElement)CadTranslate represents a translate of a CAD geometry element.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the translate.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the translate.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the union.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the translate.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the translate.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the translate.
translation
Section titled “translation”@property@prevent_deleteddef translation() -> tuple[float | str, float | str, float | str] | NoneGet the translation vector.
translation
Section titled “translation”@translation.setter@prevent_deleteddef translation( translation: tuple[float | str, float | str, float | str]) -> NoneSet the translation vector.
copy_object
Section titled “copy_object”@property@prevent_deleteddef copy_object() -> boolGet the copy_object flag.
copy_object
Section titled “copy_object”@copy_object.setter@prevent_deleteddef copy_object(copy_object: bool) -> NoneSet the copy_object flag.
@property@prevent_deleteddef repeat() -> int | str | NoneGet the repeat count.
@repeat.setter@prevent_deleteddef repeat(repeat: int | str | None) -> NoneSet the repeat count.
CadRotate Objects
Section titled “CadRotate Objects”class CadRotate(CadGeometryElement)CadRotate represents a rotation of a CAD geometry element.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the rotate.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the rotate.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the rotate.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the rotate.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the rotate.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the rotate.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the rotation axis vector.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the rotation axis vector.
@property@prevent_deleteddef center() -> tuple[float | str, float | str, float | str]Get the center point for rotation.
@center.setter@prevent_deleteddef center(center: tuple[float | str, float | str, float | str]) -> NoneSet the center point for rotation.
@property@prevent_deleteddef angle() -> float | strGet the rotation angle.
@angle.setter@prevent_deleteddef angle(angle: float | str) -> NoneSet the rotation angle.
copy_object
Section titled “copy_object”@property@prevent_deleteddef copy_object() -> boolGet the copy_object flag.
copy_object
Section titled “copy_object”@copy_object.setter@prevent_deleteddef copy_object(copy_object: bool) -> NoneSet the copy_object flag.
@property@prevent_deleteddef repeat() -> int | str | NoneGet the repeat count.
@repeat.setter@prevent_deleteddef repeat(repeat: int | str | None) -> NoneSet the repeat count.
CadGrid Objects
Section titled “CadGrid Objects”class CadGrid(CadGeometryElement)CadGrid represents a grid pattern of CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the grid.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the grid.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the grid.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the grid.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the grid.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the grid.
translation
Section titled “translation”@property@prevent_deleteddef translation() -> tuple[float | str, float | str, float | str]Get the translation vector for grid spacing.
translation
Section titled “translation”@translation.setter@prevent_deleteddef translation( translation: tuple[float | str, float | str, float | str]) -> NoneSet the translation vector for grid spacing.
@property@prevent_deleteddef 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_deleteddef size(size: tuple[int | str, int | str, int | str]) -> NoneSet the grid size as a tuple of 3 positive integers (x, y, z).
CadRemove Objects
Section titled “CadRemove Objects”class CadRemove(CadGeometryElement)CadRemove represents a removal of CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the remove.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the remove.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the remove.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the remove.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the remove.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the remove.
allsolve.geometry
Section titled “allsolve.geometry”allsolve.geometry.cad_boolean_operation
Section titled “allsolve.geometry.cad_boolean_operation”CadUnion Objects
Section titled “CadUnion Objects”class CadUnion(CadGeometryElement)CadUnion represents a union of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the union.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the union.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the union.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the union.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the union.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the union.
CadDifference Objects
Section titled “CadDifference Objects”class CadDifference(_CadBinaryBooleanOperation)CadDifference represents a difference of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadIntersection Objects
Section titled “CadIntersection Objects”class CadIntersection(_CadBinaryBooleanOperation)CadIntersectionOperation represents an intersection of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadFragments Objects
Section titled “CadFragments Objects”class CadFragments(_CadBinaryBooleanOperation)CadFragments represents a fragments operation of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadFragmentAll Objects
Section titled “CadFragmentAll Objects”class CadFragmentAll(CadGeometryElement)CadFragmentAll represents a fragment all operation that fragments all CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
allsolve.geometry.cad_utils
Section titled “allsolve.geometry.cad_utils”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.
to_str_list
Section titled “to_str_list”def to_str_list(value: str | list[str] | None) -> list[str] | NonePython 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.
extract_entities_from_elements
Section titled “extract_entities_from_elements”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.
validate_cad_path
Section titled “validate_cad_path”def validate_cad_path(cad_path: CadPath) -> NoneValidate a CAD path.
validate_entity_set
Section titled “validate_entity_set”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) -> NoneValidate that at least one entity set is provided and non-empty.
create_cad_entities_from_lists
Section titled “create_cad_entities_from_lists”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.
create_boolean
Section titled “create_boolean”def create_boolean(value: bool | str | None) -> rawapi.CadBoolean | NoneCreate a CadBoolean from a boolean or string expression.
create_scalar
Section titled “create_scalar”def create_scalar(value: float | str) -> rawapi.CadScalarCreate a CadScalar from a numeric value or expression string.
create_angular_unit
Section titled “create_angular_unit”def create_angular_unit(unit: str | None) -> rawapi.CadAngularUnit | NoneCreate a CadAngularUnit from a string. Allowed values are: degree, radian.
create_distance_unit
Section titled “create_distance_unit”def create_distance_unit(unit: str | None) -> rawapi.CadDistanceUnit | NoneCreate a CadDistanceUnit from a string. Allowed values are: m, meter, mm, millimeter, um, micrometer, nm, nanometer, yard, foot, inch.
create_distance
Section titled “create_distance”def create_distance(value: float | str | tuple[float | str, str], default_unit: str | None = None) -> rawapi.CadDistanceCreate a CadDistance from a value with optional unit.
create_angle
Section titled “create_angle”def create_angle(value: float | str, default_unit: str | None = "degree") -> rawapi.CadAngleCreate a CadAngle from a value with optional unit.
create_vector
Section titled “create_vector”def create_vector( coords: tuple[float | str, float | str, float | str]) -> rawapi.CadVectorCreate a CadVector from a tuple of coordinates.
create_vector_2d
Section titled “create_vector_2d”def create_vector_2d( coords: tuple[float | str, float | str]) -> rawapi.CadVectorCreate a CadVector from a 2D tuple of coordinates (z will be 0).
create_euler_angles
Section titled “create_euler_angles”def create_euler_angles( angles: tuple[float | str, float | str, float | str]) -> rawapi.CadEulerAnglesCreate CadEulerAngles from a tuple of angles in degrees.
from_boolean
Section titled “from_boolean”def from_boolean(boolean: rawapi.CadBoolean | None) -> bool | str | NoneConvert a CadBoolean to a boolean or string expression.
from_scalar
Section titled “from_scalar”def from_scalar(scalar: rawapi.CadScalar) -> float | strConvert 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.
from_distance
Section titled “from_distance”def from_distance(distance: rawapi.CadDistance) -> float | strConvert 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.
from_angle
Section titled “from_angle”def from_angle(angle: rawapi.CadAngle) -> float | strConvert 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.
from_vector
Section titled “from_vector”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.
from_vector_2d
Section titled “from_vector_2d”def from_vector_2d( vector: rawapi.CadVector) -> tuple[float | str, float | str]Convert a CadVector to a tuple of 2D coordinates.
from_euler_angles
Section titled “from_euler_angles”def from_euler_angles( angles: rawapi.CadEulerAngles | None) -> tuple[float | str, float | str, float | str] | NoneConvert 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.
allsolve.geometry.geometry
Section titled “allsolve.geometry.geometry”Geometry Objects
Section titled “Geometry Objects”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) -> SelfCreate 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.
@classmethoddef 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.
delete_geometry
Section titled “delete_geometry”@classmethoddef delete_geometry(cls: type[Self], project_id: str) -> NoneDelete the geometry from the project.
@property@prevent_deleteddef id() -> strGet the ID of the geometry element.
@property@prevent_deleteddef name() -> strGet the name of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
@deprecated("Use geometry pipeline version V2 for new projects")@prevent_deleteddef start() -> NoneStart processing the imported geometry file.
@deprecated("Use geometry pipeline version V2 for new projects")@prevent_deleteddef run(print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcesses 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_deleteddef abort() -> NoneAbort the processing of the geometry file.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the geometry file.
Returns:
The status of the processing of the geometry file.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh 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.
get_logs
Section titled “get_logs”@prevent_deleteddef 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.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint 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_deleteddef delete() -> NoneDelete the geometry from the project.
allsolve.geometry.cad_basic_geometry
Section titled “allsolve.geometry.cad_basic_geometry”CadPoint Objects
Section titled “CadPoint Objects”class CadPoint()CadPoint is a class for representing a CAD point.
from_region
Section titled “from_region”@classmethoddef from_region(cls, region: Region) -> SelfCreate a CadPoint from a Region. Region must contain exactly one point entity tag.
CadBox Objects
Section titled “CadBox Objects”class CadBox(CadGeometryElement)Box represents a rectangular box geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the box.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the box.
@property@prevent_deleteddef size() -> tuple[float | str, float | str, float | str]Get the size of the box.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str, float | str]) -> NoneSet the size of the box.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the box.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the box.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadCylinder Objects
Section titled “CadCylinder Objects”class CadCylinder(CadGeometryElement)Cylinder represents a cylindrical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the cylinder.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the cylinder.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the axis of the cylinder.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the axis of the cylinder.
@property@prevent_deleteddef radius() -> float | strGet the radius of the cylinder.
@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the cylinder.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the cylinder.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the cylinder.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the cylinder.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the cylinder.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadSphere Objects
Section titled “CadSphere Objects”class CadSphere(CadGeometryElement)Sphere represents a spherical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the sphere.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the sphere.
@property@prevent_deleteddef radius() -> float | strGet the radius of the sphere.
@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the sphere.
@property@prevent_deleteddef angle1() -> float | str | NoneGet the first angle of the sphere.
@angle1.setter@prevent_deleteddef angle1(angle1: float | str | None) -> NoneSet the first angle of the sphere.
@property@prevent_deleteddef angle2() -> float | str | NoneGet the second angle of the sphere.
@angle2.setter@prevent_deleteddef angle2(angle2: float | str | None) -> NoneSet the second angle of the sphere.
@property@prevent_deleteddef angle3() -> float | str | NoneGet the third angle of the sphere.
@angle3.setter@prevent_deleteddef angle3(angle3: float | str | None) -> NoneSet the third angle of the sphere.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the sphere.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the sphere.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadCone Objects
Section titled “CadCone Objects”class CadCone(CadGeometryElement)Cone represents a conical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the cone.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the cone.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the axis of the cone.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the axis of the cone.
radius1
Section titled “radius1”@property@prevent_deleteddef radius1() -> float | strGet the base radius of the cone.
radius1
Section titled “radius1”@radius1.setter@prevent_deleteddef radius1(radius1: float | str) -> NoneSet the base radius of the cone.
radius2
Section titled “radius2”@property@prevent_deleteddef radius2() -> float | strGet the top radius of the cone.
radius2
Section titled “radius2”@radius2.setter@prevent_deleteddef radius2(radius2: float | str) -> NoneSet the top radius of the cone.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the cone.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the cone.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the cone.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the cone.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadTorus Objects
Section titled “CadTorus Objects”class CadTorus(CadGeometryElement)Torus represents a toroidal geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the torus.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the torus.
radius1
Section titled “radius1”@property@prevent_deleteddef radius1() -> float | strGet the outer radius of the torus.
radius1
Section titled “radius1”@radius1.setter@prevent_deleteddef radius1(radius1: float | str) -> NoneSet the outer radius of the torus.
radius2
Section titled “radius2”@property@prevent_deleteddef radius2() -> float | strGet the width of the torus ring.
radius2
Section titled “radius2”@radius2.setter@prevent_deleteddef radius2(radius2: float | str) -> NoneSet the width of the torus ring.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the torus.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the torus.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the torus.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the torus.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadSurfaceRectangle Objects
Section titled “CadSurfaceRectangle Objects”class CadSurfaceRectangle(CadGeometryElement)CadSurfaceRectangle represents a surface rectangle geometry.
@property@prevent_deleteddef size() -> tuple[float | str, float | str]Get the size of the surface rectangle.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str]) -> NoneSet the size of the surface rectangle.
@property@prevent_deleteddef offset() -> tuple[float | str, float | str, float | str]Get the offset of the surface rectangle.
@offset.setter@prevent_deleteddef offset(offset: tuple[float | str, float | str, float | str]) -> NoneSet the offset of the surface rectangle.
origin_point
Section titled “origin_point”@property@prevent_deleteddef origin_point() -> CadPointGet the origin point CAD entity.
origin_point
Section titled “origin_point”@origin_point.setter@prevent_deleteddef origin_point(origin_point: CadPoint) -> NoneSet the origin point CAD entity.
main_axis_point
Section titled “main_axis_point”@property@prevent_deleteddef main_axis_point() -> CadPointGet the main axis point CAD entity.
main_axis_point
Section titled “main_axis_point”@main_axis_point.setter@prevent_deleteddef main_axis_point(main_axis_point: CadPoint) -> NoneSet the main axis point CAD entity.
secondary_axis_point
Section titled “secondary_axis_point”@property@prevent_deleteddef secondary_axis_point() -> CadPointGet the secondary axis point CAD entity.
secondary_axis_point
Section titled “secondary_axis_point”@secondary_axis_point.setter@prevent_deleteddef secondary_axis_point(secondary_axis_point: CadPoint) -> NoneSet the secondary axis point CAD entity.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadDisk Objects
Section titled “CadDisk Objects”class CadDisk(CadGeometryElement)Disk represents a circular disk geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str]Get the position of the disk.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str]) -> NoneSet the position of the disk.
@property@prevent_deleteddef radius() -> float | strGet the radius of the disk.
@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the disk.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the disk.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the disk.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadRectangle Objects
Section titled “CadRectangle Objects”class CadRectangle(CadGeometryElement)Rectangle represents a rectangular geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str]Get the position of the rectangle.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str]) -> NoneSet the position of the rectangle.
@property@prevent_deleteddef size() -> tuple[float | str, float | str]Get the size of the rectangle.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str]) -> NoneSet the size of the rectangle.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the rectangle.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the rectangle.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
allsolve.geometry.cad_path
Section titled “allsolve.geometry.cad_path”CadGlob Objects
Section titled “CadGlob Objects”class CadGlob(Enum)Wildcard patterns for CAD path matching.
Matches a single level in the CAD hierarchy.
DOUBLESTAR
Section titled “DOUBLESTAR”Matches zero or more levels in the CAD hierarchy.
CadPath
Section titled “CadPath”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.
allsolve.geometry.cad_file_import
Section titled “allsolve.geometry.cad_file_import”CadFileImport Objects
Section titled “CadFileImport Objects”class CadFileImport(CadGeometryElement)cleanup
Section titled “cleanup”@property@prevent_deleteddef cleanup() -> boolGet the cleanup setting.
CadStepFile Objects
Section titled “CadStepFile Objects”class CadStepFile(CadFileImport)CadStepFile represents a STEP file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
CadIgesFile Objects
Section titled “CadIgesFile Objects”class CadIgesFile(CadFileImport)CadIgesFile represents an IGES file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
CadSatFile Objects
Section titled “CadSatFile Objects”class CadSatFile(CadFileImport)CadSatFile represents a SAT (ACIS) file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
CadBrepFile Objects
Section titled “CadBrepFile Objects”class CadBrepFile(CadFileImport)CadBrepFile represents a BREP (OpenCASCADE) file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
CadGds2File Objects
Section titled “CadGds2File Objects”class CadGds2File(CadFileImport)CadGds2File represents a GDS2 file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
@property@prevent_deleteddef layers() -> List[CadGdsLayer]Get the GDS2 import configuration.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
allsolve.geometry.geometry_builder
Section titled “allsolve.geometry.geometry_builder”GeometryBuilder Objects
Section titled “GeometryBuilder Objects”class GeometryBuilder(JobMixin)Geometry builder for a project. Use with projects that have the GeometryPipelineVersion.V2
def add(geometry: List[CadElement] | CadElement) -> SelfCreates new geometry elements in the project.
Arguments:
geometry- A list of CAD geometry elements or a single CAD geometry element.
Returns:
The GeometryBuilder object.
add_box
Section titled “add_box”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) -> SelfAdds 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.
add_cone
Section titled “add_cone”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) -> SelfAdds 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.
add_cylinder
Section titled “add_cylinder”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) -> SelfAdds 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.
add_disk
Section titled “add_disk”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) -> SelfAdds 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.
add_rectangle
Section titled “add_rectangle”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) -> SelfAdds 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.
add_sphere
Section titled “add_sphere”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) -> SelfAdds 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.
add_surface_rectangle
Section titled “add_surface_rectangle”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) -> SelfAdds 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.
add_torus
Section titled “add_torus”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) -> SelfAdds 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.
add_difference
Section titled “add_difference”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) -> SelfAdds 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.
add_fragment_all
Section titled “add_fragment_all”def add_fragment_all(name: str, enabled: str | bool | None = None) -> SelfAdds 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.
add_fragments
Section titled “add_fragments”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) -> SelfAdds 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.
add_intersection
Section titled “add_intersection”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) -> SelfAdds 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.
add_union
Section titled “add_union”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) -> SelfAdds 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.
add_grid
Section titled “add_grid”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) -> SelfAdds 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.
add_remove
Section titled “add_remove”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) -> SelfAdds 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.
add_rotate
Section titled “add_rotate”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) -> SelfAdds 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.
add_translate
Section titled “add_translate”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) -> SelfAdds 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.
add_brep_file
Section titled “add_brep_file”def add_brep_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds 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.
add_gds2_file
Section titled “add_gds2_file”def add_gds2_file(filepath: str, layers: (List[CadGdsLayer] | List[Tuple[int, str | int | float, str | int | float]]), name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds a GDS2 file import to the project.
Arguments:
filepath- Path to a local GDS2 file. The file will be uploaded automatically.layers- List of CadGdsLayers or tuples of (layer_id, 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.
Returns:
The GeometryBuilder object.
add_iges_file
Section titled “add_iges_file”def add_iges_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds 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.
add_sat_file
Section titled “add_sat_file”def add_sat_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds 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.
add_step_file
Section titled “add_step_file”def add_step_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds 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 build(print_logs: bool = False, refresh_delay_s: float = 1, raise_on_error: bool = False) -> SelfProcesses 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.
create_element
Section titled “create_element”def create_element(geometry: CadElement) -> CadElementCreates 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.
create_elements
Section titled “create_elements”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.
get_elements
Section titled “get_elements”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) -> NoneStarts 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) -> NoneProcesses 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() -> NoneAborts the processing of the geometry.
get_status
Section titled “get_status”def get_status() -> str | NoneGet 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.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = 1) -> str | NoneRefresh 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.
get_logs
Section titled “get_logs”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.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint 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) -> NoneDeletes 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.
allsolve.varint
Section titled “allsolve.varint”Variable-length integer encoding (varint) implementation.
Uses 7-bit groups with continuation bits, and zig-zag encoding for signed integers.
encode_one
Section titled “encode_one”def encode_one(value: int) -> bytesEncode 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.
encode_one_signed
Section titled “encode_one_signed”def encode_one_signed(value: int) -> bytesEncode 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]) -> bytesEncode multiple unsigned integers using variable-length encoding.
encode_signed
Section titled “encode_signed”def encode_signed(values: List[int]) -> bytesEncode 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.
decode_signed
Section titled “decode_signed”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.
decode_one
Section titled “decode_one”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.
decode_one_signed
Section titled “decode_one_signed”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).
allsolve.expression
Section titled “allsolve.expression”SharedExpression Objects
Section titled “SharedExpression Objects”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.
@classmethoddef get(cls, expr_id: str, project_id: str | None = None) -> SelfGet a shared expression by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all shared expressions in a project.
@property@prevent_deleteddef id() -> strGet the ID of the shared expression.
@property@prevent_deleteddef name() -> strGet the name of the shared expression.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the shared expression. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the shared expression.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionTypeGet the type of the shared expression.
@type.setter@prevent_deleteddef type(expression_type: rawapi.SharedExpressionType) -> NoneSet the type of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef origin() -> Optional[str]Get the origin (original shared expression ID if this is a copy).
@origin.setter@prevent_deleteddef origin(origin: Optional[str]) -> NoneSet the origin of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef args() -> Optional[List[rawapi.SharedExpressionArg]]Get the arguments of the shared expression.
@args.setter@prevent_deleteddef args(args: Optional[List[rawapi.SharedExpressionArg]]) -> NoneSet the arguments of the shared expression. Use save() to commit the change.
expression
Section titled “expression”@property@prevent_deleteddef expression() -> Optional[str]Get the expression string.
expression
Section titled “expression”@expression.setter@prevent_deleteddef expression(expression: Optional[str]) -> NoneSet the expression string. Use save() to commit the change.
@property@prevent_deleteddef values() -> Optional[List[Union[float, int]]]Get the values of the shared expression.
@values.setter@prevent_deleteddef values(values: Optional[List[Union[float, int]]]) -> NoneSet the values of the shared expression. Use save() to commit the change.
@prevent_deleteddef delete() -> NoneDelete the shared expression.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties like name, description, type, expression, args, origin and values.
Variable Objects
Section titled “Variable Objects”class Variable(SharedExpression)A variable expression in the project. Variables are SharedExpressions with type EXPRESSION.
@classmethoddef create(cls, name: str, expression: str | float | int, description: str = "", project_id: str | None = None) -> SelfCreate 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.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all variables in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet 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.
Function Objects
Section titled “Function Objects”class Function(SharedExpression)A function expression in the project. Functions are SharedExpressions with type FUNCTION.
@classmethoddef create(cls, name: str, args: List[str], expression: str, description: str = "", project_id: str | None = None) -> SelfCreate 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.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all functions in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet 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.
InterpolatedFunction Objects
Section titled “InterpolatedFunction Objects”class InterpolatedFunction(SharedExpression)An interpolated function expression in the project. Interpolated functions are SharedExpressions with type INTERPOLATED_FUNCTION.
@classmethoddef create(cls, name: str, args: List[Tuple[str, List[float]]], values: List[float], description: str = "", project_id: str | None = None) -> SelfCreate 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.project_id- The ID of the project.
Returns:
The created interpolated function.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all interpolated functions in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet 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.
allsolve.job_mixin
Section titled “allsolve.job_mixin”JobMixin Objects
Section titled “JobMixin Objects”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() -> NoneAbort the processing of the job.
get_status
Section titled “get_status”def get_status() -> str | NoneGet the status of the processing of the job.
Returns:
The status of the processing, or Job.NOT_STARTED if no job exists.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck 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.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = 1) -> str | NoneRefresh 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.
get_logs
Section titled “get_logs”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.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint 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.
allsolve.project
Section titled “allsolve.project”ProjectType Objects
Section titled “ProjectType Objects”class ProjectType(Enum)Enum for the type of project.
GeometryPipelineVersion Objects
Section titled “GeometryPipelineVersion Objects”class GeometryPipelineVersion(Enum)Enum for the version of the geometry pipeline. For new projects, use V2 (default). V1 is deprecated.
Project Objects
Section titled “Project Objects”class Project()A project in the AllSolve.
from_token
Section titled “from_token”@classmethoddef from_token(cls) -> SelfGet 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.
@classmethoddef get(cls, project_id: str) -> SelfGet a project using the project ID.
Arguments:
project_id- The ID of the project to get.
Returns:
The project with the given ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls) -> List[Self]Get all projects.
Returns:
A list of projects that the authentication has access to.
get_all_by_name
Section titled “get_all_by_name”@classmethoddef 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.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str) -> Self | NoneGet 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.
@classmethoddef 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) -> SelfCreate 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- OptionalProjectType. Default isProjectType.NORMAL. UseProjectType.SCRIPT_ONLYfor 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_deleteddef id() -> strGet the ID of the project.
@property@prevent_deleteddef name() -> strGet the name of the project.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the project.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the project.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the project.
readonly
Section titled “readonly”@property@prevent_deleteddef readonly() -> boolGet whether the project is read-only.
@property@prevent_deleteddef labels() -> List[str]Get the labels of the project.
script_only
Section titled “script_only”@property@prevent_deleteddef script_only() -> boolGet whether the project is script-only.
geometry_pipeline_version
Section titled “geometry_pipeline_version”@property@prevent_deleteddef geometry_pipeline_version() -> GeometryPipelineVersionGet the geometry pipeline version of the project.
dimension
Section titled “dimension”@property@prevent_deleteddef dimension() -> intGet the dimension of the project.
geometry_no_implicit_fragment
Section titled “geometry_no_implicit_fragment”@property@prevent_deleteddef geometry_no_implicit_fragment() -> boolGet whether the project geometry has NO implicit Fragment all operation.
geometry_builder
Section titled “geometry_builder”@prevent_deleteddef geometry_builder() -> GeometryBuilderGet the geometry builder for the project. Use with GeometryPipelineVersion.V2
get_geometry
Section titled “get_geometry”@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.
import_step
Section titled “import_step”@prevent_deleteddef import_step(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_iges
Section titled “import_iges”@prevent_deleteddef import_iges(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_brep
Section titled “import_brep”@prevent_deleteddef import_brep(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_sat
Section titled “import_sat”@prevent_deleteddef import_sat(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_msh
Section titled “import_msh”@prevent_deleteddef import_msh(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_nas
Section titled “import_nas”@prevent_deleteddef import_nas(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_gds2
Section titled “import_gds2”@prevent_deleteddef import_gds2(filepath: str, config: GDS2ImportConfig | None = None, layers: (List[CadGdsLayer] | List[Tuple[int, str | int | float, str | int | float]]) | None = None, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemconfig- 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,
add_shared_file
Section titled “add_shared_file”@prevent_deleteddef add_shared_file(filepath: str) -> rawapi.InputFileAdd 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.
add_shared_json_file
Section titled “add_shared_json_file”@prevent_deleteddef add_shared_json_file(name: str, content: dict) -> rawapi.InputFileAdd shared file to the project with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- 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.
get_files
Section titled “get_files”@prevent_deleteddef get_files() -> List[rawapi.InputFile]Get all files in the project.
Returns:
A list of files in the project.
get_meshes
Section titled “get_meshes”@prevent_deleteddef get_meshes() -> List[Mesh]Get all meshes in the project.
Returns:
A list of meshes in the project.
create_mesh
Section titled “create_mesh”@prevent_deleteddef create_mesh(mesh_settings: MeshSettings) -> MeshCreate a new mesh in the project.
Arguments:
mesh_settings- The settings for the mesh.
Returns:
The created mesh.
get_simulation
Section titled “get_simulation”@prevent_deleteddef get_simulation(simulation_id: str) -> SimulationGet a simulation using the simulation ID.
Arguments:
simulation_id- The ID of the simulation to get.
Returns:
The simulation with the given ID.
get_simulations
Section titled “get_simulations”@prevent_deleteddef get_simulations() -> List[Simulation]Get all simulations in the project.
Returns:
A list of simulations in the project.
copy_simulation
Section titled “copy_simulation”@prevent_deleteddef copy_simulation(simulation_id: str) -> SimulationCreate a copy of a simulation in the project.
Arguments:
simulation_id- The ID of the simulation to copy.
Returns:
The copied simulation.
get_regions
Section titled “get_regions”@prevent_deleteddef get_regions() -> List[Region]Get all regions in the project.
Returns:
A list of regions in the project.
create_region_basic
Section titled “create_region_basic”@prevent_deleteddef create_region_basic(name: str, entity_type: rawapi.EntityType, entity_tags: List[int]) -> RegionCreate 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.
create_region_computed
Section titled “create_region_computed”@prevent_deleteddef create_region_computed(name: str, entity_type: rawapi.EntityType, operation: RegionOperation, source_region_ids: List[str]) -> ComputedRegionCreate 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.
create_region_rule
Section titled “create_region_rule”@prevent_deleteddef 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) -> RegionCreate 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.
create_variable
Section titled “create_variable”@prevent_deleteddef create_variable(name: str, expression: str | float | int, description: str = "") -> VariableCreate 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.
create_function
Section titled “create_function”@prevent_deleteddef create_function(name: str, args: List[str], expression: str, description: str = "") -> FunctionCreate 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.
create_interpolated_function
Section titled “create_interpolated_function”@prevent_deleteddef create_interpolated_function( name: str, args: List[Tuple[str, List[float]]], values: List[float], description: str = "") -> InterpolatedFunctionCreate 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.
Returns:
The created interpolated function.
get_variables
Section titled “get_variables”@prevent_deleteddef get_variables() -> List[Variable]Get all variables in the project.
get_functions
Section titled “get_functions”@prevent_deleteddef get_functions() -> List[Function]Get all functions in the project.
get_interpolated_functions
Section titled “get_interpolated_functions”@prevent_deleteddef get_interpolated_functions() -> List[InterpolatedFunction]Get all interpolated functions in the project.
create_variable_overrides
Section titled “create_variable_overrides”@prevent_deleteddef create_variable_overrides( name: str, overrides: List[Tuple[Variable | str, str | float | int | List[str | float | int]]], sweep_type: rawapi.SweepType | None = None) -> VariableOverridesCreate 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.
get_variable_overrides
Section titled “get_variable_overrides”@prevent_deleteddef get_variable_overrides() -> List[VariableOverrides]Get all variable overrides in the project.
get_materials
Section titled “get_materials”@prevent_deleteddef get_materials() -> List[Material]Get all materials in the project.
Returns:
A list of materials in the project.
create_material
Section titled “create_material”@prevent_deleteddef 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) -> MaterialCreate 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_deleteddef save() -> NoneExplictly save the changes to the cloud made by
setting properties name and description.
@prevent_deleteddef delete() -> NoneDelete the project.
@prevent_deleteddef copy(with_results: bool = False, name: str | None = None, wait_for_completion: bool = True) -> SelfCopies 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.
get_copy_job
Section titled “get_copy_job”@prevent_deleteddef get_copy_job() -> Job | NoneGet 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.
allsolve.override
Section titled “allsolve.override”VariableOverrides Objects
Section titled “VariableOverrides Objects”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.
@classmethoddef 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) -> SelfCreate 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.
@classmethoddef get(cls, variable_overrides_id: str, project_id: str | None = None) -> SelfGet a VariableOverrides by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all VariableOverrides in a project.
@property@prevent_deleteddef id() -> strGet the ID of the VariableOverrides.
@property@prevent_deleteddef name() -> strGet the name of the VariableOverrides.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the VariableOverrides.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionOverrideTypeGet the type of the VariableOverrides.
sweep_type
Section titled “sweep_type”@property@prevent_deleteddef sweep_type() -> rawapi.SweepType | NoneGet the sweep type of the VariableOverrides. Only valid for sweep overrides.
sweep_type
Section titled “sweep_type”@sweep_type.setter@prevent_deleteddef sweep_type(sweep_type: rawapi.SweepType | None) -> NoneSet the sweep type of the VariableOverrides. Only valid for sweep overrides.
overrides
Section titled “overrides”@property@prevent_deleteddef 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
Section titled “overrides”@overrides.setter@prevent_deleteddef overrides( overrides: List[Tuple[Variable | str, str | float | int | List[str | float | int]]]) -> NoneSet the overrides of the VariableOverrides.
@prevent_deleteddef delete() -> NoneDelete the VariableOverrides.