Skip to content

Visualization Controller

get_color(element)

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
number int

element ID

required

Returns:

Type Description
int

color number

Source code in visualization_controller/__init__.py
def get_color(element: int) -> int: 
    """
    [:information_source: Available for script filled attributes](#){.mark-text}


    Args:
        number (int): element ID

    Returns:
        int: color number
    """

get_material(element)

Gets the element material

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
int

material ID

Source code in visualization_controller/__init__.py
def get_material(element: int) -> int: 
    """Gets the element material

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

    Args:
        element (int): element ID

    Returns:
        int: material ID
    """

get_opengl_color(element)

ℹ Available for script filled attributes

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
rgb_color

rgb color

Source code in visualization_controller/__init__.py
def get_opengl_color(element: int) -> rgb_color: 
    """

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

    Args:
        element (int): element ID

    Returns:
        rgb_color: rgb color 
    """

get_rgb_from_cadwork_color_id(color)

Returns RGB color object

Examples:

>>> color = get_rgb_from_cadwork_color_id(5)
>>> color.r
0
>>> color.g
255
>>> color.b
0

Parameters:

Name Type Description Default
color int

color nr

required

Returns:

Type Description
rgb_color

rgb obj

Source code in visualization_controller/__init__.py
def get_rgb_from_cadwork_color_id(color:int) -> rgb_color:
    """Returns RGB color object

    Examples:
        >>> color = get_rgb_from_cadwork_color_id(5)
        >>> color.r
        0
        >>> color.g
        255
        >>> color.b
        0

    Args:
        color (int): color nr

    Returns:
        rgb_color: rgb obj
    """

hide_all_elements()

Hide all elements

Source code in visualization_controller/__init__.py
def hide_all_elements() -> None: 
    """Hide all elements
    """

is_active(element)

Tests if element is active

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
bool

result

Source code in visualization_controller/__init__.py
def is_active(element: int) -> bool: 
    """Tests if element is active

    Args:
        element (int): element ID

    Returns:
        bool: result
    """

is_immutable(element)

ests if the element is immutable

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
bool

result

Source code in visualization_controller/__init__.py
def is_immutable(element: int) -> bool: 
    """ests if the element is immutable

    Args:
        element (int): element ID

    Returns:
        bool: result
    """

is_selectable(element)

Returns if the element is selectable

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
bool

result

Source code in visualization_controller/__init__.py
def is_selectable(element: int) -> bool: 
    """Returns if the element is selectable

    Args:
        element (int): element ID

    Returns:
        bool: result
    """

is_visible(element)

Check if element is visible

Parameters:

Name Type Description Default
element int

element ID

required

Returns:

Type Description
bool

result

Source code in visualization_controller/__init__.py
def is_visible(element: int) -> bool: 
    """Check if element is visible

    Args:
        element (int): element ID

    Returns:
        bool: result
    """

refresh()

Refresh the drawing area

Source code in visualization_controller/__init__.py
def refresh() -> None: 
    """Refresh the drawing area
    """

restore_activation_state(state)

Saves the activation state

Parameters:

Name Type Description Default
state activation_state

activation state

required
Source code in visualization_controller/__init__.py
def restore_activation_state(state: activation_state) -> None: 
    """Saves the activation state

    Args:
        state (activation_state): activation state
    """

restore_visibility_state(state)

Restores the visibility state

Parameters:

Name Type Description Default
state visibility_state

visibility state

required
Source code in visualization_controller/__init__.py
def restore_visibility_state(state: visibility_state) -> None: 
    """Restores the visibility state

    Args:
        state (visibility_state): visibility state
    """

save_activation_state()

summary

Returns:

Type Description
activation_state

description

Source code in visualization_controller/__init__.py
def save_activation_state() -> activation_state: 
    """_summary_

    Returns:
        activation_state: _description_
    """

save_visibility_state()

Saves the visibility state

Returns:

Type Description
visibility_state

visibility state

Source code in visualization_controller/__init__.py
def save_visibility_state() -> visibility_state: 
    """Saves the visibility state

    Returns:
        visibility_state: visibility state
    """

set_active(elements)

Set elements active

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_active(elements: List[int]) -> None: 
    """Set elements active

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

set_color(elements, color)

Examples:

>>> set_color([123456, 234567], 5)

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
color int

color number

required
Source code in visualization_controller/__init__.py
def set_color(elements: List[int], color: int) -> None: 
    """
    Examples:
        >>> set_color([123456, 234567], 5)

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

set_immutable(elements)

Sets the element immutable

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_immutable(elements: List[int]) -> None: 
    """Sets the element immutable

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

set_inactive(elements)

Set elements inactive

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_inactive(elements: List[int]) -> None: 
    """Set elements inactive

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

set_invisible(elements)

Sets the element invisible

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_invisible(elements: List[int]) -> None: 
    """Sets the element invisible

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

set_material(elements, element)

Sets the element material

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
element int

element ID

required
Source code in visualization_controller/__init__.py
def set_material(elements: List[int], element: int) -> None: 
    """Sets the element material

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

set_mutable(elements)

Sets the element mutable

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_mutable(elements: List[int]) -> None: 
    """Sets the element mutable

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

set_opengl_color(element, color)

summary

Parameters:

Name Type Description Default
element int

element ID

required
color rgb_color

rgb color

required
Source code in visualization_controller/__init__.py
def set_opengl_color(element: int, color: rgb_color) -> None: 
    """_summary_

    Args:
        element (int): element ID
        color (rgb_color): rgb color
    """

set_selectable(elements)

Sets a list of elements selectable

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_selectable(elements: List[int]) -> None: 
    """Sets a list of elements selectable

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

set_unselectable(elements)

Sets a list of elements unselectable

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_unselectable(elements: List[int]) -> None: 
    """Sets a list of elements unselectable

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

set_visible(elements)

Sets the element visible

Parameters:

Name Type Description Default
elements List[int]

element IDs

required
Source code in visualization_controller/__init__.py
def set_visible(elements: List[int]) -> None: 
    """Sets the element visible

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

show_all_elements()

Shows all elements

Source code in visualization_controller/__init__.py
def show_all_elements() -> None: 
    """Shows all elements
    """

show_view_dashed_hidden_lines()

Source code in visualization_controller/__init__.py
def show_view_dashed_hidden_lines() -> None: 
    """
    """

show_view_hidden_lines()

Source code in visualization_controller/__init__.py
def show_view_hidden_lines() -> None: 
    """
    """

show_view_negative_x()

Source code in visualization_controller/__init__.py
def show_view_negative_x() -> None: 
    """
    """

show_view_negative_y()

Source code in visualization_controller/__init__.py
def show_view_negative_y() -> None: 
    """
    """

show_view_negative_z()

Source code in visualization_controller/__init__.py
def show_view_negative_z() -> None: 
    """
    """

show_view_positive_x()

Source code in visualization_controller/__init__.py
def show_view_positive_x() -> None: 
    """
    """

show_view_positive_y()

Source code in visualization_controller/__init__.py
def show_view_positive_y() -> None: 
    """
    """

show_view_positive_z()

Source code in visualization_controller/__init__.py
def show_view_positive_z() -> None: 
    """
    """

show_view_shaded1()

Source code in visualization_controller/__init__.py
def show_view_shaded1() -> None: 
    """
    """

show_view_shaded2()

Source code in visualization_controller/__init__.py
def show_view_shaded2() -> None: 
    """
    """

show_view_standard_axo()

Source code in visualization_controller/__init__.py
def show_view_standard_axo() -> None: 
    """
    """

show_view_wireframe()

Source code in visualization_controller/__init__.py
def show_view_wireframe() -> None: 
    """
    """

zoom_active_elements()

zoom only active elements

Source code in visualization_controller/__init__.py
def zoom_active_elements() -> None: 
    """zoom only active elements
    """

zoom_all_elements()

zoom all elements

Source code in visualization_controller/__init__.py
def zoom_all_elements() -> None: 
    """zoom all elements
    """