revitron.link¶
This submodule contains wrapper classes for links used in Revit models.
Classes:
|
A wrapper class for Revit links. |
- class LinkRvt(element)[source]¶
Bases:
Element
A wrapper class for Revit links.
Methods:
__getattr__
(name)Define default method to be returned on attribute errors.
__init__
(element)Inits a new element instance.
delete
()Delete an element.
get
(paramName)Returns a parameter value.
getBbox
()Returns a bounding box for the element.
Returns the category name of the element.
Returns the class name of the element.
getDependent
([filterClass])Returns a list of dependent elements.
Returns the family name of the element.
Returns the family name of the element.
getFromType
(paramName)Returns a parameter value of the element type.
Return the Revitron Geometry instance for this element.
getParameter
(paramName)Returns a parameter object.
getPath
()Gets the path of the linked document.
getTags
()Get possibly existing tags of an element.
getType
()Gets the type object of the link.
Checks whether an element is owned by another user.
isType
()Checks whether an element is a type or not.
set
(paramName, value[, paramType])Sets a parameter value.
Attributes:
The actual Revit element.
- __getattr__(name)¶
Define default method to be returned on attribute errors.
Since this is a generic element class that is extended by other more specialized classes such as the
Room
class, a default method along with an error message is returned when accidently calling a special methods that only exists in one of the derived classes on an element of another class.- Parameters
name (string) – The name of the called method
- Returns
An empty method
- Return type
method
- __init__(element)¶
Inits a new element instance.
- Parameters
element (object) – The Revit element or an element ID
- delete()¶
Delete an element.
Example:
_(element).delete()
- property element¶
The actual Revit element.
- Returns
The Revit element object
- Return type
object
- get(paramName)¶
Returns a parameter value.
Example:
value = _(element).get('name')
- Parameters
paramName (string) – The name of the parameter
- Returns
The parameter value
- Return type
mixed
- getBbox()¶
Returns a bounding box for the element.
- Returns
The bounding box or false on error
- Return type
object
- getCategoryName()¶
Returns the category name of the element.
- Returns
The category name
- Return type
string
- getClassName()¶
Returns the class name of the element.
- Returns
The class name
- Return type
string
- getDependent(filterClass=None)¶
Returns a list of dependent elements.
- Parameters
filterClass (class, optional) – An optional class to filter the list of dependent elements by. Defaults to None.
- Returns
The list with the dependent Revit elements.
- Return type
list
- getFamilyAndTypeName()¶
Returns the family name of the element.
- Returns
The family name
- Return type
string
- getFamilyName()¶
Returns the family name of the element.
- Returns
The family name
- Return type
string
- getFromType(paramName)¶
Returns a parameter value of the element type.
Example:
value = _(element).getFromType('name')
- Parameters
paramName (string) – The name of the parameter
- Returns
The parameter value
- Return type
mixed
- getGeometry()¶
Return the Revitron Geometry instance for this element.
- Returns
A Revitron Geometry object
- Return type
object
- getParameter(paramName)¶
Returns a parameter object.
- Parameters
paramName (string) – The name of the parameter
- Returns
The parameter object
- Return type
object
- getPath()[source]¶
Gets the path of the linked document.
- Returns
The path on disk
- Return type
string
- getTags()¶
Get possibly existing tags of an element.
- Returns
A list of Revit tag objects depending on the element class
- Return type
list
- isNotOwned()¶
Checks whether an element is owned by another user.
- Returns
True if the element is not owned by another user.
- Return type
boolean
- isType()¶
Checks whether an element is a type or not.
- Returns
True if element is a type.
- Return type
bool
- set(paramName, value, paramType=False)¶
Sets a parameter value.
Example:
_(element).set('name', 'value', 'type')
Some possible parameter types are:
Text
Integer
Number
Length
Angle
Material
YesNo
MultilineText
FamilyType
You can find a list of all types here.
- Parameters
paramName (string) – The parameter name
value (mixed) – The value
paramType (string, optional) – The parameter type. Defaults to ‘Text’.
- Returns
The element instance
- Return type
object