Sample Code Revit Batch Processor 1.1.11 documentation
Gets all CAD link types in a model. Filters by class. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of CAD link types :rtype: Autodesk.Revit.DB.FilteredElementCollector
Gets all CAD link instances in a model. Filters by class. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of import instances :rtype: Autodesk.Revit.DB.FilteredElementCollector
Gets all CAD imports in a model. Filters by class and check whether the element is an external file reference (True its a link, False it is an import) :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of all CAD imports in a model. :rtype: list Autodesk.Revit.DB.CADLinkType
Returns two lists: First one: cad links types linked by view (2D) , second one cad link types linked into model (3D). :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: Two lists of cad link types. :rtype: list Autodesk.Revit.DB.CADLinkType, list Autodesk.Revit.DB.CADLinkType
Gets all CAD links by view in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: Lists of cad link types. :rtype: list Autodesk.Revit.DB.CADLinkType
Gets all CAD links by model in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: Lists of cad link types. :rtype: list Autodesk.Revit.DB.CADLinkType
Deletes all CAD links in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: Result class instance.
.status True if all CAD links got deleted. Otherwise False.
.message will contain status of deletion.
Reloads CAD links from a given file location based on the original link type name (starts with comparison)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
link_locations (list str) – A list of directories where CAD files can be located.
host_name_formatted (TBC) – Not used yet
do_something_with_link_name (func(str) -> str) – A function which amends the link name prior search for a match in folders. I.e. can be used to truncate the link name i.e. the revision details of a link
Result class instance.
.status True if all CAD links got reloaded successfully. Otherwise False.
.message will contain status of reload and fully qualified file name. On exception it will also include the exception message.
Returns a list of geometry elements from an import instance :param import_instance: A import instance :type import_instance: AutoDesk.Revit.DB.ImportInstance :return: A list of geometry objects. Can return an empty list! :rtype: [Autodesk.Revit.DB GeometryObject]
Returns a list of geometry elements from all import instances in the document. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of geometry objects. Can return an empty list! :rtype: [Autodesk.Revit.DB GeometryObject]
Gets all image link types and image link instances in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of image types. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Gets all image link type Ids and image link instance ids in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of ids representing image types and image instances. :rtype: list Autodesk.Revit.DB.ElementId
Returns two lists: First one: images linked into model, second one images saved into model from model itself (no external file reference) :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: Two lists of image types and instances (?) :rtype: list Autodesk.Revit.DB.ImageType, list Autodesk.Revit.DB.ImageType
Gets all image link types which are links (external referenced) in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of image types and instances (?) :rtype: list Autodesk.Revit.DB.ImageType
Gets all image link types which are imported (not an external reference) in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of image types and instances (?) :rtype: list Autodesk.Revit.DB.ImageType
Gets all image types in a model. Filters by category. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of image types. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Gets all image instances placed in a model. Filters by category. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of image instances. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Gets all Revit link instances in a model.
Filters by class.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector of revit link instances.
Autodesk.Revit.DB.FilteredElementCollector
Gets all Revit link types in a model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector of revit link types.
Autodesk.Revit.DB.FilteredElementCollector
Gets the Revit link type from a given revit link instance.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
link_instance (Autodesk.Revit.DB.RevitLinkInstance) – The link instance the type of is to be returned
The matching revit link type.
Autodesk.Revit.DB.RevitLinkType
Gets the link documents for the specified link names.
doc (Autodesk.Revit.DB.Document) – The current Revit model document.
link_names_filter (list[str]) – A list of link names to filter. Default is an empty list.
A dictionary mapping link names to their respective link documents.
dict[str, Autodesk.Revit.DB.Document]
Deletes all revit links in a file.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance.
.status True if all revit links got deleted successfully. Otherwise False.
.message will contain deletion status. On exception it will also include the exception message.
Reloads Revit links from a given file location based on the original link type name (starts with comparison)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
link_locations (list str) – A list of directories where CAD files can be located.
host_name_formatted (TBC) – Not used yet
do_something_with_link_name (func(str) -> str) – A function which amends the link name prior search for a match in folders. I.e. can be used to truncate the link name i.e. the revision details of a link
workset_config (Autodesk.Revit.DB.WorksetConfiguration) – To use the previously applied workset config use None, otherwise provide custom config.
Result class instance.
.status True if all revit links got reloaded successfully. Otherwise False.
.message will contain status of reload and fully qualified file name. On exception it will also include the exception message.
Reloads Revit links from a given file location based on the original link type name (starts with comparison)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
link_types_tob_reloaded (list Autodesk.Revit.DB.RevitLinkType) – List of link type elements to be reloaded.
link_locations (list str) – A list of directories where CAD files can be located.
host_name_formatted (TBC) – Not used yet
do_something_with_link_name (func(str) -> str) – A function which amends the link name prior search for a match in folders. I.e. can be used to truncate the link name i.e. the revision details of a link
workset_config (Autodesk.Revit.DB.WorksetConfiguration) – To use the previously applied workset config use None, otherwise provide custom config.
Result class instance.
.status True if all revit links got reloaded successfully. Otherwise False.
.message will contain status of reload and fully qualified file name. On exception it will also include the exception message.
Default ‘do something with link name’ method. Returns the link name unchanged.
Could be replaced with something which i.e. truncates the revision…
name (str) – The link name.
the link name unchanged.
str
Default method returning an ‘open previous worksets’ configuration. (None)
None: which is use the previous workset configuration.
None
Gets all image types with no instances placed in a model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of ids representing image types. :rtype: list Autodesk.Revit.DB.ElementId
Gets all image types with no instance placed in a model but includes group definition check. This only returns valid data if at least one instance of the group is placed in the model!! Otherwise images in groups which are not placed will not be flagged by this filter! :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of ids representing image types. :rtype: list Autodesk.Revit.DB.ElementId