Sample Code Revit Batch Processor 1.1.15 documentation
These functions work within a Revit family document to create and manipulate extrusions.
Create a new extrusion in the family document using the provided curve loops.
doc (Autodesk.Revit.DB.Document) – The family document.
sketch_plane (Autodesk.Revit.DB.SketchPlane) – The sketch plane to use for the new extrusion.
curve_loops (list of Autodesk.Revit.DB.CurveLoop) – The curve loops to use for the new extrusion.
func (function) – A function to execute on the new extrusion. ( need to take the doc and the new extrusion as arguments and need to return a Result class instance)
transaction_manager (function) – A function to manage transactions. (default is in_transaction)
Result class instance.
result.status (bool): True if the extrusion was created successfully, otherwise False.
result.message (str): Confirmation of successful creation of the extrusion.
result.result (list): The new extrusion element.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Create a new extrusion in the family document on the level provided using the provided curve loops.
doc (Autodesk.Revit.DB.Document) – The family document.
level (Autodesk.Revit.DB.Level) – The level to use for the new extrusion.
curve_loops (list of Autodesk.Revit.DB.CurveLoop) – The curve loops to use for the new extrusion.
func (function) – A function to execute on the new extrusion. ( need to take the doc and the new extrusion as arguments and need to return a Result class instance)
transaction_manager – A function to manage transactions. (default is in_transaction)
Result class instance.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Set the height parameter of an extrusion to a parameter in the family.
doc (Autodesk.Revit.DB.Document) – The family document.
extrusion (Autodesk.Revit.DB.Extrusion) – The extrusion element.
height_parameter_name (str) – The name of the height parameter in the family.
Result class instance.
result.status (bool): True if the extrusion height parameter was set successfully, otherwise False.
result.message (str): Confirmation of successful setting of the extrusion height parameter.
result.result (list): The new extrusion element.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Set the subcategory of an extrusion in a family document. The subcategory is set to the subcategory of the source 3D graphic style.
doc (Autodesk.Revit.DB.Document) – The family document.
extrusion (Autodesk.Revit.DB.Extrusion) – The extrusion element.
source_graphic_style (Autodesk.Revit.DB.GraphicStyle) – The graphic style of the source extrusion.
Result class instance.
result.status (bool): True if the extrusion subcategory was set successfully, otherwise False.
result.message (str): Confirmation of successful setting of the extrusion subcategory.
result.result (list): Empty.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
These functions work within a Revit family document to create and manipulate symbolic curves.
Create new symbolic curves in the family document using the provided curve loop.
doc (Autodesk.Revit.DB.Document) – The family document.
sketch_plane (Autodesk.Revit.DB.SketchPlane) – The sketch plane to use for the new curve(s).
curve_loop (Autodesk.Revit.DB.CurveLoop) – The curve loop to use for the new curve(s).
func (function) – A function to execute on the new curves. ( need to take the doc and a single new curves as arguments and need to return a Result class instance)
transaction_manager (function) – A function to manage transactions. (default is in_transaction)
Result class instance.
result.status (bool): True if the symbolic curves where created successfully, otherwise False.
result.message (str): Confirmation of successful creation of the symbolic curves.
result.result (list): The new symbolic curve elements.
On exception:
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Create a new symbolic curves in the family document on the level provided using the provided curve loop.
doc (Autodesk.Revit.DB.Document) – The family document.
level (Autodesk.Revit.DB.Level) – The level to use for the new symbolic curves.
curve_loops (Autodesk.Revit.DB.CurveLoop) – The curve loop to use for the new symbolic curves.
func (function) – A function to execute on the new symbolic curves. ( need to take the doc and a new symbolic curve as arguments and need to return a Result class instance)
transaction_manager – A function to manage transactions. (default is in_transaction)
On exception:
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Set the subcategory of an symbolic curve in a family document. The subcategory is set to the subcategory of the source projection graphic style.
doc (Autodesk.Revit.DB.Document) – The family document.
curve (Autodesk.Revit.DB.Curve) – The curve element.
source_graphic_style (Autodesk.Revit.DB.GraphicStyle) – The graphic style of the source curve.
Result class instance.
result.status (bool): True if the curve subcategory was set successfully, otherwise False.
result.message (str): Confirmation of successful setting of the curve subcategory.
result.result (list): Empty.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
These functions work within a Revit family document to create and manipulate elements.
Set the subcategory of an element in a family document. The subcategory is set to the subcategory of the source projection graphic style.
doc (Autodesk.Revit.DB.Document) – The family document.
element (Autodesk.Revit.DB.Element) – The element.
source_graphic_style (Autodesk.Revit.DB.GraphicStyle) – The graphic style of the source curve.
source_graphic_style_key (str) – The key of the graphic style to set. (e.g. “Projection”, “Cut”, “3D”)
Result class instance.
result.status (bool): True if the elements subcategory was set successfully, otherwise False.
result.message (str): Confirmation of successful setting of the elements subcategory.
result.result (list): Empty.
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.
Set the subcategory of a curve in a family document. ( its really the graphic style…) The subcategory is set to the subcategory of the source projection graphic style.
doc (Autodesk.Revit.DB.Document) – The family document.
element (Autodesk.Revit.DB.Element) – The element.
source_graphic_style (Autodesk.Revit.DB.GraphicStyle) – The graphic style of the source curve.
transaction_manager (function) – The transaction manager.
Result class instance. - result.status (bool): True if the elements subcategory was set successfully, otherwise False. - result.message (str): Confirmation of successful setting of the elements subcategory. - result.result (list): Empty.
On exception:
result.status (bool): False.
result.message (str): Generic exception message.
result.result (list): Empty.