N2PGetFastener Module#

class NaxToPy.Modules.static.fasteners.N2PGetFasteners.N2PGetFasteners[source]#

Bases: object

The N2PGetFasteners class is used to obtain all necessary geometrical information about a model’s fasteners, including the creation of N2PJoint, N2PBolt, and N2PPlate objects.` The instance of this class must be prepared using the required properties before calling its method calculate()..

Example

>>> import NaxToPy as n2p
>>> from NaxToPy.Modules.static.fasteners.N2PGetFasteners import N2PGetFasteners
>>> model1 = n2p.load_model(r"route.fem") # Model is loaded
>>>
>>> # Empty instance of the N2PGetFasteners class is created
>>> fasteners = N2PGetFasteners()
>>> # The instance is prepared with the necessary properties
>>> fasteners.Model = model1 # Compulsory input
>>> fasteners.ElementList = model1.get_elements([10, 11, 12, 13, 14]) # Only some joints are to be analyzed (optional but recommended)
>>> fasteners.Thresh = 1.5 # Custom threshold is selected (optional)
>>> fasteners.GetAttachmentsBool = False # Attachments will not be obtained; True by default
>>> fasteners.GetDistanceBool = True # The distance attribute will be obtained, False by default
>>> fasteners.ExportLocation = r"folder_route" # Results are exported to an hdf5 file
>>> fasteners.calculate()
assign_diameter(elementList: list[N2PElement], diameter: float) None[source]#

Method used to assign a certain diameter to some joints, as defined by the N2PElements of their fastener.

Parameters:
  • elementList – list[N2PElement] -> list of the N2PElements that make up the fasteners

  • diameter – float -> diameter to be assigned

Calling example:
>>> fasteners.assign_diameter([fasteners.Model.get_elements(50052541, 50052538, 50052544)], 6.4)
calculate() None[source]#

Method used to do all the previous calculations.

Calling example:
>>> fasteners.calculate()
export_fasteners()[source]#

Method used to export the fasteners to an HDF5 file. The first plate in the array will get the value -1000, the last plate in the array will get the value 1000, and all the middle plates will get the value 0.

Calling example:
>>> fasteners.export_fasteners()
flip_plates() None[source]#

Method used to flip some plate lists.

Calling example:
>>> fasteners.flip_plates()
get_attachments() None[source]#

Method used to obtain the list of N2PAttachments and calculate their pitch. The get_joints() method must be used before this one. Otherwise, an error will occur.

Calling example:
>>> fasteners.get_attachments()
get_intersection() None[source]#

Method used to obtain the distance from every N2PPlate’s edge to its N2PJoint (optional), the intersection between an N2PPlate and its N2PJoint, the perpendicular direction to the N2PPlates, the A and B CFASTs for each plate, and their direction and factor. The get_joints() method must be used before this one. Otherwise, an error will occur.

Calling example:
>>> fasteners.get_intersection()
get_joints() None[source]#

Method used to create all N2PJoints, N2PPlates and N2PBolts and assign them certain useful attributes.

The following steps are followed:

1. All N2PJoints are created. Inside this, all N2PBolts and N2PPlates associated to each N2PJoint are also created. 2. All N2PBolts, N2PPlates are assigned certain important attributes, such as CentralElement or ElementList.

Calling example:
>>> fasteners.get_joints()
property AttachmentsList: list[N2PAttachment]#

Property that returns the attachments_list attribute, that is, the list of N2PAttachments.

property ElementList: list[N2PElement]#

Property that returns the element_list attribute, that is, the list of the loaded CFASTs.

property ExportLocation: str#

File path where the results are to be exported.

property GetAttachmentsBool: bool#

Property that returns the get_attachments_bool attribute, that is, the boolean that shows if the get_attachments() method will be used inside calculate().

property GetDistanceBool: bool#

Property that returns the get_distance_bool attribute, that is, the boolean that shows if the Distance and DistanceVector attributes will be calculated.

property JointsList: list[N2PJoint]#

Property that returns the joints_list attribute, that is, the list of N2PJoints to be analyzed.

property Model: N2PModelContent#

Property that returns the model attribute, that is, the model to be analyzed.

property PlateList: list[N2PPlate]#

Property that returns the list of N2PPlates.

property Thresh: float#

Property that returns the thresh attribute, that is, the tolerance used in the obtention of N2PJoints.