Skip to main content

Mechanical scripting interface

Body

Last update: 14.01.2025

class Ansys.ACT.Automation.Mechanical.Body

Bases: object

Defines a Body.

Overview

Methods

Name Description
Activate Activate the current object.
AddCommandSnippet Creates a new CommandSnippet
AddComment Creates a new child Comment.
AddFigure Creates a new child Figure.
AddImage Creates a new child Image.
AddPythonCodeEventBased Creates a new PythonCodeEventBased
ClearGeneratedData Run the ClearGeneratedData action.
CopyTo Copies all visible properties from this object to another.
CreateParameter Creates a new parameter for a Property.
Duplicate Creates a copy of the current DataModelObject.
GenerateMesh Run the GenerateMesh action.
GetChildren Gets the list of children, filtered by type.
GetGeoBody Gets the Geo Body
GetParameter Gets the parameter corresponding to the given property.
GroupAllSimilarChildren Run the GroupAllSimilarChildren action.
GroupSimilarObjects Run the GroupSimilarObjects action.
PreviewInflation Run the PreviewInflation action.
PreviewSurfaceMesh Run the PreviewSurfaceMesh action.
PropertyByAPIName Get a property by its API name.
PropertyByName Get a property by its unique name.
RemoveParameter Removes the parameter from the parameter set corresponding to the given property.
ShowBody Run the ShowBody action.
Update Run the Update action.

Properties

Name Description
Assignment Gets or sets the Assignment.
Average Gets the Average.
BeamSection Gets the BeamSection.
Behavior Gets or sets the Behavior.
BrickIntegrationScheme Gets or sets the BrickIntegrationScheme.
CentroidX Gets the CentroidX.
CentroidY Gets the CentroidY.
CentroidZ Gets the CentroidZ.
Children Gets the list of children.
Color Gets or sets the Color, encoded as a BGR bitfield.
Comments Gets the list of associated comments.
ConfigurationId Gets the related Result Mesh’s ConfigurationId.
CoordinateSystem Gets or sets the CoordinateSystem.
CrossSectionArea Gets the CrossSectionArea.
CrossSectionIYY Gets the CrossSectionIYY.
CrossSectionIZZ Gets the CrossSectionIZZ.
CrossSectionName Gets CrossSectionName.
CrossSectionSelection Gets or sets the CrossSectionSelection.
DataModelObjectCategory Gets the current DataModelObject’s category.
Dimension Gets or sets the Dimension.
Elements Gets the Elements.
FiberAngle Gets or sets the FiberAngle.
FiberCrossSectionArea Gets or sets the FiberCrossSectionArea.
FiberSpacing Gets or sets the FiberSpacing.
Figures Gets the list of associated figures.
FluidCrossArea Gets or sets the FluidCrossArea.
FluidDiscretization Gets or sets the FluidDiscretization.
FluidSolidPhase Gets or sets the FluidSolidPhase.
GeometryType Gets the GeometryType.
Hidden Hide or show the body.
HomogeneousMembrane Gets or sets the HomogeneousMembrane.
Images Gets the list of associated images.
InternalObject Gets the internal object. For advanced usage only.
IsWindingBody Gets the IsWindingBody.
Length Gets the Length.
LengthX Gets the LengthX.
LengthY Gets the LengthY.
LengthZ Gets the LengthZ.
LinkTrussBehavior Gets or sets the LinkTrussBehavior.
ManualThicknessMode Gets the ManualThicknessMode.
Mass Gets the Mass.
Material Gets or sets the Material.
MaterialPolarizationDirection Gets or sets the MaterialPolarizationDirection.
Maximum Gets the Maximum.
MeshMetric Gets the MeshMetric.
MeshVersion Gets the MeshVersion.
Minimum Gets the Minimum.
ModelType Gets or sets the ModelType.
MomentOfInertiaIp1 Gets the MomentOfInertiaIp1.
MomentOfInertiaIp2 Gets the MomentOfInertiaIp2.
MomentOfInertiaIp3 Gets the MomentOfInertiaIp3.
Nodes Gets the Nodes.
NonlinearEffects Gets or sets the NonlinearEffects.
NumberOfTurns Gets or sets the NumberOfTurns.
OffsetMode Gets or sets the OffsetMode.
OffsetType Gets or sets the OffsetType.
OffsetX Gets or sets the OffsetX.
OffsetY Gets or sets the OffsetY.
PipeExternalDiameter Gets the PipeExternalDiameter.
PipeInternalDiameter Gets the PipeInternalDiameter.
PipeThickness Gets the PipeThickness.
Properties Gets the list of properties for this object.
ReadOnly Gets or sets the ReadOnly.
ReferenceFrame Gets or sets the ReferenceFrame.
ReferenceTemperature Gets or sets the ReferenceTemperature.
ReferenceTemperatureValue Gets or sets the ReferenceTemperatureValue.
ReinforcingStressState Gets or sets the ReinforcingStressState.
ResultMeshId Gets the related Result Mesh’s ObjectId.
ShellOffsetType Gets or sets the ShellOffsetType.
StandardDeviation Gets the StandardDeviation.
StiffnessBehavior Gets or sets the StiffnessBehavior.
StiffnessOption Gets or sets the StiffnessOption.
Suppressed Gets or sets the Suppressed.
SuppressedParameterized Gets if the part suppressed property is parameterized.
SurfaceArea Gets the SurfaceArea.
ThermalStrainEffects Gets or sets the ThermalStrainEffects.
Thickness Gets or sets the Thickness.
ThicknessMode Gets the ThicknessMode.
Transparency Gets or sets the Transparency. Values range from 0.0 (fully invisible) to 1.0 (fully visible).
Treatment Gets or sets the Treatment.
UseReferenceTemperatureByBody Gets or sets the UseReferenceTemperatureByBody.
UserNameChange Gets the UserNameChange.
Visible Gets or sets the Visible.
VisibleProperties Gets the list of properties that are visible for this object.
Volume Gets the Volume.

Property detail

property Body.Assignment : str | None

Gets or sets the Assignment.

property Body.Average : Ansys.Core.Units.Quantity | None

Gets the Average.

property Body.BeamSection : Ansys.ACT.Automation.Mechanical.DataModelObject | None

Gets the BeamSection.

property Body.Behavior : Ansys.Mechanical.DataModel.Enums.Model2DBehavior | None

Gets or sets the Behavior.

property Body.BrickIntegrationScheme : Ansys.Mechanical.DataModel.Enums.BrickIntegrationScheme | None

Gets or sets the BrickIntegrationScheme.

property Body.CentroidX : Ansys.Core.Units.Quantity | None

Gets the CentroidX.

property Body.CentroidY : Ansys.Core.Units.Quantity | None

Gets the CentroidY.

property Body.CentroidZ : Ansys.Core.Units.Quantity | None

Gets the CentroidZ.

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

Gets the list of children.

property Body.Color : int | None

Gets or sets the Color, encoded as a BGR bitfield.

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

Gets the list of associated comments.

property Body.ConfigurationId : int | None

Gets the related Result Mesh’s ConfigurationId.

property Body.CoordinateSystem : Ansys.ACT.Automation.Mechanical.CoordinateSystem | None

Gets or sets the CoordinateSystem.

property Body.CrossSectionArea : Ansys.Core.Units.Quantity | None

Gets the CrossSectionArea.

property Body.CrossSectionIYY : Ansys.Core.Units.Quantity | None

Gets the CrossSectionIYY.

property Body.CrossSectionIZZ : Ansys.Core.Units.Quantity | None

Gets the CrossSectionIZZ.

property Body.CrossSectionName : str | None

Gets CrossSectionName.

property Body.CrossSectionSelection : Ansys.ACT.Automation.Mechanical.CrossSection | None

Gets or sets the CrossSectionSelection.

property Body.DataModelObjectCategory : Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory | None

Gets the current DataModelObject’s category.

property Body.Dimension : Ansys.Mechanical.DataModel.Enums.ShellBodyDimension | None

Gets or sets the Dimension.

property Body.Elements : int | None

Gets the Elements.

property Body.FiberAngle : Ansys.Core.Units.Quantity | None

Gets or sets the FiberAngle.

property Body.FiberCrossSectionArea : Ansys.Core.Units.Quantity | None

Gets or sets the FiberCrossSectionArea.

property Body.FiberSpacing : Ansys.Core.Units.Quantity | None

Gets or sets the FiberSpacing.

property Body.Figures : Iterable[Ansys.ACT.Automation.Mechanical.Figure] | None

Gets the list of associated figures.

property Body.FluidCrossArea : Ansys.Core.Units.Quantity | None

Gets or sets the FluidCrossArea.

property Body.FluidDiscretization : Ansys.Mechanical.DataModel.Enums.FluidDiscretizationType | None

Gets or sets the FluidDiscretization.

property Body.FluidSolidPhase : Ansys.Mechanical.DataModel.Enums.PhaseType | None

Gets or sets the FluidSolidPhase.

property Body.GeometryType : Ansys.Mechanical.DataModel.Enums.GeometryType | None

Gets the GeometryType.

property Body.Hidden : bool | None

Hide or show the body.

property Body.HomogeneousMembrane : bool | None

Gets or sets the HomogeneousMembrane.

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

Gets the list of associated images.

property Body.InternalObject : Ansys.Common.Interop.DSObjectsAuto.IDSPrototypeAuto | None

Gets the internal object. For advanced usage only.

property Body.IsWindingBody : bool | None

Gets the IsWindingBody.

property Body.Length : Ansys.Core.Units.Quantity | None

Gets the Length.

property Body.LengthX : Ansys.Core.Units.Quantity | None

Gets the LengthX.

property Body.LengthY : Ansys.Core.Units.Quantity | None

Gets the LengthY.

property Body.LengthZ : Ansys.Core.Units.Quantity | None

Gets the LengthZ.

property Body.LinkTrussBehavior : Ansys.Mechanical.DataModel.Enums.PrototypeLinkBehavior | None

Gets or sets the LinkTrussBehavior.

property Body.ManualThicknessMode : bool | None

Gets the ManualThicknessMode.

property Body.Mass : Ansys.Core.Units.Quantity | None

Gets the Mass.

property Body.Material : str | None

Gets or sets the Material.

property Body.MaterialPolarizationDirection : Ansys.Mechanical.DataModel.Enums.MaterialPolarizationDirection | None

Gets or sets the MaterialPolarizationDirection.

property Body.Maximum : Ansys.Core.Units.Quantity | None

Gets the Maximum.

property Body.MeshMetric : Ansys.Mechanical.DataModel.Enums.MeshMetricType | None

Gets the MeshMetric.

property Body.MeshVersion : int | None

Gets the MeshVersion.

property Body.Minimum : Ansys.Core.Units.Quantity | None

Gets the Minimum.

property Body.ModelType : Ansys.Mechanical.DataModel.Enums.PrototypeModelType | None

Gets or sets the ModelType. Note: ModelType is applicable to line bodies and surface bodies only.

property Body.MomentOfInertiaIp1 : Ansys.Core.Units.Quantity | None

Gets the MomentOfInertiaIp1.

property Body.MomentOfInertiaIp2 : Ansys.Core.Units.Quantity | None

Gets the MomentOfInertiaIp2.

property Body.MomentOfInertiaIp3 : Ansys.Core.Units.Quantity | None

Gets the MomentOfInertiaIp3.

property Body.Nodes : int | None

Gets the Nodes.

property Body.NonlinearEffects : bool | None

Gets or sets the NonlinearEffects.

property Body.NumberOfTurns : int | None

Gets or sets the NumberOfTurns.

property Body.OffsetMode : Ansys.Mechanical.DataModel.Enums.AutomaticOrManual | None

Gets or sets the OffsetMode.

property Body.OffsetType : Ansys.Mechanical.DataModel.Enums.BeamOffsetType | None

Gets or sets the OffsetType.

property Body.OffsetX : Ansys.Core.Units.Quantity | None

Gets or sets the OffsetX.

property Body.OffsetY : Ansys.Core.Units.Quantity | None

Gets or sets the OffsetY.

property Body.PipeExternalDiameter : Ansys.Core.Units.Quantity | None

Gets the PipeExternalDiameter.

property Body.PipeInternalDiameter : Ansys.Core.Units.Quantity | None

Gets the PipeInternalDiameter.

property Body.PipeThickness : Ansys.Core.Units.Quantity | None

Gets the PipeThickness.

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

Gets the list of properties for this object.

property Body.ReadOnly : bool | None

Gets or sets the ReadOnly.

property Body.ReferenceFrame : Ansys.Mechanical.DataModel.Enums.ReferenceFrameType | None

Gets or sets the ReferenceFrame.

property Body.ReferenceTemperature : bool | None

Gets or sets the ReferenceTemperature.

property Body.ReferenceTemperatureValue : Ansys.Core.Units.Quantity | None

Gets or sets the ReferenceTemperatureValue.

property Body.ReinforcingStressState : Ansys.Mechanical.DataModel.Enums.ReinforcingStressState | None

Gets or sets the ReinforcingStressState.

property Body.ResultMeshId : int | None

Gets the related Result Mesh’s ObjectId.

property Body.ShellOffsetType : Ansys.Mechanical.DataModel.Enums.ShellOffsetType | None

Gets or sets the ShellOffsetType.

property Body.StandardDeviation : Ansys.Core.Units.Quantity | None

Gets the StandardDeviation.

property Body.StiffnessBehavior : Ansys.Mechanical.DataModel.Enums.StiffnessBehavior | None

Gets or sets the StiffnessBehavior.

property Body.StiffnessOption : Ansys.Mechanical.DataModel.Enums.ShellElementStiffnessOption | None

Gets or sets the StiffnessOption.

property Body.Suppressed : bool | None

Gets or sets the Suppressed.

property Body.SuppressedParameterized : bool | None

Gets if the part suppressed property is parameterized.

property Body.SurfaceArea : Ansys.Core.Units.Quantity | None

Gets the SurfaceArea.

property Body.ThermalStrainEffects : bool | None

Gets or sets the ThermalStrainEffects.

property Body.Thickness : Ansys.Core.Units.Quantity | None

Gets or sets the Thickness.

property Body.ThicknessMode : bool | None

Gets the ThicknessMode.

property Body.Transparency : float | None

Gets or sets the Transparency. Values range from 0.0 (fully invisible) to 1.0 (fully visible).

property Body.Treatment : Ansys.Mechanical.DataModel.Enums.BodyTreatment | None

Gets or sets the Treatment.

property Body.UseReferenceTemperatureByBody : bool | None

Gets or sets the UseReferenceTemperatureByBody.

property Body.UserNameChange : bool | None

Gets the UserNameChange.

property Body.Visible : bool | None

Gets or sets the Visible.

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

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

property Body.Volume : Ansys.Core.Units.Quantity | None

Gets the Volume.

Method detail

Body.Activate()

Activate the current object.

Body.AddCommandSnippet()

Creates a new CommandSnippet

Body.AddComment()

Creates a new child Comment.

Body.AddFigure()

Creates a new child Figure.

Body.AddImage(filePath: str)

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.

Body.AddPythonCodeEventBased()

Creates a new PythonCodeEventBased

Body.ClearGeneratedData()

Run the ClearGeneratedData action.

Body.CopyTo(other: Ansys.ACT.Automation.Mechanical.DataModelObject)

Copies all visible properties from this object to another.

Body.CreateParameter(propName: str)

Creates a new parameter for a Property.

Body.Duplicate()

Creates a copy of the current DataModelObject.

Body.GenerateMesh()

Run the GenerateMesh action.

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

Gets the list of children, filtered by type.

Body.GetGeoBody()

Gets the Geo Body

Body.GetParameter(propName: str)

Gets the parameter corresponding to the given property.

Body.GroupAllSimilarChildren()

Run the GroupAllSimilarChildren action.

Body.GroupSimilarObjects()

Run the GroupSimilarObjects action.

Body.PreviewInflation()

Run the PreviewInflation action.

Body.PreviewSurfaceMesh()

Run the PreviewSurfaceMesh action.

Body.PropertyByAPIName(name: str)

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.

Body.PropertyByName(name: str)

Get a property by its unique name.

Body.RemoveParameter(propName: str)

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

Body.ShowBody()

Run the ShowBody action.

Body.Update()

Run the Update action.