Pattern

Pattern Wrappers

class rpw.db.LinePatternElement(element, doc=None)

Bases: rpw.db.element.Element, rpw.utils.mixins.ByNameCollectMixin

DB.LinePatternElement Wrapper

Solid, Dash, etc

Attribute:
_revit_object (DB.LinePatternElement): Wrapped DB.LinePatternElement
by_name(name)

Mixin to provide instantiating by a name for classes that are collectible. This is a mixin so specifi usage will vary for each for. This method will call the collect method of the class, and return the first element with a matching Name property. See implementation for more details.

>>> LinePatternElement.by_name('Dash')
<rpw:LinePatternElement name:Dash>
>>> FillPatternElement.by_name('Solid')
<rpw:FillPatternElement name:Solid>
class rpw.db.FillPatternElement(element, doc=None)

Bases: rpw.db.pattern.LinePatternElement

DB.FillPatternElement Wrapper

Solid, Horizontal, Vertical, Diagonal Down, etc

Attribute:
_revit_object (DB.FillPatternElement): Wrapped DB.FillPatternElement
by_name(name)

Mixin to provide instantiating by a name for classes that are collectible. This is a mixin so specifi usage will vary for each for. This method will call the collect method of the class, and return the first element with a matching Name property. See implementation for more details.

>>> LinePatternElement.by_name('Dash')
<rpw:LinePatternElement name:Dash>
>>> FillPatternElement.by_name('Solid')
<rpw:FillPatternElement name:Solid>

Implementation

""" Pattern Wrappers """

from rpw import DB
from rpw.db.element import Element
from rpw.utils.mixins import ByNameCollectMixin


class LinePatternElement(Element, ByNameCollectMixin):
    """
    `DB.LinePatternElement` Wrapper

    Solid, Dash, etc

    Attribute:
        _revit_object (DB.LinePatternElement): Wrapped ``DB.LinePatternElement``
    """

    _revit_object_class = DB.LinePatternElement
    _collector_params = {'of_class': _revit_object_class, 'is_type': False}

    def __repr__(self):
        return Element.__repr__(self, data={'name': self.Name})


class FillPatternElement(LinePatternElement):
    """
    `DB.FillPatternElement` Wrapper

    Solid, Horizontal, Vertical, Diagonal Down, etc

    Attribute:
        _revit_object (DB.FillPatternElement): Wrapped ``DB.FillPatternElement``
    """

    _revit_object_class = DB.FillPatternElement
    _collector_params = {'of_class': _revit_object_class, 'is_type': False}