ifcopenshell.api.grid
¶
Manages grid and grid axes
A grid in IFC may contain two or more axes running in two or more directions.
Submodules¶
Package Contents¶
- ifcopenshell.api.grid.create_grid_axis(file: ifcopenshell.file, grid: ifcopenshell.entity_instance, axis_tag: str = 'A', same_sense: bool = True, uvw_axes: Literal['UAxes', 'VAxes', 'WAxes'] = 'UAxes') ifcopenshell.entity_instance ¶
Adds a new grid axis to a grid
An IFC grid will typically have a minimum of two axes which will be perpendicular to one another. Grids may be rectangular (typically perpendicular lines), radial (where one set of axes is a circle and the other is a line), or triangular (three sets of axes, each at a different angle to one another).
For a simple rectangular grid, the “UAxes” are a set of one or more horizontal axes, which are typically labeled with the convention of A, B, C, etc. The “VAxes” is another set of one or more vertical axes, typically labeled with the convention of 1, 2, 3, etc. These axes are horizontal or vertical relative to project north.
For a radial grid, the “UAxes” are straight lines, typically radiating from a central point. The “VAxes” are circular perimeters, with the center of these circles being the same central point.
For a triangular grid, the UAxes, VAxes, and WAxes are all sets of one or more straight lines.
- Parameters:
axis_tag (str, optional) – The name of the axis, that would typically be labeled on drawings or described on site during coordination, such as A, B, C, 1, 2, 3, etc. Defaults to “A”.
same_sense (bool, optional) – Determines whether the direction of the axis’s line is reversed. True means the direction the geometry is defined in represents the direction of the axis. False means the direction is reversed. Leave as True if unsure. Defaults to “True”.
uvw_axes (str, optional) – Choose from “UAxes”, “VAxes” or “WAxes” depending on which set of axes the new axis you are adding should belong to. Defaults to “UAxes”.
grid (ifcopenshell.entity_instance) – The IfcGrid you are adding the axis to.
- Returns:
The newly created IfcGridAxis
- Return type:
ifcopenshell.entity_instance
Example:
# A pretty standard rectangular grid, with only two axes. grid = ifcopenshell.api.root.create_entity(model, ifc_class=”IfcGrid”) axis_a = ifcopenshell.api.grid.create_grid_axis(model,
axis_tag=”A”, uvw_axes=”UAxes”, grid=grid)
- axis_1 = ifcopenshell.api.grid.create_grid_axis(model,
axis_tag=”1”, uvw_axes=”VAxes”, grid=grid)
- ifcopenshell.api.grid.remove_grid_axis(file: ifcopenshell.file, axis: ifcopenshell.entity_instance) None ¶
Removes a grid axis from a grid
- Parameters:
axis (ifcopenshell.entity_instance) – The IfcGridAxis you want to remove.
- Returns:
None
- Return type:
None
Example:
# A pretty standard rectangular grid, with only two axes. grid = ifcopenshell.api.root.create_entity(model, ifc_class=”IfcGrid”) axis_a = ifcopenshell.api.grid.create_grid_axis(model,
axis_tag=”A”, uvw_axes=”UAxes”, grid=grid)
- axis_1 = ifcopenshell.api.grid.create_grid_axis(model,
axis_tag=”1”, uvw_axes=”VAxes”, grid=grid)
# Let’s create a third so we can remove it later axis_2 = ifcopenshell.api.grid.create_grid_axis(model,
axis_tag=”2”, uvw_axes=”VAxes”, grid=grid)
# Let’s remove it! ifcopenshell.api.grid.remove_grid_axis(model, axis=axis_2)