Occurrence (hwx.inspire)#

class Occurrence#

Bases: Named

Base class for Model, Assembly and Part.

Attribute Table#

Name

Type

animationPosition

property

autoCalculateCG

Bool

autoCalculateMass

Bool

autoCalculateMoment

Bool

axisAlignedBoundingBox

property

beadPatterns

property

cg

Location

cogConstraints

property

color

Color

concentratedMasses

property

detectCollisions

Bool

displacementConstraints

property

drawDirections

property

enforcedDisplacements

property

ground

Bool

grounded

property

ip

Inertia

location

property

mass

Double

material

Reference

minBoundingBox

property

modifiable

Bool

morphable

Bool

movable

Bool

position

Position

rotations

property

spiders

property

symmetryConstraints

property

temperatures

property

transparency

Double

volume

Double

Method Table#

Name

Description

destroy (self)

Destroys occurrences from the model.

save (self, file)

Save the Part in the specified file.

simplifyHoles (entity, minSize=0, maxSize=None)

Finds and removes holes and pockets, and find raised areas such as lettering.

simplifyImprints (entity)

Finds and removes imprints from a part.

simplifyPlugs (entity, minSize=0, maxSize=None)

Finds holes and pockets, and plug them by filling the area with a new part

simplifyRounds (entity, roundType=’ALL’, minSize=0, maxSize=None)

Finds and removes both round (convex) and fillet (concave) surfaces.

property material#

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.

property ground#

Returns or sets the object to be ground or immovable.

property grounded#

Determines whether the part is grounded.

property autoCalculateMass#

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

property mass#

The mass of the object.

property volume#

The volume of the object in the assembly.

property cg#

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

property autoCalculateCG#

Determines whether the center of gravity is auto calculated.

property 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.

property transparency#

Specifies the transparency of the object.

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

property detectCollisions#

Determines whether to detect collision.

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

property movable#

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

property modifiable#

Determines whether the selected object can be edited.

property morphable#

Determines whether the selected object shape can be changed.

property autoCalculateMoment#

Determines whether the mass moment of inertia is automatically calculated.

property ip#

Specifies the inertial properties of this object.

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

property position#

Specifies the global transform as a Matrix44.

property location#

Returns origin of the object as a Point.

property animationPosition#

Temporary part position during an animation.

Setting to None will revert the part back to its modeling position.

property axisAlignedBoundingBox#

math.Box

destroy()#

Destroys occurrences from the model.

property drawDirections#

List of the DrawDirections in the part/assembly.

property symmetryConstraints#

List of SymmetryConstraints in the part/assembly

property beadPatterns#

List of BeadPatterns in the part/assembly

property temperatures#

List of Temperatures in part/assembly

property cogConstraints#

List of COG Constraints in part/assembly

property rotations#

List of Rotations in part/assembly

property concentratedMasses#

List of Concentrated Masses in part/assembly

property displacementConstraints#

List of Displacement Constraints in part/assembly

property enforcedDisplacements#

List of Enforced Displacements in part/assembly

property spiders#

List of Connectors in part/assembly

save(file)#

Save the Part in the specified file.

Parameters:

file (str) –

File name and path, where the file needs to be saved. Valid file extensions are:

’.x_b’, ‘.x_t’, ‘.xmt_bin’, ‘.xmt_txt’, ‘.sat’, ‘.sab’, ‘.iges’, ‘.igs’, ‘.stl’, ‘.step’, ‘.stp’, ‘.obj’, ‘.vrml’, ‘.vrl’.

property minBoundingBox#

Returns the minimum bounding box.

Parameters:

occs (Feature | Part | Assembly) – Objects to bound.

Returns:

math.Box

simplifyHoles(minSize=0, maxSize=None)#

Finds and removes holes and pockets, and find raised areas such as lettering.

Parameters:
  • entity (Part | Assembly | Feature) – Part/Assembly from which you want to remove the holes from or FeatureCircular which needs to be removed.

  • minSize (float) – Minimum size of hole.

  • maxSize (float) – Maximum size of hole.

simplifyImprints()#

Finds and removes imprints from a part.

An imprint is an edge or a point that appears on a surface that can be removed without changing the underlying integrity of the surface, such as scratches or trimmed points.

Parameters:

entity (Part | Assembly | FeatureLinear) – Part/Assembly from which you want to remove the imprints from or FeatureLinear imprint to be removed.

simplifyPlugs(minSize=0, maxSize=None)#

Finds holes and pockets, and plug them by filling the area with a new part

Parameters:
  • entity (Part | Assembly | Feature) – Part/Assembly from which you want to plug the holes or a Circular feature that needs to be plugged.

  • minSize (float) – Minimum size of plug.

  • maxSize (float) – Maximum size of plug.

simplifyRounds(roundType='ALL', minSize=0, maxSize=None)#

Finds and removes both round (convex) and fillet (concave) surfaces.

Parameters:
  • entity (Part | Assembly | Feature) – Part/Assembly from which you want to remove the fillets, chamfers from or a Feature to be removed.

  • roundType (str) – Valid values are: ROUNDS, FILLETS, CHAMFERS and ALL.

  • minSize (float) – Minimum size of round.

  • maxSize (float) – Maximum size of round.