Free Bodies commands#
NaxToView functions to create free body diagrams in the active view.
- n2vscripting.freebodies.adjust_free_bodies_format(fx_show: bool = True, fx_color: str = '#FFFF0000', fx_scale: float = 1.0, fx_show_lc_label: bool = False, fx_show_value_label: bool = True, fy_show: bool = True, fy_color: str = '#FF00FF00', fy_scale: float = 1.0, fy_show_lc_label: bool = False, fy_show_value_label: bool = True, fz_show: bool = True, fz_color: str = '#FF0000FF', fz_scale: float = 1.0, fz_show_lc_label: bool = False, fz_show_value_label: bool = True, mx_show: bool = False, mx_color: str = '#FF00FFFF', mx_scale: float = 1.0, mx_show_lc_label: bool = False, mx_show_value_label: bool = True, my_show: bool = False, my_color: str = '#FFFF00FF', my_scale: float = 1.0, my_show_lc_label: bool = False, my_show_value_label: bool = True, mz_show: bool = False, mz_color: str = '#FFFFFF00', mz_scale: float = 1.0, mz_show_lc_label: bool = False, mz_show_value_label: bool = True, ftotal_show: bool = False, ftotal_color: str = '#FFFFFFFF', ftotal_scale: float = 1.0, ftotal_show_lc_label: bool = False, ftotal_show_value_label: bool = True, mtotal_show: bool = False, mtotal_color: str = '#FF000000', mtotal_scale: float = 1.0, mtotal_show_lc_label: bool = False, mtotal_show_value_label: bool = True, uniform_size: bool = False, global_scale: float = 0.3, labels_color: str = '#FFFFFF00') None #
Set visualization options for free body diagrams.
Calling this function sets all parameters that are not specified by the user to their default values.
- Parameters:
fx_show (bool, optional) – Show X component of the free body forces. Default: True.
fx_color (str, optional) – Hex color code for the X component of the free body forces. Default: #FFFD0505 (Red)
fx_scale (float, optional) – Scale of the X component of the free body forces. Default: 1.0
fx_show_lc_label (bool, optional) – Show LC label on the X component of the free body forces. Default: False
fx_show_value_label (bool, optional) – Show value label on the X component of the free body forces. Default: True
fy_show (bool, optional) – Show Y component of the free body forces. Default: True.
fy_color (str, optional) – Hex color code for the Y component of the free body forces. Default: #FF00FF00 (Lime)
fy_scale (float, optional) – Scale of the Y component of the free body forces. Default: 1.0
fy_show_lc_label (bool, optional) – Show LC label on the Y component of the free body forces. Default: False
fy_show_value_label (bool, optional) – Show value label on the Y component of the free body forces. Default: True
fz_show (bool, optional) – Show Z component of the free body forces. Default: True.
fz_color (str, optional) – Hex color code for the Z component of the free body forces. Default: #FF0000FF (Blue)
fz_scale (float, optional) – Scale of the Z component of the free body forces. Default: 1.0
fz_show_lc_label (bool, optional) – Show LC label on the Z component of the free body forces. Default: False
fz_show_value_label (bool, optional) – Show value label on the Z component of the free body forces. Default: True
mx_show (bool, optional) – Show X component of the free body moments. Default: True.
mx_color (str, optional) – Hex color code for the X component of the free body moments. Default: #FF00FFFF (Aqua)
mx_scale (float, optional) – Scale of the X component of the free body moments. Default: 1.0
mx_show_lc_label (bool, optional) – Show LC label on the X component of the free body moments. Default: False
mx_show_value_label (bool, optional) – Show value label on the X component of the free body moments. Default: True
my_show (bool, optional) – Show Y component of the free body moments. Default: True.
my_color (str, optional) – Hex color code for the Y component of the free body moments. Default: #FFFF00FF (Fuchsia)
my_scale (float, optional) – Scale of the Y component of the free body moments. Default: 1.0
my_show_lc_label (bool, optional) – Show LC label on the Y component of the free body moments. Default: False
my_show_value_label (bool, optional) – Show value label on the Y component of the free body moments. Default: True
mz_show (bool, optional) – Show Z component of the free body moments. Default: True.
mz_color (str, optional) – Hex color code for the Z component of the free body moments. Default: #FFFFFF00 (Yellow)
mz_scale (float, optional) – Scale of the Z component of the free body moments. Default: 1.0
mz_show_lc_label (bool, optional) – Show LC label on the Z component of the free body moments. Default: False
mz_show_value_label (bool, optional) – Show value label on the Z component of the free body moments. Default: True
ftotal_show (bool, optional) – Show total free body force. Default: True.
ftotal_color (str, optional) – Hex color code for the total free body forces. Default: #FFFFFFFF (White)
ftotal_scale (float, optional) – Scale of the total free body forces. Default: 1.0
ftotal_show_lc_label (bool, optional) – Show LC label on the total free body forces. Default: False
ftotal_show_value_label (bool, optional) – Show value label on the total free body forces. Default: True
mtotal_show (bool, optional) – Show total free body moment. Default: True.
mtotal_color (str, optional) – Hex color code for the total free body moments. Default: #FF000000 (Black)
mtotal_scale (float, optional) – Scale of the total free body moments. Default: 1.0
mtotal_show_lc_label (bool, optional) – Show LC label on the total free body moments. Default: False
mtotal_show_value_label (bool, optional) – Show value label on the total free body moments. Default: True
uniform_size (bool, optional) – Set an uniform size for all plotted forces and moments. Default: False
global_scale (float, optional) – Scale factor applied if uniform_size is True. Default: 0.3
labels_color (str, optional) – Hex color code for value and lc labels. Default: #FFFFFF00 (Yellow)
- n2vscripting.freebodies.calculate_free_bodies(section_names: List[str], lcs_incr: List[Tuple[int, int]]) None #
Run free body calculations for selected sections and load cases.
- Parameters:
section_names (List[str]) – A list with the names of the selected sections.
lcs_incr (List[Tuple[int, int]]) – A list of tuples with the selected load case-increment pairs.
Examples
>>> n2v.calculate_free_bodies(['section1'], [(1, 0), (2, 0)])
>>> n2v.calculate_free_bodies(['section1', 'section2'], [(1, 0), (2, 0)])
- n2vscripting.freebodies.create_new_section(section_name: str, nodes: list[int], elements: list[int], system: int = None, point: str = None) None #
Create a new free bodies section.
- Parameters:
section_name (str) – Name of the new section.
nodes (list[int]) – List of node ids to include in the section.
elements (list[int]) – List of element ids to include in the section.
system (int, optional) – Id of the coordinate system to use. Default is 0 (global system).
point (str, optional) – A tuple with the x,y,z coordinates of the point at which to calculate the free bodies. If not provided, the centroid of the section is used.
Examples
>>> # Create a new section with some nodes and elements, using the global coordinate system and the centroid as calculation point >>> n2v.create_new_section('Section1', [10000000, 10000001, 10000002], [20000000, 20000001, 20000002])
- n2vscripting.freebodies.delete_section(section_name: str) None #
Delete a free body section.
- Parameters:
section_name (str) – Name of the section to delete.
Examples
>>> n2v.delete_section('Section1')
- n2vscripting.freebodies.export_free_bodies_to_excel(file_name: str, show_forces: bool = True, show_moments: bool = True, show_node_coords: bool = True, show_sys_coords: bool = True) None #
Export free body calculations to an Excel file.
- Parameters:
file_name (str) – Path to the file in which to save the free body calculations.
show_forces (bool, optional) – Whether to show forces in the free body diagram.
show_moments (bool, optional) – Whether to show moments in the free body diagram. Default is True.
show_node_coords (bool, optional) – Whether to show node coordinates in the free body diagram. Default is True.
show_sys_coords (bool, optional) – Whether to show system coordinates in the free body diagram. Default is True.
Examples
>>> n2v.export_free_bodies_to_excel('C:/Path/To/FreeBodies.xlsx', True, True, True, True)
- n2vscripting.freebodies.hide_free_body(section_name: str, lc: int, incr: int) None #
Hide free body diagram of a section, load case and increment.
- Parameters:
section_name (str) – Name of the section.
lc (int) – Id of the load case.
incr (int) – Id of the increment.
Examples
>>> n2v.hide_free_body('Section1', 1, 0)
- n2vscripting.freebodies.hide_section(section_name: str) None #
Hide section on the current view.
- Parameters:
section_name (str) – Name of the section.
Examples
>>> n2v.hide_section('Section1')
- n2vscripting.freebodies.show_free_body(section_name: str, lc: int, incr: int) None #
Show free body diagram of a section, load case and increment.
- Parameters:
section_name (str) – Name of the section.
lc (int) – Id of the load case.
incr (int) – Id of the increment.
Examples
>>> n2v.show_free_body('Section1', 1, 0)
- n2vscripting.freebodies.show_section(section_name: str) None #
Show section on the current view.
- Parameters:
section_name (str) – Name of the section.
Examples
>>> n2v.show_section('Section1')