Skip to content

Element Controller

Provide several sample math calculations.

This module allows the user to make mathematical calculations.

The module contains the following functions:

  • add(a, b) - Returns the sum of two numbers.
  • subtract(a, b) - Returns the difference of two numbers.
  • multiply(a, b) - Returns the product of two numbers.
  • divide(a, b) - Returns the quotient of two numbers.

activate_parts_without_situation()

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def activate_parts_without_situation() -> List[int]:
    """

    Returns:
        List[int]: element IDs
    """

activate_rv_without_situation()

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def activate_rv_without_situation() -> List[int]:
    """

    Returns:
        List[int]: element IDs
    """

add_created_elements_to_undo(elements)

add created elementes to undo storeage

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def add_created_elements_to_undo(elements: List[int]) -> None:
    """add created elementes to undo storeage

    Args:
        elements (List[int]): element IDs
    """

add_elements_to_detail(elements, detail_group)

detail groups: 0: without assigment

1: Angle; 2: Area; 3: Cross; 4: Edge; 5: End; 6: Line; 7: Open; 8: T; 9: FloorArea; 10: FloorEnd; 11: FloorLine; 12: FloorOpen

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
detail_group int

a detail group

required
Source code in element_controller/__init__.py
def add_elements_to_detail(elements: List[int], detail_group: int) -> None:
    """
    detail groups:
    0: without assigment

    1: Angle; 2: Area; 3: Cross; 4: Edge; 5: End; 6: Line; 7: Open; 
    8: T; 9: FloorArea; 10: FloorEnd; 11: FloorLine; 12: FloorOpen

    Args:
        elements (List[int]): element IDs
        detail_group (int): a detail group
    """

add_elements_to_undo(elements, number)

add elements to undo

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
number int

enum(1:add, 2:modify)

required
Source code in element_controller/__init__.py
def add_elements_to_undo(elements: List[int], number: int) -> None:
    """add elements to undo

    Args:
        elements (List[int]): element IDs
        number (int): enum(1:add, 2:modify)
    """

add_modified_elements_to_undo(elements)

add modified elementes to undo storeage

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def add_modified_elements_to_undo(elements: List[int]) -> None:
    """add modified elementes to undo storeage

    Args:
        elements (List[int]): element IDs
    """

apply_transformation_coordinate(elments, old_point, old_xl, old_yl, new_point, new_xl, new_yl)

apply transformation coordinate to transform elements in 3D space

Parameters:

Name Type Description Default
elments List[int]

element IDs to transform

required
old_point point_3d

location origin

required
old_xl point_3d

origin x dir (vector)

required
old_yl point_3d

origin y dir (vector)

required
new_point point_3d

new location

required
new_xl point_3d

new x dir (vector)

required
new_yl point_3d

new y dir (vector)

required
Source code in element_controller/__init__.py
def apply_transformation_coordinate(elments: List[int], old_point: point_3d, old_xl: point_3d, old_yl: point_3d, new_point: point_3d, new_xl: point_3d, new_yl: point_3d) -> None:
    """apply transformation coordinate to transform elements in 3D space

    Args:
        elments (List[int]): element IDs to transform
        old_point (point_3d): location origin
        old_xl (point_3d): origin x dir (vector)
        old_yl (point_3d): origin y dir (vector)
        new_point (point_3d): new location
        new_xl (point_3d): new x dir (vector)
        new_yl (point_3d): new y dir (vector)
    """

auto_set_parts_situation(elements)

Parameters:

Name Type Description Default
elementIDs List[int]

element IDs

required
Source code in element_controller/__init__.py
def auto_set_parts_situation(elements: List[int]) -> None:
    """

    Args:
        elementIDs (List[int]): element IDs
    """

auto_set_rough_volume_situation(elements)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def auto_set_rough_volume_situation(elements: List[int]) -> None:
    """

    Args:
        elements (List[int]): element IDs
    """

check_element_id(element)

check element ID

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
bool

True/False

Source code in element_controller/__init__.py
def check_element_id(element: int) -> bool:
    """check element ID

    Args:
        element (int): element ID

    Returns:
        bool: True/False
    """

check_if_elements_are_in_collision(first_element, second_element)

collision detection

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

first element ID

required
element int

second element ID

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def check_if_elements_are_in_collision(first_element: int, second_element: int) -> bool:
    """collision detection

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): first element ID
        element (int): second element ID

    Returns:
        bool: true/false
    """

check_if_elements_are_in_contact(first_element, second_element)

check if element faces are in contact

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

first element ID

required
element int

second element ID

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def check_if_elements_are_in_contact(first_element: int, second_element: int) -> bool:
    """check if element faces are in contact

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): first element ID
        element (int): second element ID

    Returns:
        bool: true/false
    """

check_if_point_is_in_element(point, element)

Check if point is in element

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
point point_3d

a cadwork point

required
element int

element ID

required

Returns:

Type Description
bool

if point

Source code in element_controller/__init__.py
def check_if_point_is_in_element(point: point_3d, element: int) -> bool:
    """Check if point is in element

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        point (point_3d): a cadwork point
        element (int): element ID

    Returns:
        bool: if point 
    """

check_if_point_is_on_element(point, element)

Checks if a point is on a element

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
point point_3d

a cadwork point

required
element int

element ID

required

Returns:

Type Description
bool

if point

Source code in element_controller/__init__.py
def check_if_point_is_on_element(point: point_3d, element: int) -> bool:
    """Checks if a point is on a element

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        point (point_3d): a cadwork point
        element (int): element ID

    Returns:
        bool: if point 
    """

clear_errors()

Source code in element_controller/__init__.py
def clear_errors() -> None:
    """
    """

convert_beam_to_panel(elements)

convert beam(s) to panel(s)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def convert_beam_to_panel(elements: List[int]) -> None:
    """convert beam(s) to panel(s)

    Args:
        elements (List[int]): element IDs
    """

convert_bolt_to_standardconnector(elements, standard_connector_axis_name)

convert bolt to standard connector

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
standard_connector_axis_name str

standard connector axis name

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def convert_bolt_to_standardconnector(elements: List[int], standard_connector_axis_name: str) -> int:
    """convert bolt to standard connector

    Args:
        elements (List[int]): element IDs
        standard_connector_axis_name (str): standard connector axis name

    Returns:
        int: element ID
    """

convert_circular_beam_to_drilling(elements)

convert circular beam to drilling

Parameters:

Name Type Description Default
elements List[int]

element ID

required
Source code in element_controller/__init__.py
def convert_circular_beam_to_drilling(elements: List[int]) -> None:
    """convert circular beam to drilling 

    Args:
        elements (List[int]): element ID
    """

convert_panel_to_beam(elements)

convert panel(s) to beam(s)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def convert_panel_to_beam(elements: List[int]) -> None:
    """convert panel(s) to beam(s)

    Args:
        elements (List[int]): element IDs
    """

copy_elements(elements, vector)

copy elements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
vector point_3d

copy vector

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def copy_elements(elements: List[int], vector: point_3d) -> List[int]:
    """copy elements

    Args:
        elements (List[int]): element IDs
        vector (point_3d): copy vector

    Returns:
        List[int]: element IDs
    """

create_auto_container_from_standard(elements, output_name, standard_element_name)

create an automatic container from a standard container

Parameters:

Name Type Description Default
elements List[int]

element ID

required
output_name str

container name

required
standard_element_name str

default container name

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_auto_container_from_standard(elements: List[int], output_name: str, standard_element_name: str) -> int:
    """create an automatic container from a standard container

    Args:
        elements (List[int]): element ID
        output_name (str): container name
        standard_element_name (str): default container name

    Returns:
        int: element ID
    """

create_auto_container_from_standard_with_reference(elements, output_name, standard_element_name, reference_id)

create auto container from standard. The orientation is determined according to an element.

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
output_name str

export solid name

required
standard_element_name str

standard element name

required
reference_id int

element ID (reference - orientation)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_auto_container_from_standard_with_reference(elements: List[int], output_name: str, standard_element_name: str, reference_id: int) -> int:
    """create auto container from standard. The orientation is determined according to an element. 

    Args:
        elements (List[int]): element IDs
        output_name (str): export solid name
        standard_element_name (str): standard element name
        reference_id (int): element ID (reference - orientation)

    Returns:
        int: element ID
    """

create_auto_export_solid_from_standard(elements, name, standard_element_name)

create automatic export solid from a standard export solid

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
name str

new name for export solid

required
standard_element_name str

name of standard export solid

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_auto_export_solid_from_standard(elements: List[int], name: str, standard_element_name: str) -> int:
    """create automatic export solid from a standard export solid

    Args:
        elements (List[int]): element IDs
        name (str): new name for export solid
        standard_element_name (str): name of standard export solid

    Returns:
        int: element ID
    """

create_auto_export_solid_from_standard_with_reference(elements, output_name, standard_element_name, reference_id)

create auto export solid from standard. The orientation is determined according to an element.

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
output_name str

export solid name

required
standard_element_name str

standard element name

required
reference_id int

element ID (reference - orientation)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_auto_export_solid_from_standard_with_reference(elements: List[int], output_name: str, standard_element_name: str, reference_id: int) -> int:
    """create auto export solid from standard. The orientation is determined according to an element. 

    Args:
        elements (List[int]): element IDs
        output_name (str): export solid name
        standard_element_name (str): standard element name
        reference_id (int): element ID (reference - orientation)

    Returns:
        int: element ID
    """

create_bounding_box_global(elements)

create a bounding box that is aligned to the global coordinate system.

Parameters:

Name Type Description Default
elements List[int]

element IDs

required

Returns:

Type Description
int

element ID bounding box

Source code in element_controller/__init__.py
def create_bounding_box_global(elements: List[int]) -> int:
    """create a bounding box that is aligned to the global coordinate system.

    Args:
        elements (List[int]): element IDs

    Returns:
        int: element ID bounding box
    """

create_bounding_box_local(element, elements)

create a bounding box that is aligned to a reference element. The bounding box includes all elements contained in the list.

Parameters:

Name Type Description Default
element int

element ID reference element

required
elements List[int]

element IDs

required

Returns:

Type Description
int

element ID bounding box

Source code in element_controller/__init__.py
def create_bounding_box_local(element: int, elements: List[int]) -> int:
    """create a bounding box that is aligned to a reference element. 
    The bounding box includes all elements contained in the list.

    Args:
        element (int): element ID reference element
        elements (List[int]): element IDs

    Returns:
        int: element ID bounding box
    """

create_circular_beam_points(diameter, p1, p2, p3)

create a circular beam. The direction (local x axis) and length of the beam is defined via p1 and p2. The parameter p3 is used to set the local z vector (height) of the beams coordinate system.

!!! args diameter (float): circle diameter p1 (point_3d): start point p2 (point_3d): end point p3 (point_3d): height point

!!! returns int: element ID

Source code in element_controller/__init__.py
def create_circular_beam_points(diameter: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int:
    """create a circular beam. The direction (local x axis) and length of the beam is defined via p1 and p2. 
   The parameter p3 is used to set the local z vector (height) of the beams coordinate system. 

    Args:
        diameter (float): circle diameter
        p1 (point_3d): start point
        p2 (point_3d): end point
        p3 (point_3d): height point

    Returns:
        int: element ID
    """

create_circular_beam_vectors(diameter, length, p1, xl, zl)

create a circular beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by xl (e.g. point_3d(1.,0.,0.)). The local z vector is defined via zl (e.g. point_3d(0.,1.,0.)).

Parameters:

Name Type Description Default
diameter float

circle diameter

required
length float

beam/axis length

required
p1 point_3d

start point

required
xl point_3d

local x vector

required
zl point_3d

local z vector

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_circular_beam_vectors(diameter: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int:
    """create a circular beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by xl (e.g. point_3d(1.,0.,0.)).
    The local z vector is defined via zl (e.g. point_3d(0.,1.,0.)).

    Args:
        diameter (float): circle diameter
        length (float): beam/axis length
        p1 (point_3d): start point
        xl (point_3d): local x vector
        zl (point_3d): local z vector

    Returns:
        int: element ID
    """

create_circular_mep(diameter, points)

create a circular mep

Parameters:

Name Type Description Default
diameter float

diameter

required
points List[point_3d]

vertice list

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_circular_mep(diameter: float, points: List[point_3d]) -> int:
    """create a circular mep

    Args:
        diameter (float): diameter
        points (List[point_3d]): vertice list

    Returns:
        int: element ID
    """

create_drilling_points(diameter, p1, p2)

Create a drilling from two points.

Parameters:

Name Type Description Default
diameter float

drilling diameter

required
p1 point_3d

start point

required
p2 point_3d

end point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_drilling_points(diameter: float, p1: point_3d, p2: point_3d) -> int:
    """Create a drilling from two points. 

    Args:
        diameter (float): drilling diameter
        p1 (point_3d): start point
        p2 (point_3d): end point

    Returns:
        int: element ID
    """

create_drilling_vectors(diameter, length, p1, xl)

Create a drilling from a point and a direction vector.

Parameters:

Name Type Description Default
diameter float

drilling diameter

required
length float

drilling length

required
p1 point_3d

start point

required
xl point_3d

vector direction

required

Returns:

Type Description
int

[description]

Source code in element_controller/__init__.py
def create_drilling_vectors(diameter: float, length: float, p1: point_3d, xl: point_3d) -> int:
    """Create a drilling from a point and a direction vector. 

    Args:
        diameter (float): drilling diameter
        length (float): drilling length
        p1 (point_3d): start point
        xl (point_3d): vector direction

    Returns:
        int: [description]
    """

create_line_points(p1, p2)

crete a line

Parameters:

Name Type Description Default
p1 point_3d

start point

required
p2 point_3d

end point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_line_points(p1: point_3d, p2: point_3d) -> int:
    """crete a line

    Args:
        p1 (point_3d): start point
        p2 (point_3d): end point

    Returns:
        int: element ID
    """

create_line_vectors(length, p1, xl)

crete a line

Parameters:

Name Type Description Default
length float

line length

required
p1 point_3d

start point

required
xl point_3d

vector direction

required

Returns:

Type Description
int

elmement id

Source code in element_controller/__init__.py
def create_line_vectors(length: float, p1: point_3d, xl: point_3d) -> int:
    """crete a line

    Args:
        length (float): line length
        p1 (point_3d): start point
        xl (point_3d): vector direction

    Returns:
        int: elmement id
    """

create_linear_optimization(elements, optimization_number, total_length, start_cut, end_cut, saw_kerf, is_production_list)

create linear optimization

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
optimization_number int

number of nesting volume

required
total_length float

total length nesting volume

required
start_cut float

start cut

required
end_cut float

end cut

required
saw_kerf float

saw kerf

required
is_production_list bool

measurements

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_linear_optimization(elements: List[int], optimization_number: int,
                               total_length: float, start_cut: float,
                               end_cut: float, saw_kerf: float, is_production_list: bool) -> int:
    """create linear optimization

    Args:
        elements (List[int]): element IDs
        optimization_number (int): number of nesting volume
        total_length (float): total length nesting volume
        start_cut (float): start cut
        end_cut (float): end cut
        saw_kerf (float): saw kerf
        is_production_list (bool): measurements

    Returns:
        int: element ID
    """

create_multi_wall(elements)

create multi wall

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def create_multi_wall(elements: List[int]) -> None:
    """create multi wall

    Args:
        elements (List[int]): element IDs
    """

create_node(p1)

create a node

Parameters:

Name Type Description Default
p1 point_3d

point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_node(p1: point_3d) -> int:
    """create a node

    Args:
        p1 (point_3d): point

    Returns:
        int: element ID
    """

create_normal_axis_points(p1, p2)

create normal axis points

Parameters:

Name Type Description Default
p1 point_3d

point 1

required
p2 point_3d

point 2

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_normal_axis_points(p1: point_3d, p2: point_3d) -> int:
    """create normal axis points

    Args:
        p1 (point_3d): point 1
        p2 (point_3d): point 2

    Returns:
        int: element ID
    """

create_normal_axis_vectors(length, p1, direction)

create normal axis vectors

Parameters:

Name Type Description Default
length float

length

required
p1 point_3d

point 1

required
direction point_3d

direction

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_normal_axis_vectors(length: float, p1: point_3d, direction: point_3d) -> int:
    """create normal axis vectors

    Args:
        length (float): length
        p1 (point_3d): point 1
        direction (point_3d): direction

    Returns:
        int: element ID
    """

create_polygon_beam(points, thickness, xl, zl)

create a polygon beam. Define the polygon outline in a vertex list.

Parameters:

Name Type Description Default
points List[point_3d]

vertex list

required
thickness float

beam thickness

required
xl point_3d

vector (length dir)

required
zl point_3d

vector (height dir)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_polygon_beam(points: List[point_3d], thickness: float, xl: point_3d, zl: point_3d) -> int:
    """create a polygon beam. Define the polygon outline in a vertex list.  

    Args:
        points (List[point_3d]): vertex list
        thickness (float): beam thickness
        xl (point_3d): vector (length dir)
        zl (point_3d): vector (height dir)

    Returns:
        int: element ID
    """

create_rectangular_beam_points(width, height, p1, p2, p3)

create a rectangular beam. The direction (local x axis) and length of the beam is defined via p1 and p2. The parameter p3 is used to set the local z vector (height) of the beams coordinate system.

Parameters:

Name Type Description Default
width float

beam width

required
height float

beam height

required
p1 point_3d

start point

required
p2 point_3d

end point

required
p3 point_3d

height point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_rectangular_beam_points(width: float, height: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int:
    """create a rectangular beam. The direction (local x axis) and length of the beam is defined via p1 and p2. 
    The parameter p3 is used to set the local z vector (height) of the beams coordinate system. 

    Args:
        width (float): beam width
        height (float): beam height
        p1 (point_3d): start point
        p2 (point_3d): end point
        p3 (point_3d): height point

    Returns:
        int: element ID
    """

create_rectangular_beam_vectors(width, height, length, p1, xl, zl)

create a rectangular beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by p2 (e.g. point_3d(1.,0.,0.)). The local z vector is defined via p3 (e.g. point_3d(0.,1.,0.)).

Examples:

>>> beam = ec.create_rectangular_beam_vectors(120.0, 240.0, 2800.0, cadwork.point_3d(0.,0.,0.), cadwork.point_3d(1.,0.,0.), cadwork.point_3d(0.,0.,1.))

Parameters:

Name Type Description Default
length float

length of beam axis

required
width float

beam width

required
height float

beam height

required
p1 point_3d

start point

required
xl point_3d

local x vector

required
zl point_3d

local z vector

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_rectangular_beam_vectors(width: float, height: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int:
    """create a rectangular beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by p2 (e.g. point_3d(1.,0.,0.)).
    The local z vector is defined via p3 (e.g. point_3d(0.,1.,0.)). 

    Examples:
        >>> beam = ec.create_rectangular_beam_vectors(120.0, 240.0, 2800.0, cadwork.point_3d(0.,0.,0.), cadwork.point_3d(1.,0.,0.), cadwork.point_3d(0.,0.,1.))

    Args:
        length (float): length of beam axis
        width (float): beam width
        height (float): beam height
        p1 (point_3d): start point 
        xl (point_3d): local x vector
        zl (point_3d): local z vector

    Returns:
        int: element ID
    """

create_rectangular_mep(width, depth, points)

create rectangular mep. The mep is orientied by an active element face.

Parameters:

Name Type Description Default
width float

mep width

required
depth float

mep depth

required
points List[point_3d]

vertice list

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_rectangular_mep(width: float, depth: float, points: List[point_3d]) -> int:
    """create rectangular mep. The mep is orientied by an active element face.

    Args:
        width (float): mep width
        depth (float): mep depth
        points (List[point_3d]): vertice list

    Returns:
        int: element ID
    """

create_rectangular_panel_points(width, thickness, p1, p2, p3)

create a rectangular panel. The direction (local x axis) and length of the panel is defined via p1 and p2. The parameter (p3) is used to set the local z vector (thickness) of the beams coordinate system.

Parameters:

Name Type Description Default
width float

beam width

required
thickness float

beam thickness

required
p1 point_3d

start point

required
p2 point_3d

end point

required
p3 point_3d

height point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_rectangular_panel_points(width: float, thickness: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int:
    """create a rectangular panel. The direction (local x axis) and length of the panel is defined via p1 and p2. 
    The parameter (p3) is used to set the local z vector (thickness) of the beams coordinate system.

    Args:
        width (float): beam width
        thickness (float): beam thickness
        p1 (point_3d): start point
        p2 (point_3d): end point
        p3 (point_3d): height point

    Returns:
        int: element ID
    """

create_rectangular_panel_vectors(width, thickness, length, p1, xl, zl)

create a rectangular panel from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by p2 (e.g. point_3d(1.,0.,0.)). The local z vector is defined via p3 (e.g. point_3d(0.,1.,0.)).

Parameters:

Name Type Description Default
width float

panel width

required
thickness float

panel thickness

required
length float

panel/axis length

required
p1 point_3d

start point

required
xl point_3d

local x vector

required
zl point_3d

local z vector

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_rectangular_panel_vectors(width: float, thickness: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int:
    """create a rectangular panel from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by p2 (e.g. point_3d(1.,0.,0.)).
    The local z vector is defined via p3 (e.g. point_3d(0.,1.,0.)). 

    Args:
        width (float): panel width
        thickness (float): panel thickness
        length (float):  panel/axis length
        p1 (point_3d): start point
        xl (point_3d): local x vector
        zl (point_3d): local z vector

    Returns:
        int: element ID
    """

create_square_beam_points(width, p1, p2, p3)

create a square beam. The direction (local x axis) and length of the beam is defined via p1 and p2. The parameter p3 is used to set the local z vector (height) of the beams coordinate system.

Parameters:

Name Type Description Default
width float

beam width

required
p1 point_3d

start point

required
p2 point_3d

end point

required
p3 point_3d

height point

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_square_beam_points(width: float, p1: point_3d, p2: point_3d, p3: point_3d) -> int:
    """create a square beam. The direction (local x axis) and length of the beam is defined via p1 and p2. 
    The parameter p3 is used to set the local z vector (height) of the beams coordinate system. 

    Args:
        width (float): beam width
        p1 (point_3d): start point
        p2 (point_3d): end point
        p3 (point_3d): height point

    Returns:
        int: element ID
    """

create_square_beam_vectors(width, length, p1, xl, zl)

create a square beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by xl (e.g. point_3d(1.,0.,0.)). The local z vector is defined via zl (e.g. point_3d(0.,1.,0.)).

Parameters:

Name Type Description Default
width float

beam width

required
length float

beam/axis length

required
p1 point_3d

start point

required
xl point_3d

local x vector

required
zl point_3d

local z vector

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_square_beam_vectors(width: float, length: float, p1: point_3d, xl: point_3d, zl: point_3d) -> int:
    """create a square beam from vectors. The start point of the element is defined by p1. Then the direction (local x axis) is definied by xl (e.g. point_3d(1.,0.,0.)).
    The local z vector is defined via zl (e.g. point_3d(0.,1.,0.)).

    Args:
        width (float): beam width
        length (float): beam/axis length
        p1 (point_3d): start point
        xl (point_3d): local x vector
        zl (point_3d): local z vector

    Returns:
        int: element ID
    """

create_surface(points)

create a surface

Parameters:

Name Type Description Default
points List[point_3d]

vertex list

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_surface(points: List[point_3d]) -> int:
    """create a surface

    Args:
        points (List[point_3d]): vertex list

    Returns:
        int: element ID
    """

create_text_object(text, position, xl, zl, size)

create text object

Parameters:

Name Type Description Default
text str

your text

required
position point_3d

location

required
xl point_3d

length dir

required
zl point_3d

height dir

required
size float

font size

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_text_object(text: str, position: point_3d, xl: point_3d, zl: point_3d, size: float) -> int:
    """create text object

    Args:
        text (str): your text
        position (point_3d): location
        xl (point_3d): length dir
        zl (point_3d): height dir
        size (float): font size

    Returns:
        int: element ID
    """

create_text_object_with_font(text, position, xl, zl, size, font)

create text object with font

Parameters:

Name Type Description Default
text str

your text

required
position point_3d

location

required
xl point_3d

length dir

required
zl point_3d

height dir

required
size float

font size

required
font str

font type (e.g. , "Times New Roman")

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def create_text_object_with_font(text: str, position: point_3d, xl: point_3d, zl: point_3d, size: float, font: str) -> int:
    """create text object with font

    Args:
        text (str): your text
        position (point_3d): location
        xl (point_3d): length dir
        zl (point_3d): height dir
        size (float): font size
        font (str): font type (e.g. , "Times New Roman")

    Returns:
        int: element ID
    """

cut_element_with_plane(element, cut_plane_normal_vector, distance_from_global_origin)

cut an elment with a plane

Parameters:

Name Type Description Default
element int

element ID

required
cut_plane_normal_vector point_3d

plane normal vector

required
distance_from_global_origin float

distance from origin to plane

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def cut_element_with_plane(element: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool:
    """cut an elment with a plane

    Args:
        element (int): element ID
        cut_plane_normal_vector (point_3d): plane normal vector
        distance_from_global_origin (float): distance from origin to plane

    Returns:
        bool: true/false
    """

cut_elements_with_miter(first_element, second_element)

cut elements with miter. The miter is "cut" on loxal x-axis.

Parameters:

Name Type Description Default
element int

element ID

required
element int

element ID

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def cut_elements_with_miter(first_element: int, second_element: int) -> bool:
    """cut elements with miter. The miter is "cut" on loxal x-axis. 

    Args:
        element (int): element ID
        element (int): element ID

    Returns:
        bool: true/false
    """

delete_all_element_end_types(elements)

delete end types

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def delete_all_element_end_types(elements: List[int]) -> None:
    """delete end types

    Args:
        elements (List[int]): element IDs
    """

delete_all_element_processes(elements)

delete element processes

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def delete_all_element_processes(elements: List[int]) -> None:
    """delete element processes

    Args:
        elements (List[int]): element IDs
    """

delete_elements(elements)

Delete elements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def delete_elements(elements: List[int]) -> None:
    """Delete elements 

    Args:
        elements (List[int]): element IDs
    """

delete_elements_with_undo(elements)

delete elements and store the in undo

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def delete_elements_with_undo(elements: List[int]) -> None:
    """delete elements and store the in undo

    Args:
        elements (List[int]): element IDs
    """

extrude_surface_to_auxiliary_vector(element, vector)

Extrude a surface to a auxiliary element.

Parameters:

Name Type Description Default
element int

element ID

required
vector point_3d

vector e.g. point_3d(0,0,1200)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def extrude_surface_to_auxiliary_vector(element: int, vector: point_3d) -> int:
    """Extrude a surface to a auxiliary element. 

    Args:
        element (int): element ID
        vector (point_3d): vector e.g. point_3d(0,0,1200)

    Returns:
        int: element ID
    """

extrude_surface_to_beam_vector(element, vector)

Extrude a surface to a beam.

Parameters:

Name Type Description Default
element int

element ID

required
vector point_3d

vector e.g. point_3d(0,0,1200)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def extrude_surface_to_beam_vector(element: int, vector: point_3d) -> int:
    """Extrude a surface to a beam. 

    Args:
        element (int): element ID
        vector (point_3d): vector e.g. point_3d(0,0,1200)

    Returns:
        int: element ID
    """

extrude_surface_to_panel_vector(element, vector)

Extrude a surface to a panel.

Parameters:

Name Type Description Default
element int

element ID

required
vector point_3d

vector e.g. point_3d(0,0,1200)

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def extrude_surface_to_panel_vector(element: int, vector: point_3d) -> int:
    """Extrude a surface to a panel.

    Args:
        element (int): element ID
        vector (point_3d): vector e.g. point_3d(0,0,1200)

    Returns:
        int: element ID
    """

get_active_identifiable_element_ids()

Get active cadwork element IDs

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_active_identifiable_element_ids() -> List[int]:
    """Get active cadwork element IDs

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

get_all_identifiable_element_ids()

get all identifiable element IDs (visible and unvisible)

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_all_identifiable_element_ids() -> List[int]:
    """get all identifiable element IDs (visible and unvisible)

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

get_all_nesting_raw_parts()

Get all nesting raw parts.

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def get_all_nesting_raw_parts() -> List[int]:
    """Get all nesting raw parts.

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element IDs
    """

get_bounding_box_vertices_global(elements)

create a bounding box that is aligned to the global coordinate system.

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
elements List[int]

element IDs

required

Returns:

Type Description
List[point_3d]

bbx vertices

Source code in element_controller/__init__.py
def get_bounding_box_vertices_global(elements: List[int]) -> List[point_3d]:
    """create a bounding box that is aligned to the global coordinate system.

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        elements (List[int]): element IDs

    Returns:
        List[point_3d]: bbx vertices
    """

get_bounding_box_vertices_local(element, elements)

create a bounding box that is aligned to a reference element. The bounding box includes all elements contained in the list.

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID reference element

required
elements List[int]

element IDs

required

Returns:

Type Description
List[point_3d]

bbx vertices

Source code in element_controller/__init__.py
def get_bounding_box_vertices_local(element: int, elements: List[int]) -> List[point_3d]:
    """create a bounding box that is aligned to a reference element. 
    The bounding box includes all elements contained in the list.

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID reference element
        elements (List[int]): element IDs

    Returns:
        List[point_3d]: bbx vertices
    """

get_container_content_elements(element)

get container content elements

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def get_container_content_elements(element: int) -> List[int]:
    """get container content elements

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID
    Returns:
        List[int]: element IDs
    """

get_element_cadwork_guid(element)

get cadwork element guid

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
str

guid

Source code in element_controller/__init__.py
def get_element_cadwork_guid(element: int) -> str:
    """get cadwork element guid

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        str: guid
    """

get_element_contact_facets(first_element, second_element)

get element contact faces

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required
element int

element ID

required

Returns:

Type Description
List[List[point_3d]]

contact face vertice list

Source code in element_controller/__init__.py
def get_element_contact_facets(first_element: int, second_element: int) -> List[List[point_3d]]:
    """get element contact faces

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID
        element (int): element ID

    Returns:
        List[List[point_3d]]: contact face vertice list
    """

get_element_contact_vertices(first_element, second_element)

get element contact vertices

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

first element ID

required
element int

second element ID

required

Returns:

Type Description
List[point_3d]

vertices list

Source code in element_controller/__init__.py
def get_element_contact_vertices(first_element: int, second_element: int) -> List[point_3d]:
    """get element contact vertices

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): first element ID
        element (int): second element ID

    Returns:
        List[point_3d]: vertices list
    """

get_element_detail_path()

get the path from active elmeentmodule

ℹ Available for script filled attributes

Returns:

Type Description
str

path

Source code in element_controller/__init__.py
def get_element_detail_path() -> str:
    """get the path from active elmeentmodule

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        str: path
    """

get_element_from_cadwork_guid(guid)

get element from cadwork guid

Parameters:

Name Type Description Default
guid str

cadwork guid

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def get_element_from_cadwork_guid(guid: str) -> int:
    """get element from cadwork guid

    Args:
        guid (str): cadwork guid

    Returns:
        int: element ID
    """

get_element_module_properties_for_element(element)

get element module properties for element

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
element_module_properties

elmement module properties

Source code in element_controller/__init__.py
def get_element_module_properties_for_element(element: int) -> element_module_properties:
    """get element module properties for element

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        element_module_properties: elmement module properties
    """

get_element_raw_interface_vertices(first_element, second_element)

get element raw interface vertices

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required
element int

element ID

required

Returns:

Type Description
List[point_3d]

vertice list

Source code in element_controller/__init__.py
def get_element_raw_interface_vertices(first_element: int, second_element: int) -> List[point_3d]:
    """get element raw interface vertices

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID
        element (int): element ID

    Returns:
        List[point_3d]: vertice list
    """

get_element_type_description(element)

get the description of the cadwork element type

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
str

element type (e.g. beam)

Source code in element_controller/__init__.py
def get_element_type_description(element: int) -> str:
    """get the description of the cadwork element type

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        str: element type (e.g. beam)
    """

get_export_solid_content_elements(element)

get export solid content elements

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID of export solid

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def get_export_solid_content_elements(element: int) -> List[int]:
    """get export solid content elements

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID of export solid
    Returns:
        List[int]: element IDs
    """

get_inactive_all_identifiable_element_ids()

Get inactive cadwork element IDs

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_inactive_all_identifiable_element_ids() -> List[int]:
    """Get inactive cadwork element IDs

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

get_inactive_visible_identifiable_element_ids()

Get inactive visible cadwork element IDs

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_inactive_visible_identifiable_element_ids() -> List[int]:
    """Get inactive visible cadwork element IDs

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

get_invisible_identifiable_element_ids()

Get invisible cadwork element IDs

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_invisible_identifiable_element_ids() -> List[int]:
    """Get invisible cadwork element IDs

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

get_nesting_parent_id(element)

get nesting parent id

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def get_nesting_parent_id(element: int) -> int:
    """get nesting parent id

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        int: element ID
    """

get_opening_variant_ids(elements, opening_type)

get opening variant ids

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
opening_type int

number of opening type (enum)

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def get_opening_variant_ids(elements: List[int], opening_type: int) -> List[int]:
    """get opening variant ids

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        elements (List[int]): element IDs
        opening_type (int): number of opening type (enum)

    Returns:
        List[int]: element IDs
    """

get_parent_container_id(element)

get parent container id

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def get_parent_container_id(element: int) -> int:
    """get parent container id

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        int: element ID
    """

get_reference_element(element)

Get reference element

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
int

element ID

Source code in element_controller/__init__.py
def get_reference_element(element: int) -> int:
    """Get reference element

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        int: element ID
    """

get_standard_beam_list()

Get standard beam list

ℹ Available for script filled attributes

Returns:

Type Description
List[str]

standard beam names

Source code in element_controller/__init__.py
def get_standard_beam_list() -> List[str]:
    """Get standard beam list

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[str]: standard beam names
    """

get_standard_container_list()

get list of standard container names

ℹ Available for script filled attributes

Returns:

Type Description
List[str]

names

Source code in element_controller/__init__.py
def get_standard_container_list() -> List[str]:
    """get list of standard container names

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[str]: names
    """

get_standard_export_solid_list()

get list of standard export solid names

ℹ Available for script filled attributes

Returns:

Type Description
List[str]

names

Source code in element_controller/__init__.py
def get_standard_export_solid_list() -> List[str]:
    """get list of standard export solid names

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[str]: names
    """

get_standard_panel_list()

Get standard panel list

ℹ Available for script filled attributes

Returns:

Type Description
List[str]

standard panel names

Source code in element_controller/__init__.py
def get_standard_panel_list() -> List[str]:
    """Get standard panel list

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[str]: standard panel names
    """

get_user_element_ids()

prompt that user select element IDs in 3D

Returns:

Type Description
List[int]

elmement ids from selection

Source code in element_controller/__init__.py
def get_user_element_ids() -> List[int]:
    """prompt that user select element IDs in 3D

    Returns:
        List[int]: elmement ids from selection
    """

get_user_element_ids_with_existing(elements)

Source code in element_controller/__init__.py
def get_user_element_ids_with_existing(elements: List[int]) -> List[int]:
    """
    """

get_variant_sibling_element_ids(element)

get variant sibling element IDs

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def get_variant_sibling_element_ids(element: int) -> List[int]:
    """get variant sibling element IDs

    [:information_source: Available for script filled attributes](#){.mark-text}

    Args:
        element (int): element ID

    Returns:
        List[int]: element IDs
    """

get_visible_identifiable_element_ids()

get all visible identifiable elemnt ids

ℹ Available for script filled attributes

Returns:

Type Description
List[int]

element_id list

Source code in element_controller/__init__.py
def get_visible_identifiable_element_ids() -> List[int]:
    """get all visible identifiable elemnt ids

    [:information_source: Available for script filled attributes](#){.mark-text}

    Returns:
        List[int]: element_id list
    """

glide_elements(elements, glide_point)

glide elements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
glide_point point_3d

a glide point

required
Source code in element_controller/__init__.py
def glide_elements(elements: List[int], glide_point: point_3d) -> None:
    """glide elements

    Args:
        elements (List[int]): element IDs
        glide_point (point_3d): a glide point
    """

join_elements(elements)

join elements (group)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def join_elements(elements: List[int]) -> None:
    """join elements (group)

    Args:
        elements (List[int]): element IDs
    """

join_top_level_elements(elements)

join elements on highest leve. Previously joined elements are dissolved and joined at the top level.

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def join_top_level_elements(elements: List[int]) -> None:
    """join elements on highest leve. Previously joined elements are dissolved and joined at the top level.

    Args:
        elements (List[int]): element IDs
    """

make_redo()

make redo

Source code in element_controller/__init__.py
def make_redo() -> None:
    """make redo
    """

make_undo()

make undo

Source code in element_controller/__init__.py
def make_undo() -> None:
    """make undo
    """

mirror_copy_elements(elements, plane_definition, plane_distance)

mirror elements (copy)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
plane_definition point_3d

mirror plane

required
plane_distance float

perp. distance from origin to plane

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def mirror_copy_elements(elements: List[int], plane_definition: point_3d, plane_distance: float) -> List[int]:
    """mirror elements (copy)

    Args:
        elements (List[int]): element IDs
        plane_definition (point_3d): mirror plane
        plane_distance (float): perp. distance from origin to plane

    Returns:
        List[int]: element IDs
    """

mirror_move_elements(elements, plane_definition, plane_distance)

mirror elements (no copy)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
plane_definition point_3d

mirror plane

required
plane_distance float

perp. distance from origin to plane

required
Source code in element_controller/__init__.py
def mirror_move_elements(elements: List[int], plane_definition: point_3d, plane_distance: float) -> None:
    """mirror elements (no copy)

    Args:
        elements (List[int]): element IDs
        plane_definition (point_3d): mirror plane
        plane_distance (float): perp. distance from origin to plane
    """

move_element(elements, vector)

move element by a vector

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
vector point_3d

vector

required
Source code in element_controller/__init__.py
def move_element(elements: List[int], vector: point_3d) -> None:
    """move element by a vector

    Args:
        elements (List[int]): element IDs
        vector (point_3d): vector
    """

move_element_with_undo(elements, aVector)

Move elements and add 'step' to undo memory.

Examples: >>> import element_controller as ec >>> import geometry_controller as gc >>> import cadwork >>> element_ids = ec.get_active_identifiable_element_ids() >>> ec.move_element_with_undo(element_ids, gc.get_yl(*element_ids) * 1500.)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
aVector point_3d

a Target

required
Source code in element_controller/__init__.py
def move_element_with_undo(elements: List[int], aVector: point_3d) -> None:
    """Move elements and add 'step' to undo memory.

     Examples:
        >>> import element_controller as ec
        >>> import geometry_controller as gc
        >>> import cadwork
        >>> element_ids = ec.get_active_identifiable_element_ids()
        >>> ec.move_element_with_undo(element_ids, gc.get_yl(*element_ids) * 1500.)

    Args:
        elements (List[int]): element IDs
        aVector (point_3d): a Target
    """

parts_situation_manual(element, addChilds, removeChilds)

Parameters:

Name Type Description Default
element int

element ID

required
addChilds List[int]

add childs

required
removeChilds List[int]

remove childs

required
Source code in element_controller/__init__.py
def parts_situation_manual(element: int, addChilds: List[int], removeChilds: List[int]) -> None:
    """

    Args:
        element (int): element ID
        addChilds (List[int]): add childs
        removeChilds (List[int]): remove childs
    """

recreate_elements(elements)

recreate elements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def recreate_elements(elements: List[int]) -> None:
    """recreate elements

    Args:
        elements (List[int]): element IDs
    """

rotate_elements(elements, origin, rotation_axis, rotation_angle)

rotate elements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
origin point_3d

element origin (p1)

required
rotation_axis point_3d

vector axis

required
rotation_angle float

radians

required
Source code in element_controller/__init__.py
def rotate_elements(elements: List[int], origin: point_3d, rotation_axis: point_3d, rotation_angle: float) -> None:
    """rotate elements

    Args:
        elements (List[int]): element IDs
        origin (point_3d): element origin (p1)
        rotation_axis (point_3d): vector axis
        rotation_angle (float): radians
    """

rough_volume_situation_manual(element, addPartner, removePartner)

Parameters:

Name Type Description Default
element int

element ID

required
addPartner List[int]

add partner

required
removePartner List[int]

remove partner

required
Source code in element_controller/__init__.py
def rough_volume_situation_manual(element: int, addPartner: List[int], removePartner: List[int]) -> None:
    """

    Args:
        element (int): element ID
        addPartner (List[int]): add partner
        removePartner (List[int]): remove partner
    """

set_container_contents(container_id, elements)

set container contents

Parameters:

Name Type Description Default
solid_id int

element ID

required
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def set_container_contents(container_id: int, elements: List[int]) -> None:
    """set container contents

    Args:
        solid_id (int): element ID
        elements (List[int]): element IDs
    """

set_element_detail_path(path)

set element detail path

Parameters:

Name Type Description Default
path str

path to elementmodule directory

required
Source code in element_controller/__init__.py
def set_element_detail_path(path: str) -> None:
    """set element detail path

    Args:
        path (str): path to elementmodule directory
    """

set_element_module_properties_for_elements(elements, properties)

set element module properties for elements

Examples:

>>> import cadwork as cw
>>> import element_controller as ec
>>> element_properties = ec.get_element_module_properties_for_element(540915) # 540915 = some element ID
>>> cw.element_module_properties.set_bottom_plate(element_properties, True)
>>> cw.element_module_properties.set_solder_in_axis_direction(element_properties, True)
>>> cw.element_module_properties.set_main_element(element_properties, True)
>>> cw.element_module_properties.set_strecht_according_thickness_axis(element_properties, True)
>>> ec.set_element_module_properties_for_elements([540915],element_properties)
None

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
properties element_module_properties

elment module properties

required
Source code in element_controller/__init__.py
def set_element_module_properties_for_elements(elements: List[int], properties: element_module_properties) -> None:
    """set element module properties for elements

    Examples:
        >>> import cadwork as cw
        >>> import element_controller as ec
        >>> element_properties = ec.get_element_module_properties_for_element(540915) # 540915 = some element ID
        >>> cw.element_module_properties.set_bottom_plate(element_properties, True)
        >>> cw.element_module_properties.set_solder_in_axis_direction(element_properties, True)
        >>> cw.element_module_properties.set_main_element(element_properties, True)
        >>> cw.element_module_properties.set_strecht_according_thickness_axis(element_properties, True)
        >>> ec.set_element_module_properties_for_elements([540915],element_properties)
        None

    Args:
        elements (List[int]): element IDs
        properties (element_module_properties): elment module properties
    """

set_export_solid_contents(solid_id, elements)

set export solid contents

Parameters:

Name Type Description Default
solid_id int

element ID of export solid

required
elements List[int]

element IDs to assign

required
Source code in element_controller/__init__.py
def set_export_solid_contents(solid_id: int, elements: List[int]) -> None:
    """set export solid contents

    Args:
        solid_id (int): element ID of export solid
        elements (List[int]): element IDs to assign
    """

set_line_to_marking_line(elements)

modify a line to a marking line

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def set_line_to_marking_line(elements: List[int]) -> None:
    """modify a line to a marking line

    Args:
        elements (List[int]): element IDs
    """

set_line_to_normal_line(elements)

set line to normal line

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def set_line_to_normal_line(elements: List[int]) -> None:
    """set line to normal line

    Args:
        elements (List[int]): element IDs
    """

set_parent_opening_variants_opening_angle(elements, angle)

set parent opening variants opening angle

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
angle float

radians

required
Source code in element_controller/__init__.py
def set_parent_opening_variants_opening_angle(elements: List[int], angle: float) -> None:
    """set parent opening variants opening angle

    Args:
        elements (List[int]): element IDs
        angle (float): radians
    """

slice_element_with_plane(element, cut_plane_normal_vector, distance_from_global_origin)

slice an elment with a plane

Parameters:

Name Type Description Default
element int

element ID

required
cut_plane_normal_vector point_3d

plane normal vector

required
distance_from_global_origin float

distance from origin to plane

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def slice_element_with_plane(element: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: float) -> bool:
    """slice an elment with a plane

    Args:
        element (int): element ID
        cut_plane_normal_vector (point_3d): plane normal vector
        distance_from_global_origin (float): distance from origin to plane

    Returns:
        bool: true/false
    """

slice_elements_with_plane_and_get_new_elements(element, cut_plane_normal_vector, distance_from_global_origin)

slice elments in two with a cutting plane.

Parameters:

Name Type Description Default
element int

element ID

required
cut_plane_normal_vector point_3d

plane normal vector

required
distance_from_global_origin float

distance from origin to plane

required

Returns:

Type Description
bool

true/false

Source code in element_controller/__init__.py
def slice_elements_with_plane_and_get_new_elements(element: int, cut_plane_normal_vector: point_3d, distance_from_global_origin: point_3d) -> List[int]:
    """slice elments in two with a cutting plane.

    Args:
        element (int): element ID
        cut_plane_normal_vector (point_3d): plane normal vector
        distance_from_global_origin (float): distance from origin to plane

    Returns:
        bool: true/false
    """

solder_elements(elements)

solder elements, if they are in contact.

Parameters:

Name Type Description Default
elements List[int]

element IDs

required

Returns:

Type Description
List[int]

element ID

Source code in element_controller/__init__.py
def solder_elements(elements: List[int]) -> List[int]:
    """solder elements, if they are in contact. 

    Args:
        elements (List[int]): element IDs

    Returns:
        List[int]: element ID
    """

split_elements(elements)

split joined elmements

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in element_controller/__init__.py
def split_elements(elements: List[int]) -> None:
    """split joined elmements

    Args:
        elements (List[int]): element IDs
    """

start_element_module_calculation(elements)

start the elemend module calculation. Inputarguments are cover elements.

Parameters:

Name Type Description Default
elements List[int]

element IDs (cover(s) architectural elementtypes)

required
Source code in element_controller/__init__.py
def start_element_module_calculation(elements: List[int]) -> None:
    """start the elemend module calculation. Inputarguments are cover elements. 

    Args:
        elements (List[int]): element IDs (cover(s) architectural elementtypes)
    """

stretch_end_facet(elements, stretch_vector)

stretch end facet of element(s)

Parameters:

Name Type Description Default
elements List[int]

element ID

required
stretch_vector point_3d

vector

required
Source code in element_controller/__init__.py
def stretch_end_facet(elements: List[int], stretch_vector: point_3d) -> None:
    """stretch end facet of element(s)

    Args:
        elements (List[int]): element ID
        stretch_vector (point_3d): vector
    """

stretch_start_facet(elements, stretch_vector)

stretch start facet of element(s)

Parameters:

Name Type Description Default
elements List[int]

element ID

required
stretch_vector point_3d

vector

required
Source code in element_controller/__init__.py
def stretch_start_facet(elements: List[int], stretch_vector: point_3d) -> None:
    """stretch start facet of element(s)

    Args:
        elements (List[int]): element ID
        stretch_vector (point_3d): vector
    """

subtract_elements(hard_elements, soft_elements)

Subtract elements. The first element is hard, the second soft.

Parameters:

Name Type Description Default
hard_elements List[int]

subtract with

required
soft_elements List[int]

subtract from

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def subtract_elements(hard_elements: List[int], soft_elements: List[int]) -> List[int]:
    """Subtract elements. The first element is hard, the second soft.

    Args:
        hard_elements (List[int]): subtract with
        soft_elements (List[int]): subtract from

    Returns:
        List[int]: element IDs
    """

subtract_elements_with_undo(hard_elements, soft_elements, with_undo)

Subtract elements with undo. The first element is hard, the second soft.

Parameters:

Name Type Description Default
hard_elements List[int]

subtract with

required
soft_elements List[int]

subtract from

required
with_undo bool

with undo

required

Returns:

Type Description
List[int]

element IDs

Source code in element_controller/__init__.py
def subtract_elements_with_undo(hard_elements: List[int], soft_elements: List[int], with_undo: bool) -> List[int]:
    """Subtract elements with undo. The first element is hard, the second soft.

    Args:
        hard_elements (List[int]): subtract with
        soft_elements (List[int]): subtract from
        with_undo (bool): with undo

    Returns:
        List[int]: element IDs
    """