compas_cadwork.utilities
¤
Classes¤
IFCExportSettings
dataclass
¤
IFCExportSettings(grouping_type: ElementGroupingType = NONE, export_cover_geometry: bool = False, translate_local_frame: bool = False)
Represents settings for the ifc export.
Attributes:
-
grouping_type(:class:`ElementGroupingType`, optional) –Which element grouping type should be considered when exporting (e.g. group, subgroup)
-
export_cover_geometry((bool, optional)) –True if cover geometry should be exported, False otherwise.
-
translate_local_frame((bool, optional)) –If True, the local frame of the elements will be translated on export to the global frame set with
utility_controller.set_global_origin.
-
API Reference
utilities ClassesIFCExporter
IFCExporter
¤
IFCExporter(settings: IFCExportSettings | None = None)
Functions:¤
activate_elements
¤
Activates the given elements in the cadwork viewport.
Parameters:
-
elements(list(:class:`compas_cadwork.datamodel.Element` or int)) –List of elements or element ids to activate.
disable_autorefresh
¤
Disables the automatic refresh of the cadwork viewport.
enable_autorefresh
¤
Enables the automatic refresh of the cadwork viewport.
get_active_elements
¤
Returns the currently selected elements in the cadwork viewport.
Returns:
-
list(:class:`compas_cadwork.datamodel.Element`)–List of currently selected elements.
get_all_element_ids
¤
get_all_elements
¤
Returns all element ids of the currently open cadwork document.
Parameters:
-
include_instructions(bool, default:False) –If True, also include instruction elements in the result.
Returns:
-
generator(:class:`compas_cadwork.datamodel.Element`)–Generator of elements.
get_all_elements_with_attrib
¤
Returns a generator containing all elements with the given user attribute set to the given value.
Parameters:
-
attrib_number(int) –The user attribute number to filter by.
-
attrib_value(str, default:None) –The value the user attribute should have.
Returns:
-
generator(:class:`compas_cadwork.datamodel.Element`)–Generator of elements
get_bounding_box_from_cadwork_object
¤
Returns the 8 vertices of an elements bounding box.
Parameters:
-
element(int or :class:`compas_cadwork.datamodel.Element`) –The element id or Element object.
Returns:
-
list(:class:`compas.geometry.Point`)–
get_element_groups
¤
get_element_groups(is_wall_frame: bool = True) -> dict[str, ElementGroup]
Returns a dictionary mapping names of the available building subgroups to their elements.
Parameters:
-
is_wall_frame(bool, default:True) –If True, only wall groups which contain a wall frame elements are returned, otherwise all groups are returned.
Returns:
-
dict(str, :class:`~compas_cadwork.datamodel.ElementGroup`)–Dictionary of building group names mapped to an instance of ElementGroup.
get_element_groups_from_selection
¤
get_element_groups_from_selection(is_wall_frame: bool = True) -> dict[str, ElementGroup]
Return a dictionary of ElementGroups built from the currently selected elements.
get_plugin_home
¤
get_plugin_home() -> str
Returns the home root directory of the currently running plugin
get_user_point
¤
Prompts the user to select a cadwork point in the viewport and returns the coordinates of the selected point.
Returns:
-
class:`~compas.geometry.Point`–
hide_elements
¤
Hides the given elements in the cadwork viewport.
Parameters:
-
elements(list(:class:`compas_cadwork.datamodel.Element` or int)) –List of elements or element ids to hide.
is_cadwork_window_in_dark_mode
¤
is_cadwork_window_in_dark_mode() -> bool
Returns true if cadwork is in dark_mode and false if not.
lock_elements
¤
Locks the given elements in the cadwork viewport.
Parameters:
-
elements(list(:class:`compas_cadwork.datamodel.Element` or int)) –List of elements or element ids to lock.
remove_elements
¤
Removes the given elements from the cadwork document.
Parameters:
-
elements(list(:class:`compas_cadwork.datamodel.Element` or int)) –List of elements or element ids to remove.
unlock_elements
¤
Unlocks the given elements in the cadwork viewport.
Parameters:
-
elements(list(:class:`compas_cadwork.datamodel.Element` or int)) –List of elements or element ids to unlock.