Sample Code Revit Batch Processor 1.1.11 documentation
Returns a dictionary with keys: Projection, Cut, 3D and their respective ids :param cat: A category. :type cat: Autodesk.REvit.DB.Category :return: A dictionary :rtype: dictionary {str: Autodesk.Revit.DB.ElementId}
Returns the material properties name and id as a dictionary where key is property name and value the property id. :param cat: A category. :type cat: Autodesk.REvit.DB.Category :return: A dictionary :rtype: dictionary {str: Autodesk.Revit.DB.ElementId} If no material is assigned to a category it will return {‘None: Autodesk.Revit.DB.ElementId.InvalidElementId}
Returns the line weight properties (cut and projection) as a dictionary where key is property description and value the property value :param cat: A category. :type cat: Autodesk.Revit.DB.Category :return: A dictionary. :rtype: dictionary {str: nullable integer}
Returns the colour properties (RGB) and values as a dictionary where key is colour name and value the property value :param cat: A category. :type cat: Autodesk.Revit.DB.Category :return: A dictionary. :rtype: dictionary {str: byte}
Returns a dictionary where keys are category property names and value is the associated property value. :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :return: A dictionary. :rtype: list [{str: var}]
Returns property values matching property names in saved category data. :param properties: List of dictionaries in format as per GetCategoryProperties(cat) method. :type properties: list [{str: var}] :param prop_names: List of property names of which the values are to be returned :type prop_names: list str :return: A list of values. :rtype: list var
Updates material property of a given category. :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param material_id: The new material element id. :type material_id: Autodesk.Revit.DB.ElementId :return: True if material property was updated successfully, otherwise False. :rtype: bool
Updates line pattern property of a given category. Note: in cases where the ‘cut’ property does not exist on a sub category this will return false even though the ‘projection’ property will most likely have been updated without a problem… :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param line_pattern_id: The newline pattern element id. :type line_pattern_id: Autodesk.Revit.DB.ElementId :param ignore_missing_cut_style: If true will not flag an exception if applying styles fails on missing cut style. :type ignore_missing_cut_style: bool :return: True if line pattern property was updated successfully, otherwise False. :rtype: bool
Updates line weight properties of a given category. :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param line_thick_ness_cut: The cut line weight. :type line_thick_ness_cut: int :param line_thickness_projection: The projection line weight. :type line_thickness_projection: int :param ignore_missing_cut_style: If true will not flag an exception if applying styles fails on missing cut style. :type ignore_missing_cut_style: bool :return: True if line weight property was updated successfully, otherwise False. :rtype: bool
Updates colour properties of a given category. :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param red: The colour red channel. :type red: byte :param green: The colour green channel. :type green: byte :param blue: The colour blue channel. :type blue: byte :return: True if colour property was updated successfully, otherwise False. :rtype: bool
Updates varies property values of a given category. :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :param properties: List of property values to be applied to category. :type properties: list of dictionaries in format as per GetCategoryProperties(cat) method. :param ignore_missing_cut_style: If true will not flag an exception if applying styles fails on missing cut style. :type ignore_missing_cut_style: bool :return: True if all properties where updated successfully, otherwise False. :rtype: bool
category properties dictionary key names and default values material name
material name default value
material id
line weight projection name
line weight cut name
line colour red name
line colour green name
line colour blue name
graphic styles used for elements in families graphic style projection name
graphic style cut name
graphic style 3D name
Returns a dictionary of element ids where key is the category they belong to. :param elements: List of revit elements. :type elements: [Autodesk.Revit.DB.Element] :param element_dic: Dictionary where key is subcategory and values are element ids. :type element_dic: {Autodesk.Revit.DB.Category: [Autodesk.Revit.DB.ElementId]} :return: Dictionary where key is subcategory id and values are element ids. :rtype: {Autodesk.Revit.DB.ElementId: [Autodesk.Revit.DB.ElementId]}
Sorts geometry elements by their category in a Revit family document.
elements (list): A list of geometry elements to be sorted. element_dic (dict): A dictionary where the sorted elements will be stored. doc (Revit Document): The current Revit family document.
dict: A dictionary where the keys are category ids and the values are lists of element ids. The geometry elements are sorted by their category.
Returns elements in family assigned to a specific category :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param cat: A category. :type cat: Autodesk.Revit.DB.Category :return: Dictionary where key is subcategory and values are element ids. :rtype: {Autodesk.Revit.DB.Category: [Autodesk.Revit.DB.ElementId]}
Moves elements provided in a dictionary to another category specified by name.
doc (Autodesk.Revit.DB.Document) – Current Revit family document.
elements ({Autodesk.Revit.DB.Category: [Autodesk.Revit.DB.ElementId]}) – Dictionary of elements, where keys are graphic style names.
to_category_name (str) – The name of the subcategory elements are to be moved to.
destination_cat_ids (dictionary {str: Autodesk.Revit.DB.ElementId}) – Dictionary of IDs of graphic styles, where keys are graphic style names.
Result class instance. - result.status (bool): True if all elements were moved to destination subcategories, otherwise False. - result.message (str): Contains the name of the destination subcategory by element. - result.result (empty list)
result.status (bool): False.
result.message (str): Contains a generic exception message.
result.result (empty list)
Moves elements from one subcategory to another one identified by their names.
doc (Autodesk.Revit.DB.Document) – Current Revit family document.
from_category_name (str) – The source subcategory name.
to_category_name (str) – The destination subcategory name.
Result class instance. - result.status (bool): True if all elements from the source subcategory were moved to the destination subcategory, otherwise False. - result.message (str): Contains the name of the destination subcategory by element. - result.result (empty list)
result.status (bool): False.
result.message (str): Contains a generic exception message.
result.result (empty list)
Returns all category ids in a family which have an element assigned to them :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :return: List of categories. :rtype: [Autodesk.Revit.DB.Category]