LoadCase (hwx.inspire)#

class LoadCase(loads=[], name='', **kwds)#

Bases: Named

A collection of BoundaryConditions/Grounded PartsConnectors (Fastener, Joint).

The same BoundaryConditions/Grounded PartsConnectors can appear in multiple LoadCases, while duplicates are not allowed.

Attribute Table#

Name

Type

loads

property

Method Table#

Name

Description

add (self, items)

Adds one or more BoundaryConditions/Grounded PartsConnectors to this load case.

remove (self, items)

Removes one or more BoundaryConditions/Grounded PartsConnectors to this load case.

Example

from hwx import inspire

model = inspire.newModel()
sheet = model.createSheetRectangle()
# create a load case to hold supports
loadcaseSupports = inspire.LoadCase(name="Supports")
support1 = inspire.Constraint(sheet.features[0])
loadcaseSupports.add(support1)
print("BCs in LoadCase", loadcaseSupports.name, ":")
print("", loadcaseSupports.loads)

# create a load case to hold forces
loadcaseForces = inspire.LoadCase(name="forces")
face = sheet.features[8]
force1 = inspire.Force(face, location=face.location, direction=face.normal, magnitude=10.0)
force2 = inspire.Force(face, location=[0.2, 0.2, 0.0], direction=face.normal, magnitude=10.0)
loadcaseForces.add([force1, force2])
print("BCs in LoadCase Forces", loadcaseForces.name, ":")
print("", loadcaseForces.loads)

# modify load cases
support2 = inspire.Constraint(sheet.features[0], location=[-0.5, 0.5, 0.0])
if not support2 in loadcaseSupports:
  loadcaseSupports.add(support2)
if force2 in loadcaseForces:
  loadcaseForces.remove(force2)

print("")
print("After modifications:")
print("BCs in LoadCase Supports", loadcaseSupports.name, ":")
print("", loadcaseSupports.loads)
print("BCs in LoadCase Forces", loadcaseForces.name, ":")
print("", loadcaseForces.loads)
print("")
print("BCs in model:")
print("", model.loads)
inspire.fitView()
property loads#

The list of BoundaryConditions/Grounded PartsConnectors of this loadcase.

add(items)#

Adds one or more BoundaryConditions/Grounded PartsConnectors to this load case.

Parameters:

items (Union[Union[BoundaryCondition, PartsConnector], list[Union[BoundaryCondition, PartsConnector]]]) – List of entities to add to loadcase.

Returns:

Returns True, if added to load case, else False.

Return type:

bool

remove(items)#

Removes one or more BoundaryConditions/Grounded PartsConnectors to this load case.

Parameters:

items (Union[Union[BoundaryCondition, PartsConnector], list[Union[BoundaryCondition, PartsConnector]]]) – List of entities to add to loadcase.

Returns:

Returns True, if removed from load case, else False.

Return type:

bool