Model (hwx.inspire.core)

The active Inspire model. Model is a subclass of Assembly class.

It can be retrieved from and saved to a file. Is contains all the parts, joints, fasteners, load cases, and any other information required for its analysis.

Attributes

active: Bool autoCalculateCG: Bool autoCalculateMass: Bool
autoCalculateMeshSize: Bool autoCalculateMoment: Bool autoCalculateThickness: Bool
cg: Location color: Color contactSearchDistance: Double
detectCollisions: Bool gravityDirection: Direction gravityMagnitude: Double
ground: Bool ip: Inertia limitNumberOfElements: Bool
mass: Double material: Attribute maxMeshSize: Double
maxThickness: Double minMeshSize: Double minThickness: Double
modifiable: Bool morphable: Bool movable: Bool
name: Attribute numberOfElements: Int position: Attribute
transparency: Double visible: Bool volume: Double

Public Methods

getSkinMesh (self, parts, local=False)
save (self, file, selected=[])
switchToDesignParts (self)
switchToOptimizedParts (self, optimization)
updateContacts (self, parts=None, searchDistance=-1, visibleOnly=True, ignoreGroups=’rigid ground’, useExistingSearchDistances=True)

Attribute Details

active : Bool

Returns or sets the object activeness.

Setting this on or off sets all children. Setting to True sets all the parents active too.

autoCalculateCG : Bool

Determines whether the center of gravity is auto calculated.

autoCalculateMass : Bool

Determines whether the mass value is automatically calculated based upon volume and material density.

autoCalculateMeshSize : Bool

Indicates whether the minimum and average element sizes used for the solution are automatically calculated.

Set to False to enter these values manually.

Decreasing the minimum element size will increase the detail of your results in areas that use a number of small elements. The average element size controls the overall detail of your results.

autoCalculateMoment : Bool

Determines whether the mass moment of inertia is automatically calculated.

autoCalculateThickness : Bool

Determines whether the minimum and maximum thickness values are automatically calculated.

All parts are taken into account during the calculation.

cg : Location (units=”length”)

Returns the object’s global center of gravity as a point.

color : Color

Determines the color assigned to the object when it is displayed in the modeling window.

The default color for parts is gray, but a different color can be assigned.

contactSearchDistance : Double (units=”length”)

The global contact search distance for model.

detectCollisions : Bool

Determines whether to detect collision.

It prevents parts in the model from overlapping and has been enabled by default.

gravityDirection : Direction

Returns or sets unitless gravity direction. May not be normalized.

gravityMagnitude : Double (units=”acceleration”)

Returns or sets gravity acceleration scalar.

ground : Bool

Returns or sets the object to be ground or immovable.

ip : Inertia (units=”massMI”)

Specifies the inertial properties of this object.

Resistance to change in motion (ixx, iyy, izz, ixy, izy, ixz).

limitNumberOfElements : Bool

If True, limits the mesh size by number of elements.

mass : Double (units=”m”)

The mass of the object.

material : Attribute

The material of the object.

Every part in the model has a material assigned to it. The default material is steel, but a different material can be assigned.

maxMeshSize : Double (units=”length”)

Returns or sets the maximum mesh size of the part.

maxThickness : Double (units=”length”)

The maximum thickness value.

minMeshSize : Double (units=”length”)

Returns or sets the minimum mesh size of the part.

minThickness : Double (units=”length”)

The minimum thickness value.

modifiable : Bool

Determines whether the selected object can be edited.

morphable : Bool

Determines whether the selected object shape can be changed.

movable : Bool

Determines whether the selected object can be translated in the modeling window or has been locked in place.

name : Attribute

Returns or sets the name of the object.

It can be any text string, including spaces, although it’s best to avoid using the following characters: ” ‘ * ? and $.

While these characters are allowed, they could create difficulties when you export the model to other applications.

numberOfElements : Int

Specifies the number of elements in the mesh.

position : Attribute

Specifies the global transform as a Matrix44.

transparency : Double

Specifies the transparency of the object.

Allows you to change the transparency, according to a percentage. By default, objects are 0% transparent(opaque).

visible : Bool

Determines whether the object is visible in the modeling window.

Setting this on or off sets all children. Setting to True sets all the parents visible too.

volume : Double (units=”volume”)

The volume of the object in the assembly.

Property Details

cavities()

A list of all the cavities in the model.

contacts()

List of Structures Contacts in the model.

fasteners()

List of Fasteners in the model.

gravityComponents()

Returns gravity acceleration vector.

holes()

A list of all the holes in the model.

loadCases()

List of LoadCases in the model.

loads()

List of BoundaryConditions in the model.

measures()

List of Measures in the model.

rigidGroups()

List of RigidGroups in the model.

spotWelds()

List of SpotWelds in the model.

systems()

List of Systems in the model.

variables()

Variables used in sketching and geometry operations.

Method Details

getSkinMesh(self, parts, local=False)

Returns a dictionary of parts to the skin mesh (nodes and faces).

param parts:Specify the parts to skin mesh.
type parts:list[Part]
param local:If True, uses the local part collection, else occurrence collection. Recommended to use as defaults.
type local:bool
returns:Dictionary of parts to the skin mesh (nodes and faces).
rtype:dict
save(self, file, selected=[])

Save the active model to the path specified in file. If selected only these get saved, similar to save selected in the Inspire application.

param file:File name and path, where the file needs to be saved.
type file:str
param selected:An assembly or a list of assemblies or part or a list of parts to save.
type selected:Assembly, list[Assembly], list[Part], Part
returns:True, if file save is successful else False.
rtype:bool
switchToDesignParts(self)

Change all part alternatives to the design space

switchToOptimizedParts(self, optimization)

Change all part alternatives to optimized results.

param optimization:
 The name of the optimization to switch to.
type optimization:
 str
updateContacts(self, parts=None, searchDistance=-1, visibleOnly=True, ignoreGroups='rigid ground', useExistingSearchDistances=True)

Create or update contacts in model to account for part creation or movement.

Always call before querying Contact objects.

Note that this may also delete contacts, for example between grounded parts.

param parts:List of parts to update the contact for.
type parts:list[Part]
param searchDistance:
 Contact search distance.
type searchDistance:
 float
param visibleOnly:
 Searche only visible parts.
type visibleOnly:
 bool
param ignoreGroups:
 Ignores the group parts during contact updates.
type ignoreGroups:
 rigid ground
param useExistingSearchDistances:
 To use existing search distance.
type useExistingSearchDistances:
 bool
returns:True, if contacts where updated successfully else False.
rtype:bool