Functions

Python bindings to Alias C++ API

class alias_api.AlCoordinateSystem

Members:

YUp

ZUp

property name
class alias_api.AlCurveFormType

Members:

Closed

Open

Periodic

InvalidCurve

property name
class alias_api.AlCurveNodeJoinErrors

Members:

BadData

Success

DuplicateCurve

Failure

BadCluster

NoAttributes

InvalidKeyPoint

CurveClosed

property name
class alias_api.AlDisplayModeType

Members:

GeomEditPoints

BoundingBox

Invisible

GeomKeyPoints

Template

Dashed

ConstructionPlane

GeomHull

GeomCVs

CompressedSbd

property name
class alias_api.AlFileType

Members:

Dwg

Unknown

ProRender

Wire

Dxf

Vdafs

Iges

Edf

Tri

C4x

Vdais

Jamais

Quad

Inventor

Stl

Obj

Fbx

Unused

Epsf

Illustrator

JT

Slc

Acis

CatiaV5

Nx

property name
class alias_api.AlMessageType

Members:

DagNodeModifiedGeometry

DagNodeColourModified

DagNodeModified

TrimSurface

Invalid

FirstMessage

DagNodeDeleted

DagNodeInstanced

DagNodeModifiedShaderAssignment

DeleteAll

DagNodeModifiedConstraint

HierarchyModified

StageActive

DagNameModified

JointModified

Refresh

DagNodePreReplaceGeometry

DagNodeReplaceGeometry

DagNodeApplyTransformation

DagNodeVisible

DagDispModified

ReferenceFileDeleted

CosDeleted

CosModified

CosVisible

LayerSymmetryModified

PostRetrieve

AttributesDelete

UniverseDeleted

PreUpdate

PostUpdate

PreRetrieve

Quit

StageMerged

AnimPlayback

ListModifiedNodes

PreRefresh

TextureDeleted

CommandInstall

CommandFree

LayerAssign

PickListModified

UntrimSurface

PlotRefresh

UniverseCreated

StageCreated

StageDeleted

UniverseMerged

CloudDeleted

PreStore

UniverseActive

PostStore

TextureModified

ClMemberModified

DagInserted

ShaderDeleted

CameraModified

ExprModified

CommandUnInstall

ShaderAdded

CnetDeleted

ShaderModified

LayerAdded

LightModified

TextureAdded

DagNodeUndeleted

LayerDeleted

LayerAttributeChanged

CosCreated

LocatorAdded

LocatorDeleted

LocatorModified

LastMessage

property name
class alias_api.AlObjectType

Members:

ClusterType

ConicAttributeType

ClusterNodeType

AmbientLightType

GroupNodeType

NonAmbientLightType

AreaLightType

PointConstraintType

DirectionLightType

CameraType

LightUpNodeType

BoxLightType

CameraViewType

LightType

LightNodeType

SpotLightType

CameraEyeType

SetType

CameraUpType

TrimBoundaryType

ClusterMemberType

ConstructionPlaneType

ConeLightType

CurveNodeType

CurveOnSurfaceType

CurveType

CurveCVType

KeyframeType

PolygonType

VolumeLightType

LightLookAtNodeType

CylinderLightType

DagNodeType

FaceNodeType

FaceType

SphereLightType

ImagePlaneType

LinearLightType

CurveAttributeType

TextureType

SurfaceType

ReferenceFileType

OrthographicCameraType

PerspectiveCameraType

PointLightType

FuturePointType3

ArcAttributeType

SetMemberType

SurfaceNodeType

SurfaceCurveType

JointType

SurfaceCVType

LayerType

TorusLightType

LineAttributeType

PolysetType

MotionActionType

LocatorType

WindowType

SwitchShaderType

ChannelType

ActionType

ParamActionType

StreamType

EnvironmentType

ShaderType

PolysetNodeType

AttributeType

PolysetVertexType

PlaneAttributeType

DeviationLocatorType

RevSurfAttributeType

ConstraintType

OrientationConstraintType

AimConstraintType

CharacterType

TextureNodeType

ShellNodeType

ShellType

TrimRegionType

TrimCurveType

CommandType

CommandRefType

ContactType

CharacterSpaceType

CharSnippetType

CharTransitionType

IKHandleType

IKHandleNodeType

AnnotationLocatorType

DistanceLocatorType

CurvePointType

AngleLocatorType

RadialLocatorType

MinmaxLocatorType

ConstructionEntityType

ConstructionVectorType

ConstructionFutureType1

ConstructionFutureType2

PointType

SpacePointType

SurfacePointType

CurveOnSurfacePointType

FuturePointType1

FuturePointType2

ReferenceFileSetType

FuturePointType4

FuturePointType5

CloudType

BlendCurveType

BlendPointType

ReferenceObjectType

CategoryType

MeshType

MeshNodeType

EvaluateType

ReferenceLayerType

LayeredShaderType

property name
class alias_api.AlStatusCode

Members:

NameChangedToUniqueOne

Success

AlreadyCreated

Failure

ExprParseError

CannotDelete

InsufficientMemory

InvalidArgument

NoProjectEnvironment

NoParent

RenameStageFailure

ExprNotValidRelative

InvalidObject

InvalidWireFile

ObjectInSet

ObjectInAnotherSet

ExprBadVariable

ObjectInExclusiveSet

ExprNotValidName

ObjectAncestorInSet

ObjectDescendentInSet

ObjectNotAMember

ExprNotDagObject

ExprNotValidCV

ExprNotValidParameter

DeleteStageFailure

ExprAxInsertCircRef

ExprAxInsertBadRef

ExprAxInsertSelfRef

SetStageFailure

AlreadyTrimmed

ObjectNotFound

NotAvailable

ObjectAlreadyPresent

EndOfGlobalCodes

InvalidWindowType

EndOfAlStatusCodes

property name
exception alias_api.AliasCompatibilityException
exception alias_api.AliasOpenModelException
class alias_api.SymmetryState

Members:

Mirror

Original

BothSides

property name
alias_api.add_message_handler(message_type: alias_api.AlMessageType, callback_func: Callable[[alias_api.MessageResult], None]) Tuple[int, int]

Install a message handler in the Alias Universe.

alias_api.al_are_equal(al_object1: alias_api.AlObject, al_object2: alias_api.AlObject) int

Return True if the two Alias Objects are equal, else False.

alias_api.al_is_valid(al_object: alias_api.AlObject) int

Return True if the Alias Object is valid, else False.

alias_api.apply_iterator_to_dag_nodes(iter: AlIterator, retcode: int) int

Applies the iterator to all AlDagNodes. It does not recursively go down the DAG.

alias_api.apply_iterator_to_shaders(iter: AlIterator, retcode: int) int

Apply the iterator to each AlShader.

Parameters
  • iter (AlIterator) – the iterator to apply

  • retcode (int) – the return value of the last application of the iterator

Returns

The status code result Success - the iterator was successfully applied to each shader InvalidArgument - ‘iter’ was None Failure - AlUniverse was not initialized

Return type

int(AlStatusCode)

alias_api.cleanup_geometry_model(face_to_surf: bool = False, split_c1_breaks: bool = False, split_closed_basis: bool = False, shrink_closed_surf: bool = False, set_persistent_ids: bool = False, split_sphere: bool = False, picked_dags_only: bool = False, split_multiknots: bool = False, delete_null_nodes: bool = False, delete_degenerate_geo: bool = False) int

Clean up the geometry of the model.

alias_api.clear_pick_list() int

Remove all objects from the pick list.

alias_api.clear_queued_events() None

Clear the currently queued events. The callbacks of the events in the queue will not be triggered.

alias_api.convert_face_node_to_trimmed_surface_node(node: alias_api.AlDagNode) int

Convert a AlFaceNode to AlSurfaceNode (a trimmed surface).

The dag node and the attachment is not changed but the geometry is replaced by a trimmed surface. The animation and other attachment on geometry level are gone (lost).

Parameters

node (AlDagNode) – The face node to convert. This will be modified if the function succeeds.

Returns

The status code result.

Return type

int(AlStatusCode)

alias_api.convert_to_trimmed_surface_node(node: alias_api.AlDagNode) int

This function works on a AlSurfaceNode only, and only on a surface that is a closed/periodic and untrimmed surface (e.g. a pure cylinder). then the function converts it to a trimmed surface and split the closed surface into multiple open regions.

Parameters

node (AlDagNode) – The node to convert.

Returns

The status code result Success - the conversion is done so the geometry under

node is changed (also the wrapper AlDagNode)

Failure - there is no need to convert or error happened

the node is not changed at all.

Return type

int(AlStatusCode)

alias_api.copy_object(node: alias_api.AlDagNode, run_cleanup: int = True) alias_api.AlDagNode

This function performs the copy of the dag node based on the copy options that have been set with the setCopyOptionFlags() routine.

Note: set runCleanup to False if you will be performing many copies, then call AlDagNodeExt::copyObjectCleanup() after. This will speed up the copying of objects.

Parameters
  • node (AlDagNode) – The dag node to copy

  • run_cleanup (bool) – Flag to run clean up after copy object operation. Defaults to True.

Returns

The copied object

Return type

AlDagNode

alias_api.copy_object_cleanup() int

Call this method after performing a number of dag node copy object operations to clean up the scene.

alias_api.create_alternative(name: str, force: bool = False) alias_api.AlReferenceFileSet

Create an AlReferenceFileSet in the Alias Universe.

alias_api.create_construction_plane(tm: alias_api.AlTM) alias_api.AlDagNode

Create a dag node that is a construction plane at the position denoted by ‘tm’.

Parameters

tm (AlTM) – The tansformation matrix used to set the construction plane position.

Returns

The construction plane dag node.

Return type

AlDagNode

alias_api.create_layer(layer_name: str) alias_api.AlLayer

Create a new AlLayer in the Alias Universe.

alias_api.create_layer_folder(folder_name: str) alias_api.AlLayer

Create a new AlLayer folder in the Alias Universe.

alias_api.create_layered_shader() alias_api.AlLayeredShader

Create a new AlLayeredShader in the Alias Universe.

alias_api.create_orthographic_camera(view_type: AlWindow::AlViewType) alias_api.AlOrthographicCamera

Create and return an AlOrthographicCamera object.

alias_api.create_perspective_camera() alias_api.AlPerspectiveCamera

Create and return a AlPerspectiveCamera object.

alias_api.create_reference(arg0: str) alias_api.AlReferenceFile

Create an AlReferenceFile with the given path, in the Alias Universe.

alias_api.create_reference_alternative(name: str) alias_api.AlReferenceFileSet

Create an AlReferenceFileSet with the given name.

alias_api.create_shader() alias_api.AlShader

Create a new AlShader in the Alias Universe.

alias_api.create_stage(arg0: str) int

Create a new stage in Alias.

alias_api.create_switch_shader() alias_api.AlSwitchShader

Create a new AlSwitchShader in the Alias Universe.

alias_api.create_texture_node(*args, **kwargs)

Overloaded function.

  1. create_texture_node(imagePath: str, useConstructionPlane: bool = False, errs: list = []) -> bool

A function which creates a Canvas Image at the center of the world.

  1. create_texture_node(name : str, imagePath : str, useConstructionPlane: bool, errs: list) -> bool

A function which creates a Canvas Image at the center of the world.

alias_api.current_window() alias_api.AlWindow

Returns the currently active window.

alias_api.delete_all_construction_entities() int

Delete all AlConstructionPlane objects found in the Alias Universe.

alias_api.delete_all_locators() int

Delete all locators.

After this operation, all references to all AlLocators will be invalid.

Returns

The status code result Success - everything was successfully deleted. Failure - the universe was not initialized or the deletion failed.

Return type

int(AlStatusCode)

alias_api.delete_construction_history(cos: alias_api.AlCurveOnSurface) None

Delete the construction histor for the curve on surface.

alias_api.delete_history(node: alias_api.AlDagNode) None

Delete the history from this dag node.

Parameters

node (AlDagNode) – The dag node to delete history from.

Returns

The status code result.

Return type

int(AlStatusCode)

alias_api.delete_null_nodes() int

Delete all null nodes in the Alias scene.

alias_api.expand_instances(node: alias_api.AlDagNode) int

Convert all instsances below the given node (top node of tree) to uninstanced geometry.

alias_api.export_by_layer(target_dirname: str, base_filename: str, file_type: alias_api.AlFileType, layer_list: List[alias_api.AlLayer], overwrite: bool = False) int

Export each layer to a new file.

This function will modify the pick list, ensure to save the state of the pick list before calling this function if it is desired to restore it after this operation.

This is an alternative function to exportByLayerSequentially that is optimized for when there are many dag nodes, since it will only traverse the DAG once, whereas exportByLayerSequentially will traverse the DAG once per layer. The downside of this function is that it requires more memory since it will keep track of the nodes per layer.

This function requires Alias >= 2022.2

Parameters
  • target_dirname (str) – The output directory to save new layer files to.

  • base_filename (str) – The base filename for the newly saved layer files. The layer name will be appended for each file.

  • file_type (AlFileType) – The file type that the new layer files will be saved as.

  • layer_list (list<AlLayer>) – The layers to export.

  • overwrite (bool) – True will overwrite any existing files, False will not save a the layer file it if a file already exists with the same name.

Raises
alias_api.export_by_layer_sequentially(target_dirname: str, base_filename: str, file_type: alias_api.AlFileType, layer_list: List[alias_api.AlLayer], overwrite: bool = False) int

Export each layer to a new file.

This function will modify the pick list, ensure to save the state of the pick list before calling this function if it is desired to restore it after this operation.

This is a naive approach to export all layers. For each layer, the DAG is traversed to pick each node in the layer. This will be slow if there are many nodes in the DAG.

Use exportByLayer for an optimized approach, for Alias >= 2022.2

Parameters
  • target_dirname (str) – The output directory to save new layer files to.

  • base_filename (str) – The base filename for the newly saved layer files. The layer name will be appended for each file.

  • file_type (AlFileType) – The file type that the new layer files will be saved as.

  • layer_list (list<str>) – The layers in the file to export. If not specified, all layers will be exported.

  • overwrite (bool) – True will overwrite any existing files, False will not save a the layer file it if a file already exists with the same name.

alias_api.find_dag_node_by_name(name: str) alias_api.AlDagNode

Find and return the DagNode that matches the given name.

This traverses into group nodes to search the entire DAG for the node.

Parameters

name (str) – The unique dag node name to search by.

Returns

The dag node with the given name.

Return type

AlDagNode

alias_api.find_top_level_dag_node_by_name(name: str) alias_api.AlDagNode

Find and return the DagNode that matches the given name.

This does not traverse into group nodes, only the top-level nodes in the DAG.

Parameters

name (str) – The unique dag node name to search by.

alias_api.first_construction_entity() alias_api.AlConstructionEntity

Return the first AlConstructionPlane object found in the Alias Universe.

alias_api.first_dag_node() alias_api.AlDagNode

Return the first AlDagNode in the list of Alias AlDagNode objects (the DAG).

alias_api.first_layer() alias_api.AlLayer

Return the first layer which refers to the default layer. This layer is always valid in the universe. None is returned if the universe is not initialized.

alias_api.first_layered_shader() alias_api.AlLayeredShader

Return the first AlLayeredShader in the list of Alias AlLayeredShader objects. None is returned if the list is empty.

alias_api.first_locator() alias_api.AlLocator

Return the first AlLocator in the list of Alias AlLocator objects. None is returned if the list is empty.

alias_api.first_pick_item() int

Set the pick list to reference the first object in the list.

alias_api.first_set() alias_api.AlSet

Return the first set in the universe.

alias_api.first_shader() alias_api.AlShader

Return the first AlShader in the list of Alias AlShader objects. None is returned if the list is empty.

alias_api.first_switch_shader() alias_api.AlSwitchShader

Return the first AlSwitchShader in the list of Alias AlSwitchShader objects. None is returned if the list is empty.

alias_api.flatten_group_nodes(*args, **kwargs)

Overloaded function.

  1. flatten_group_nodes() -> int

    Flatten all top-level group nodes in the DAG.

    Any group nodes found in the top-level group nodes will have all its children moved to the top-level group node, and then be removed. The result is each group node specified will not contain any nested group nodes.

    return

    The status code result of the flatten operation.

    rtype

    int(AlStatusCode)

  2. flatten_group_nodes(group_nodes: List[alias_api.AlGroupNode]) -> int

    Flatten the specified group nodes.

    Any group nodes found in the specified group nodes will have all its children moved to the top-level group node, and then itself will be removed. The result is each group node specified will not contain any nested group nodes.

    param group_nodes

    The group nodes to flatten.

    type group_nodes

    list<AlGroupNode>

    return

    The status code result of the flatten operation.

    rtype

    int(AlStatusCode)

alias_api.get_alternative_by_name(name: str) alias_api.AlReferenceFileSet

Return the AlReferenceFileSet matching the given name.

alias_api.get_alternatives() List[alias_api.AlReferenceFileSet]

Return a list of all the alternatives for the current AlReferenceFileSet.

alias_api.get_annotation_locator_strings() List[str]

Return the string value for all annotation locators in the Alias Universe.

alias_api.get_annotation_locators() List[alias_api.AlAnnotationLocator]

Return all annotation locators in the Alias Universe.

alias_api.get_bounding_box_from_hanger(node: alias_api.AlDagNode) Tuple[int, List[float[6]]]

Return the bounding box computed from the bounding box hanger for the dag node.

alias_api.get_children(arg0: alias_api.AlGroupNode) List[alias_api.AlDagNode]

Return a list of all the children in the group node.

alias_api.get_construction_plane_by_name(name: str) alias_api.AlConstructionPlane

Return the AlConstructionPlane matching the given unique name.

alias_api.get_current_path() str

Return the current file path.

alias_api.get_current_pick_item() AlObject

Return the object that the pick list is currently referencing.

alias_api.get_current_stage() alias_api.Stage

Return the current stage.

alias_api.get_empty_layers(include_folders: bool = True, skip_layers: Set[str] = set()) List[alias_api.AlLayer]

Return all empty layers.

Parameters

skip_layers (list<str>) – List of layer names to skip when checking for empty ones.

Returns

The empty layers.

Return type

list<AlLayer>

alias_api.get_layer_by_name(layer_name: str) alias_api.AlLayer

Return a layer given its name in the Alias Universe.

alias_api.get_layer_by_number(layer_number: int) alias_api.AlLayer

Return a layer given its number in the Alias Universe.

alias_api.get_layered_shader_by_name(shader_name: str) alias_api.AlLayeredShader

Return the AlLayeredShader found by the given name.

alias_api.get_layered_shader_by_node(node_name: str) alias_api.AlLayeredShader

Return the AlLayeredShader assigned to the node corresponding to the given name.

alias_api.get_layered_shaders() List[alias_api.AlLayeredShader]

Return a list of all the AlLayeredShader objects in the Alias universe.

alias_api.get_layers(ignore_names: Set[str] = set(), ignore_numbers: Set[int] = set(), include_folders: bool = True, include_non_folders: bool = True) List[alias_api.AlLayer]

Return a list of all the layers in the Alias Universe.

alias_api.get_layers_using_multiple_shaders() List[alias_api.AlLayer]

Return layers whose geometry do not all use the one same shader.

alias_api.get_locator_by_name(name: str) alias_api.AlLocator

Return the AlLocator object for the given name.

alias_api.get_nesting_groups() List[alias_api.AlGroupNode]

Return the list of top-level group nodes that contain at least one group.

alias_api.get_perspective_camera_by_name(name: str) alias_api.AlPerspectiveCamera

Find and return the AlPerspectiveCamera that matches the unique identifier name.

alias_api.get_perspective_cameras() List[alias_api.AlPerspectiveCamera]

Find and return all AlPerspectiveCameras in the Alias Universe.

alias_api.get_pick_item_dag_nodes() List[AlDagNode]

Return a list of all dag nodes that are in the pick list.

alias_api.get_pick_items() List[AlObject]

Return a list of all objects that are in the pick list.

alias_api.get_product_information() dict

Return the Alias product information.

alias_api.get_reference_by_name(name: str) alias_api.AlReferenceFile

Return the AlReferenceFile matching the given name.

alias_api.get_reference_by_path(path: str) alias_api.AlReferenceFile

Return the AlReferenceFile matching the given file path.

alias_api.get_reference_by_uuid(uuid: list) alias_api.AlReferenceFile

Return the AlReferenceFile matching the given uuid.

alias_api.get_references() List[alias_api.AlReferenceFile]

Return all the AlReferenceFiles imported into the current file.

alias_api.get_shader_by_name(shader_name: str) alias_api.AlShader

Return the Shader found by the given name.

alias_api.get_shaders() List[alias_api.AlShader]

Return a list of all the shaders in the Alias universe.

alias_api.get_shaders_by_node(node_name: str) List[alias_api.AlShader]

Return a list of all the shaders assigned to the node corresponding to the given name.

alias_api.get_stages() List[alias_api.Stage]

Return all the existing stages of the current Alias session.

alias_api.get_switch_shader_by_name(shader_name: str) alias_api.AlSwitchShader

Return the SwitchShader found by the given name.

alias_api.get_switch_shader_by_node(node_name: str) alias_api.AlSwitchShader

Return the switch shader assigned to the node corresponding to the given name.

alias_api.get_switch_shaders() List[alias_api.AlSwitchShader]

Return a list of all the switch shaders in the Alias universe.

alias_api.get_top_dag_nodes() List[alias_api.AlDagNode]

Returns a list of the top level dag nodes in the Alias Universe.

alias_api.get_variants() List[alias_api.Variant]

Return all the variants of the current file.

alias_api.has_annotation_locator() bool

Return True if there are any annotation locators in the Alias Universe.

alias_api.has_construction_history(cos: alias_api.AlCurveOnSurface) int

Return 1 if the curve on surface has construction history, 0 if no construction history, and -1 if the curve on surface is invalid.

alias_api.has_history(node: alias_api.AlDagNode) bool

Return True if the dag node has history, else False.

Parameters

node (AlDagNode) – The dag node to check history.

Returns

True if the node has history, else False.

Return type

bool

alias_api.has_queued_events() bool

Check if there are Alias event callbacks queued and waiting to execute.

Queued event callbacks will be executed once queuing events is turned off.

Returns

True if there are queued event callbacks, else False.

Return type

bool

alias_api.has_reference() bool

Return True if any AlReferenceFiles found in the current Alias Universe.

alias_api.has_variants() bool

Check if the current file contains variants.

alias_api.import_file(arg0: str) None

Import a file into the current file.

alias_api.import_reference(filename: str) alias_api.AlReferenceFile

Import the file and create an AlReferenceFile object from it.

alias_api.import_subdiv(filepath: str) None

Imports a subdiv data from OBJ, TSM, F3D or SF3D file.

Note that SF3D file format is only supported in OpenAlias.

Parameters

filepath (str) – The name of the input file to process

Throws AliasPythonException

If filepath is None, Alias failed to import or the Alias universe has not been initialized.

alias_api.import_subdivision(filepath: str) None

Deprecated - use ‘import_subdiv’ instead.

Imports a subdiv data from OBJ, TSM, F3D or SF3D file.

Note that SF3D file format is only supported in OpenAlias.

Parameters

filepath (str) – The name of the input file to process

Throws AliasPythonException

If filepath is None, Alias failed to import or the Alias universe has not been initialized.

alias_api.initialize_universe(up: alias_api.AlCoordinateSystem = <AlCoordinateSystem.???: 1>, init_project_env: int = False) int

Initialize the Alias Universe.

alias_api.is_construction_layer(layer_number: int) bool

Determine if the layer is a construction layer.

Parameters

layer_number – The number of the layer to check.

Returns

True if the layer is a construction layer, else False.

alias_api.is_copy_of_vred_shader(shader: alias_api.AlShader) bool

Returns True if the shader was created from a VRED shader.

alias_api.is_empty_file() bool

Deprecated - use ‘is_stage_empty’ instead.

alias_api.is_queuing_events() bool

Check if the Alias event callbacks are currently being queued.

When event callbacks are being queued, this means that when Alias events are fired, the C++ message handler is still invoked, but the Python callbacks registered to the Alias events will not be executed immediately, and instead will be executed once queuing events is turned off.

Returns

True if event callbacks are being queued, else False.

Return type

bool

alias_api.is_stage_empty() bool

Check if the current file is empty or not.

alias_api.log_message(outputType: AlOutputType, msg: str) None

A function which logs a message to the given output.

alias_api.log_to_errlog(msg: str) None

A function which logs a message to the Alias error log.

alias_api.log_to_prompt(msg: str) None

A function which logs a message to the Alias prompt.

alias_api.log_to_prompt_no_history(msg: str) None

A function which logs a message to the Alias prompt without history.

alias_api.log_to_stderr(msg: str) None

A function which logs a message to the standard error stream.

alias_api.log_to_stdout(msg: str) None

A function which logs a message to the standard output stream.

alias_api.next_construction_entity(entity: alias_api.AlConstructionEntity) alias_api.AlConstructionEntity

Return the next AlConstructionPlane object found, after the given entity, in the Alias Universe.

alias_api.next_layer(cur_layer: alias_api.AlLayer) alias_api.AlLayer

Return the leaf layer following cur_layer in the graph of Alias AlLayer objects in a pre-order traversal.

Note: This function does not return layer folders (only leaf layers).

None is returned if cur_layer has no next layer.

Parameters

cur_layer (AlLayer) – Layer from which to walk forward

Returns

The leaf layer following cur_layer.

Return type

AlLayer

alias_api.next_locator(cur_locator: alias_api.AlLocator) alias_api.AlLocator

Return the AlLocator following cur_locator in the list of Alias AlLocator objects.

None is returned if cur_locator has no next locator.

Parameters

cur_locator (AlLocator) – The locator from which to walk forward.

Returns

The locator following the cur_locator.

Return type

AlLocator

alias_api.next_pick_item() int

Set the pick list to reference the next object in the list.

alias_api.next_shader(*args, **kwargs)

Overloaded function.

  1. next_shader(cur_shader: alias_api.AlShader) -> alias_api.AlShader

Return the AlShader following cur_shader in the list of Alias AlShader objects. None is returned if cur_shader has no next shader.

  1. next_shader(cur_shader: alias_api.AlLayeredShader) -> alias_api.AlLayeredShader

Return the AlLayeredShader following cur_shader in the list of Alias AlLayeredShader objects. None is returned if cur_shader has no next shader.

alias_api.next_switch_shader(cur_shader: alias_api.AlSwitchShader) alias_api.AlSwitchShader

Return the AlSwitchShader following cur_shader in the list of Alias AlSwitchShader objects. None is returned if cur_shader has no next shader.

alias_api.node_first_shader(node: alias_api.AlDagNode) AlShader

Return the first shader used by the given dag node. Return None if no shader is used.

alias_api.node_switch_shader(node: alias_api.AlDagNode) AlSwitchShader

Return the switch shader used by the given dag node. Return None if no switch shader used.

alias_api.open_file(path: str, new_stage: bool = False, delete_current: bool = False) int

Open a file in Alias.

alias_api.pick_by_name(name: str) int

Add all objects that match the given string pattern to the pick list.

alias_api.pop_pick_list() int

Pops the pushed pick list.

alias_api.prev_pick_item() int

Set the pick list to reference the previous object in the list.

alias_api.push_pick_list(copy: int) int

Push a new pick list onto the stack.

alias_api.queue_events(queue: bool) None

Manage queuing Python callbcacks triggered by Alias message events.

Pass True to this function to start queuing all Python callbacks that are triggered by Alias message events.

When ready to execute the Python callbacks, pass False to this funciton to empty the queue and trigger each Python callback in the queue.

Parameters

queue – True to queue event callbacks, and False to execute the queued event callbacks.

type queue: bool

alias_api.redraw_screen(redraw_flag: int = 3) int
alias_api.remove_message_handler(message_type: alias_api.AlMessageType, callback_id: int) int

Remove the specific message handler for the message type and callback.

alias_api.remove_message_handlers(message_type: alias_api.AlMessageType) int

Remove all message handlers for the message type.

alias_api.remove_reference(reference_file: alias_api.AlReferenceFile) int

Remove the AlReferenceFile from the Alias Universe.

alias_api.reset() None

Deprecated - use ‘reset_stages’ instaed.

alias_api.reset_stages() None

Reset the current session by deleting all the stages. OpenAlias will create default windows.

alias_api.save_file() int

Save the current file.

alias_api.save_file_as(path: str) int

Save the current file to the given path.

alias_api.save_layers(file_path: str, target_dirname: str, layer_names: List[str] = [], save_invisible: bool = True, picked_only: bool = False, file_type: alias_api.AlFileType = <AlFileType.Wire: 1>, use_sequential: bool = False, overwrite: bool = False, threshold: int = 8) int

Retrieve the file and export each of its layers to a new file.

This provides the same functionality as the Save Layers plugin. It is a convenience function to calling the main export by layer functions ( export_by_layer, export_by_layer_sequentially).

The pick list state will be saved before modifying it, and restored at the end of the operation.

Empty layers will be omitted (there will be no wire file created for empty layers).

This function requires Alias >= 2022.2

Parameters
  • file_path (str) – The file to export layers from. This file will first be retrieved.

  • target_dirname (str) – The output directory to save new layer files to.

  • layer_names (list<str>) – The layers in the file to export. If not specified, all layers will be exported.

  • save_invisible (bool) – True will export all non-empty layers, False will only save layers that are visible or that are construction layers.

  • picked_only (bool) – True will export only layers that are picked, False will export both picked and not picked layers.

  • file_type (AlFileType) – The file type that the new layer files will be saved as.

  • use_sequential (bool) – True will force using the sequential export method (ignores the threshold value).

  • overwrite (bool) – True will overwrite any existing files, False will not save a the layer file it if a file already exists with the same name.

  • threshold (int) – Set the upperbound limit on number of layers to switch between export methods. If the number of layers is less than or equal the threshold, then layers are exported sequentially. If the number of layers is greater than the threshold, then layers are exported in an optimized way.

Raises
alias_api.search_dag(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG validating each node with the provided input data.

The input data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_has_history(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes with construction history.

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_has_non_origin_pivot(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes with scale or rotate pivots not positioned at the origin.

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_has_non_zero_transform(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes that do not have a zero transform.

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_is_instance(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes that are instances.

A node is considered an instance if:
  • it is a group node

  • it shares its children with another sibling group node; e.g. when groupNode.isInstanced() = true

  • its previous sibling node is an instance; e.g. when groupNode.prevInstance() is not null

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_layer_does_not_match_parent_layer(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes that do not have the same layer assigned as their parent node.

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.search_node_unused_curves_on_surface(input_data: alias_api.TraverseDagInputData) alias_api.TraverseDagOutputData

Search the entire DAG for nodes that have unused curves on surface.

A curve on surface is unused if it is not being used to trim the surface it is on.

The input_data will be used to filter the output data results. See TraverseDagInputData for more details on how to filter the output data.

NOTE: this is a customized traverse_dag function optimized for this specific use case.

Parameters

input_data (TraverseDagInputData) – The input data to pass to the DAG traversal

Returns

The status code result of the traversal.

Return type

int(AlStatusCode)

alias_api.store(filename: str, active: bool, file_type: alias_api.AlFileType = <AlFileType.Wire: 1>) int

Save the file.

This is a very early implementation of a general file saving method. It accepts a filename, active flag and a file type. Currently it will only store wire files, iges files, and dxf files, as well as IGES derivatives C4, Jamias and VDAIS and VDAFS.

Parameters
  • fileName – The name of the file to be stored.

  • active – Store all or just the selected objects.

  • filetype – The type of file to save.

Return The status code result

Success - the file was stored successfully Failure - the wire file could not be stored properly InvalidArgument - unrecognized file type or fileName is NULL.

Return type

int(AlStatusCode)

alias_api.traverse_dag(*args, **kwargs)

Overloaded function.

  1. traverse_dag(node_callback: Callable[[alias_api.AlDagNode], int]) -> alias_api.TraverseDagOutputData

    Traverse the entire DAG and trigger the provided callback for each node.

    For each node in the DAG, the node_callback will be called with the current node being traversed. The node_callback will determine if the current node will be accepted (included) in the traversal output data.

    param node_callback

    The node callback during traversal for all nodes

    type node_callback

    function(AlDagNode) -> int(AlStatusCode)

    return

    The output data from the DAG traversal.

    rtype

    TraverseDagOutputData

  2. traverse_dag(group_node_callback: Callable[[alias_api.AlDagNode], int], leaf_node_callback: Callable[[alias_api.AlDagNode], int]) -> alias_api.TraverseDagOutputData

    Traverse the entire DAG and trigger the provided callback for each node.

    For each node in the DAG, the one of the provided callbacks will be called with the current node being traversed. The callback will determine if the current node will be accepted (included) in the traversal output data.

    param group_node_callback

    The node callback during traversal for group nodes

    type group_node_callback

    function(AlDagNode) -> int(AlStatusCode)

    param leaf_node_callback

    The node callback during traversal for leaf nodes

    type leaf_node_callback

    function(AlDagNode) -> int(AlStatusCode)

    return

    The output data from the DAG traversal.

    rtype

    TraverseDagOutputData

  3. traverse_dag(root: alias_api.AlDagNode, group_node_callback: Callable[[alias_api.AlDagNode], int], leaf_node_callback: Callable[[alias_api.AlDagNode], int]) -> alias_api.TraverseDagOutputData

    Traverse the DAG starting at the root node, and trigger the provided callbacks for each node.

    For each node in the DAG, the one of the provided callbacks will be called with the current node being traversed. The callback will determine if the current node will be accepted (included) in the traversal output data.

    param root

    The root node to start the traversal at

    type root

    AlDagNode

    param group_node_callback

    The node callback during traversal for group nodes

    type group_node_callback

    function(AlDagNode) -> int(AlStatusCode)

    param leaf_node_callback

    The node callback during traversal for leaf nodes

    type leaf_node_callback

    function(AlDagNode) -> int(AlStatusCode)

    return

    The output data from the DAG traversal.

    rtype

    TraverseDagOutputData

alias_api.update_reference(old_path: str, new_path: str) alias_api.AlReferenceFile

Update an AlReferenceFile path with the new path provided.

alias_api.zero_transform(*args, **kwargs)

Overloaded function.

  1. zero_transform() -> int

Apply zero transform to all dag nodes currently in the pick list.

  1. zero_transform(node_name: str, clear_pick_list: bool = False) -> int

Apply zero transform to all nodes that match the given name.

  1. zero_transform(node: alias_api.AlDagNode) -> int

Apply the zero transform to the given dag node.

  1. zero_transform(nodes: List[alias_api.AlDagNode]) -> int

Apply the zero transform to the given list of dag nodes.

alias_api.zero_transform_top_level() int

Apply zero transform to all top-level dag nodes in the universe.