revitron.category¶
To simplify the interaction with Revit categories, the category
submodule provides the Category
and BuiltInCategory
classes in order
to access Revit category objects as well as builtin categories by name.
Classes:
|
A wrapper class for builtin category objects which can be instantiated by name. |
|
A wrapper class for category objects which can be instantiated by a category name. |
- class BuiltInCategory(name)[source]¶
Bases:
object
A wrapper class for builtin category objects which can be instantiated by name.
You can get the Revit BuitlInCategory class object by providing a name as follows:
bic = revitron.BuiltInCategory('OST_Walls').get()
For convenience reasons, it is also valid to skip the
OST_
prefix and simply do:bic = revitron.BuiltInCategory('Walls').get()
In case you only know the natural category name and want to get the BuiltInCategory instead, you can also use that one. For example to get the
OST_BeamAnalyticalTags
BuiltInCategory, you can do simply:bic = revitron.BuiltInCategory('Analytical Beam Tags').get()
A full list of category names can be found here.
Methods:
__init__
(name)Get the BuiltInCategory by its name, its name without the
OST_
prefix or even its natural category name.get
()Return the BuiltInCategory class.
- __init__(name)[source]¶
Get the BuiltInCategory by its name, its name without the
OST_
prefix or even its natural category name. A full list of category names can be found here.Example:
bic = revitron.BuiltInCategory('OST_Walls').get() bic = revitron.BuiltInCategory('Walls').get()
Use the natural name to get for example
OST_BeamAnalyticalTags
:bic = revitron.BuiltInCategory('Analytical Beam Tags').get()
- Parameters
name (name) – The name, the name without the
OST_
prefix or even the natural category name
- class Category(name)[source]¶
Bases:
object
A wrapper class for category objects which can be instantiated by a category name.
You can get the Revit Category class object by providing a name as follows:
category = revitron.Category('name').get()
Methods:
__init__
(name)Init a new Category by name.
get
()Returns the category object.
getBic
()Returns the built-in category for a given category.