Project#

class ansys.mechanical.stubs.v261.Ansys.ACT.Automation.Mechanical.Project(internalObject: Any)#

Bases: object

Defines a Project.

Overview#

DetermineStandaloneAppletModeFromArchive

DetermineStandaloneAppletModeFromArchive method.

Activate

Activate the current object.

AddComment

Creates a new child Comment.

AddImage

Creates a new child Image.

AddMaterial

Add a material from a file to the project.

Archive

For Mechanical opened independently, without Workbench. Archive a Mechanical project.

BackupExists

BackupExists method.

BackupRemove

BackupRemove method.

BackupRestore

BackupRestore method.

BackupSaveAsCopy

BackupSaveAsCopy method.

ClearGeneratedData

Run the ClearGeneratedData action.

CombineTextFiles

Combines two text(.txt / .dmig / .inp / .dat) files. The secondary file will be appened to the primary file

CopyTo

Copies all visible properties from this object to another.

CreateObjRef

CreateObjRef method.

CreateParameter

Creates a new parameter for a Property.

Duplicate

Creates a copy of the current DataModelObject.

Equals

Equals method.

ExportAssemblyManagerData

Exports the data relevant to the Assembly Manager

ForceUnlock

ForceUnlock method.

GetAPIName

Property name bound to dispId.

GetAllProperties

GetAllProperties method.

GetCanonicalProjectPath

GetCanonicalProjectPath method.

GetChildren

Gets the list of children, filtered by type.

GetDetailsView

GetDetailsView method.

GetEnumName

Enum name bound to value

GetHashCode

GetHashCode method.

GetIconFile

GetIconFile method.

GetLifetimeService

GetLifetimeService method.

GetObjectData

GetObjectData method.

GetParameter

Gets the parameter corresponding to the given property.

GetPath

GetPath method.

GetPropertyName

GetPropertyName method.

GetPropertyValue

GetPropertyValue method.

GetType

GetType method.

GetVisibleProperties

GetVisibleProperties method.

GetVisiblePropertyNames

GetVisiblePropertyNames method.

GroupAllSimilarChildren

Run the GroupAllSimilarChildren action.

GroupSimilarObjects

Run the GroupSimilarObjects action.

InitializeLifetimeService

InitializeLifetimeService method.

IsPropertyEditable

IsPropertyEditable method.

IsPropertyVisible

IsPropertyVisible method.

New

For Mechanical opened independently, without Workbench. Start a new Mechanical project.

Open

For Mechanical opened independently, without Workbench. Open an existing Mechanical project.

PropertyByAPIName

Get a property by its API name.

PropertyById

PropertyById method.

PropertyByName

Get a property by its unique name.

RemoveDuplicateBodies

Removes dupliate bodies from the tree.

RemoveParameter

Removes the parameter from the parameter set corresponding to the given property.

ResetArchiveData

For Mechanical opened independently, without Workbench. Resets the cached file path data for opening an archived project file.

Save

For Mechanical opened independently, without Workbench. Save current Mechanical project.

SaveAs

For Mechanical opened independently, without Workbench. Save current Mechanical project to given filePath.

SpecifyMetricTemperatureInCelsius

Specify the use of Celsius thermal units for metric unit systems.

SpecifyMetricTemperatureInKelvin

Specify the use of Kelvin thermal units for metric unit systems.

ToString

ToString method.

Unarchive

For Mechanical opened independently, without Workbench. Unarchive a Mechanical project and open it.

ValidateStateEngine

Runs a full state engine validation of the tree

AttachedRefs

AttachedRefs property.

Author

Gets or sets the Author.

Children

Gets the list of children.

ClsId

ClsId property.

Comments

Gets the list of associated comments.

CreationDate

Gets the CreationDate.

CreationTime

Gets the CreationTime.

DataModelObjectCategory

Gets the current DataModelObject's category.

EngineeringDataLibrary

EngineeringDataLibrary property.

FilePath

Gets the Mechanical Project file path of current Mechanical session.

FirstSaved

Gets the FirstSaved.

GroupingFolder

GroupingFolder property.

IconName

IconName property.

Images

Gets the list of associated images.

ImportedSource

Gets the ImportedSource.

ImportedVersion

Gets the ImportedVersion.

InternalObject

Gets the internal object. For advanced usage only.

IsArchive

For Mechanical opened independently, without Workbench. Returns True when working in an opened archive project, otherwise, returns False.

LastSaved

Gets the LastSaved.

Model

Gets the Model.

Models

Gets the Model.

Name

Name property.

ObjectId

ObjectId property.

ObjectState

ObjectState property.

ObjectTags

ObjectTags property.

OriginalArchiveFile

For Mechanical opened independently, without Workbench. Returns the original archive file path opened in current session.

Parent

Parent property.

PreparedFor

Gets or sets the PreparedFor.

ProductVersion

Gets the ProductVersion.

ProjectDirectory

Gets the Project Directory

Properties

Gets the list of properties for this object.

SaveProjectAfterSolution

Gets or sets the SaveProjectAfterSolution.

SaveProjectBeforeSolution

Gets or sets the SaveProjectBeforeSolution.

State

State property.

StateEngineMode

Sets the State Engine Mode which controls validation

Subject

Gets or sets the Subject.

UnarchivedProjectFile

For Mechanical opened independently, without Workbench. Returns the unarchived project file path of the current session.

UnitSystem

Change the Unit System.

UserFiles

Gets the path of the user files folder of current project.

VisibleProperties

Gets the list of properties that are visible for this object.

Property detail#

property Project.AttachedRefs: List[int] | None#

AttachedRefs property.

property Project.Author: str | None#

Gets or sets the Author.

property Project.Children: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject] | None#

Gets the list of children.

property Project.ClsId: int | None#

ClsId property.

property Project.Comments: Iterable[Ansys.ACT.Automation.Mechanical.Comment] | None#

Gets the list of associated comments.

property Project.CreationDate: str | None#

Gets the CreationDate.

property Project.CreationTime: str | None#

Gets the CreationTime.

property Project.DataModelObjectCategory: Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory | None#

Gets the current DataModelObject's category.

property Project.EngineeringDataLibrary: Any | None#

EngineeringDataLibrary property.

property Project.FilePath: str | None#

Gets the Mechanical Project file path of current Mechanical session.

property Project.FirstSaved: str | None#

Gets the FirstSaved.

property Project.GroupingFolder: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject | None#

GroupingFolder property.

property Project.IconName: str | None#

IconName property.

property Project.Images: Iterable[Ansys.ACT.Automation.Mechanical.Image] | None#

Gets the list of associated images.

property Project.ImportedSource: str | None#

Gets the ImportedSource.

property Project.ImportedVersion: str | None#

Gets the ImportedVersion.

property Project.InternalObject: Ansys.Common.Interop.DSObjectsAuto.IDSProjectAuto | None#

Gets the internal object. For advanced usage only.

property Project.IsArchive: bool | None#

For Mechanical opened independently, without Workbench. Returns True when working in an opened archive project, otherwise, returns False.

property Project.LastSaved: str | None#

Gets the LastSaved.

property Project.Model: Ansys.ACT.Automation.Mechanical.Model | None#

Gets the Model.

property Project.Models: Iterable[Ansys.ACT.Automation.Mechanical.Model] | None#

Gets the Model.

property Project.Name: str | None#

Name property.

property Project.ObjectId: int | None#

ObjectId property.

property Project.ObjectState: Ansys.Mechanical.DataModel.Enums.ObjectState | None#

ObjectState property.

property Project.ObjectTags: Iterable[Ansys.Mechanical.DataModel.Interfaces.IObjectTag] | None#

ObjectTags property.

property Project.OriginalArchiveFile: str | None#

For Mechanical opened independently, without Workbench. Returns the original archive file path opened in current session.

property Project.Parent: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject | None#

Parent property.

property Project.PreparedFor: str | None#

Gets or sets the PreparedFor.

property Project.ProductVersion: str | None#

Gets the ProductVersion.

property Project.ProjectDirectory: str | None#

Gets the Project Directory

property Project.Properties: tuple[Ansys.ACT.Automation.Mechanical.Property] | None#

Gets the list of properties for this object.

property Project.SaveProjectAfterSolution: bool | None#

Gets or sets the SaveProjectAfterSolution.

property Project.SaveProjectBeforeSolution: bool | None#

Gets or sets the SaveProjectBeforeSolution.

property Project.State: Ansys.Mechanical.DataModel.Enums.Legacy.State | None#

State property.

property Project.StateEngineMode: Ansys.Mechanical.DataModel.Enums.StateEngineMode | None#

Sets the State Engine Mode which controls validation

property Project.Subject: str | None#

Gets or sets the Subject.

property Project.UnarchivedProjectFile: str | None#

For Mechanical opened independently, without Workbench. Returns the unarchived project file path of the current session.

property Project.UnitSystem: Ansys.Mechanical.DataModel.Enums.UserUnitSystemType | None#

Change the Unit System.

property Project.UserFiles: str | None#

Gets the path of the user files folder of current project.

property Project.VisibleProperties: tuple[Ansys.ACT.Automation.Mechanical.Property] | None#

Gets the list of properties that are visible for this object.

Method detail#

Project.Activate() None#

Activate the current object.

Project.AddComment() Ansys.ACT.Automation.Mechanical.Comment#

Creates a new child Comment.

Project.AddImage(filePath: str) Ansys.ACT.Automation.Mechanical.Image#
Creates a new child Image.
If a filePath is provided, the image will be loaded from that file,
if not, the image will be a screen capture of the Geometry window.
Project.AddMaterial(url: str, urn: str, name: str) str#

Add a material from a file to the project.

Project.Archive(archivePath: str, overwrite: bool, settings: Ansys.ACT.Automation.Mechanical.ArchiveSettings) None#

For Mechanical opened independently, without Workbench. Archive a Mechanical project.

Project.BackupExists() bool#

BackupExists method.

Project.BackupRemove() None#

BackupRemove method.

Project.BackupRestore() None#

BackupRestore method.

Project.BackupSaveAsCopy(filePath: str) None#

BackupSaveAsCopy method.

Project.ClearGeneratedData() None#

Run the ClearGeneratedData action.

Project.CombineTextFiles(PrimaryFileName: str, SecondaryFileName: str) None#

Combines two text(.txt / .dmig / .inp / .dat) files. The secondary file will be appened to the primary file

Project.CopyTo(other: Ansys.ACT.Automation.Mechanical.DataModelObject) None#

Copies all visible properties from this object to another.

Project.CreateObjRef(requestedType: type) System.Runtime.Remoting.ObjRef#

CreateObjRef method.

Project.CreateParameter(propName: str) Ansys.ACT.Interfaces.Mechanical.IParameter#

Creates a new parameter for a Property.

classmethod Project.DetermineStandaloneAppletModeFromArchive(archiveFile: str) None#

DetermineStandaloneAppletModeFromArchive method.

Project.Duplicate() Ansys.Mechanical.DataModel.Interfaces.IDataModelObject#

Creates a copy of the current DataModelObject.

Project.Equals(other: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject) bool#

Equals method.

Project.ExportAssemblyManagerData(destinationDir: str, exportFormat: Ansys.Mechanical.DataModel.Enums.AssemblyManagerExportFormat, exportSettings: Ansys.ACT.Automation.Mechanical.AssemblyManagerExportSettings) None#

Exports the data relevant to the Assembly Manager

Project.ForceUnlock(projectFilePath: str) None#

ForceUnlock method.

Project.GetAPIName(dispId: int) str#

Property name bound to dispId.

Project.GetAllProperties() List[Ansys.ACT.Automation.Mechanical.AutomationPropertyWrapper]#

GetAllProperties method.

Project.GetCanonicalProjectPath(sourcePath: str) str#

GetCanonicalProjectPath method.

Project.GetChildren(recurses: bool, children: List[ChildrenType]) List[ChildrenType]#

Gets the list of children, filtered by type.

Project.GetDetailsView() Ansys.ACT.Automation.Mechanical.DetailsViewData#

GetDetailsView method.

Project.GetEnumName(enumType: type, value: int, dispId: int) str#

Enum name bound to value

Project.GetHashCode() int#

GetHashCode method.

Project.GetIconFile() System.Byte#

GetIconFile method.

Project.GetLifetimeService() Any#

GetLifetimeService method.

Project.GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext) None#

GetObjectData method.

Project.GetParameter(propName: str) Ansys.ACT.Interfaces.Mechanical.IParameter#

Gets the parameter corresponding to the given property.

Project.GetPath() str#

GetPath method.

Project.GetPropertyName(dispId: int) str#

GetPropertyName method.

Project.GetPropertyValue(name: str) Any#

GetPropertyValue method.

Project.GetType() type#

GetType method.

Project.GetVisibleProperties() List[System.Reflection.PropertyInfo]#

GetVisibleProperties method.

Project.GetVisiblePropertyNames() List[str]#

GetVisiblePropertyNames method.

Project.GroupAllSimilarChildren() None#

Run the GroupAllSimilarChildren action.

Project.GroupSimilarObjects() Ansys.ACT.Automation.Mechanical.TreeGroupingFolder#

Run the GroupSimilarObjects action.

Project.InitializeLifetimeService() Any#

InitializeLifetimeService method.

Project.IsPropertyEditable(dispId: int) bool#

IsPropertyEditable method.

Project.IsPropertyVisible(dispId: int) bool#

IsPropertyVisible method.

Project.New() None#

For Mechanical opened independently, without Workbench. Start a new Mechanical project.

Project.Open(filePath: str) None#

For Mechanical opened independently, without Workbench. Open an existing Mechanical project.

Project.PropertyByAPIName(name: str) Ansys.ACT.Automation.Mechanical.Property#
Get a property by its API name.
If multiple properties have the same API Name, only the first property with that name will be returned.
Project.PropertyById(dispId: int) Ansys.ACT.Automation.Mechanical.Property#

PropertyById method.

Project.PropertyByName(name: str) Ansys.ACT.Automation.Mechanical.Property#

Get a property by its unique name.

Project.RemoveDuplicateBodies() None#

Removes dupliate bodies from the tree.

Project.RemoveParameter(propName: str) None#

Removes the parameter from the parameter set corresponding to the given property.

Project.ResetArchiveData() None#

For Mechanical opened independently, without Workbench. Resets the cached file path data for opening an archived project file.

Project.Save() None#

For Mechanical opened independently, without Workbench. Save current Mechanical project.

Project.SaveAs(filePath: str, overwrite: bool) None#

For Mechanical opened independently, without Workbench. Save current Mechanical project to given filePath.

Project.SpecifyMetricTemperatureInCelsius() None#

Specify the use of Celsius thermal units for metric unit systems.

Project.SpecifyMetricTemperatureInKelvin() None#

Specify the use of Kelvin thermal units for metric unit systems.

Project.ToString() str#

ToString method.

Project.Unarchive(archivePath: str, projectPath: str, overwrite: bool) str#
For Mechanical opened independently, without Workbench. Unarchive a Mechanical project and open it.
If projectPath is provided, the project will be unarchived to this given projectPath.
If projectPath is not provided or is null or empty, the project will be unarchived to a temporary folder.
Returns a path to the unarchived project database file.
Project.ValidateStateEngine() None#

Runs a full state engine validation of the tree