Hi, nice to see you on my page. If you are looking for tools that will help you in the daily work of an architect, engineer or designer, you have come to the right place. Below are the latest entries. If you are looking for something specific, you can do so using the search engine or post categories. If you want to know more about me, please visit the "about me" tab. Have you used my solutions? You can return the favour by buy me a virtual coffee using the "Buy me a coffe" button
Hi, nice to see you on my page. If you are looking for tools that will help you in the daily work of an architect, engineer or designer, you have come to the right place. Below are the latest entries. If you are looking for something specific, you can do so using the search engine or post categories. If you want to know more about me, please visit the "about me" tab. Have you used my solutions? You can return the favour by buy me a virtual coffee using the "Buy me a coffe" button
Another function provided by my PYLAB revit add-on. Allows you to batch placing insulation on multiple components in piping systems with just a few clicks.
Below i want to show you how work my PYLAB function for “Revit batch placing insulation”.
Assumptions of the program for revit batch placing insulation
The program was created to improve the work for designers, to enable the insertion of insulation on many elements at the same time, taking into account the thickness of the insulation. If you don’t have the overlay yet, I encourage you to download it. You can find the full instructions in my post PYLAB – Revit free addin.
How program works?
Important! The program in the current version works on models with the [mm] setting
The program runs in the following order:
You choose elements such as pipes, fittings, etc.
You need to choose the type of insulation
The program asks for the insulation thickness for each element. Each query concerns a separate item. Its name and size is contained in the name:
Program ask for insulation thickness
The program generates a list of elements with which it interacted. Thanks to the summary, you can identify on which elements and on which an error occurred. Such a situation may occur when a given element already has insulation or the insulation provided by the user is 0.
The program returns the results. As you can see, the first and last element is already insulated. The second item inserted correctly.
Instructional video
Program code
Below is the program code from the first version of the addin. For more please visit my GitHub, where new versions of the overlay will appear on a regular basis.
Python
from rpw import revit,dbfrom rpw.ui.forms import TextInputfrom Autodesk.Revit.UI.Selection import*from Autodesk.Revit.DB import*from pyrevit import DB, formsdoc = revit.docuidoc = revit.uidoc## Class and defclassCustomISelectionFilter(ISelectionFilter):def__init__(self,nom_categorie):self.nom_categorie = nom_categoriedefAllowElement(self,e):if e.Category.Name inself.nom_categorie:# if self.nom_categorie.Contains(e.Category.Name):#if e.Category.Name == self.nom_categorie:returnTrueelse:returnFalsedefAllowReference(self,ref,point):return truedefPargetstr(element,name):return(element.GetParameters(name))[0].AsValueString()defParget(element,name):return(element.GetParameters(name))[0].AsString()## Picking elementswith forms.WarningBar(title="Pick elements in model[pipes/pipe fittings"): collector = uidoc.Selection.PickObjects(ObjectType.Element,CustomISelectionFilter("Pipes Pipe Fittings"))filter1=ElementCategoryFilter(BuiltInCategory.OST_PipeInsulations)ins_list=FilteredElementCollector(doc).OfClass(ElementType).WherePasses(filter1).ToElements()ins_list_pins=[Element.Name.GetValue(i)for i in ins_list]rops = forms.CommandSwitchWindow.show(ins_list_pins,message='Select Option',recognize_access_key=False)# print(rops)choosen_ins=ins_list[ins_list_pins.index(rops)]# print(choosen_ins)## Get types of elements to ask for insulation thicknesselements=[]elements_type=[]dict={}for i in collector: el=doc.GetElement(i.ElementId) elements.append(el) elements_type.append(el.Name) element_parameters=[]for p in el.Parameters: element_parameters.append(p.Definition.Name)# print("=======")# print(el.Category)# print(el.Category.Name)# print(el.Parameters)try:if el.Category.Name=="Pipes":dict.update({Pargetstr(el,"Family and Type")+""+str(el.Diameter*304.8):0})else:dict.update({Pargetstr(el,"Family and Type")+""+Parget(el,"Overall Size"):0})exceptExceptionas e:print(e)del element_parameters[:]# print(element_parameters)# print(elements)# print(elements_type)# print(dict)## Ask for insulation thicknessfor key indict: t=forms.ask_for_string(prompt='Select Insulation Thickness for {}'.format(key),title="Insulation")dict.update({key:t})# print(dict)transaction =Transaction(doc,'Transaction')transaction.Start()## Set insulation to pipesprint("Results:")for el in elements:try:if el.Category.Name=="Pipes": t=float(dict[Pargetstr(el,"Family and Type")+""+str(el.Diameter*304.8)])/304.8 Plumbing.PipeInsulation.Create(doc,el.Id,choosen_ins.Id,t)print("=====")print(Pargetstr(el,"Family and Type")+""+str(el.Diameter*304.8)+" Id: "+str(el.Id))print("Insulation thicknes: {}").format(t*304.8)else: t=float(dict[Pargetstr(el,"Family and Type")+""+Parget(el,"Overall Size")])/304.8 Plumbing.PipeInsulation.Create(doc,el.Id,choosen_ins.Id,t)print("=====")print(Pargetstr(el,"Family and Type")+""+Parget(el,"Overall Size")+" Id: "+str(el.Id))print("Insulation thicknes: {}").format(t*304.8)exceptExceptionas e:print("=====")print(e)print("Error Element Id {}".format(el.Id))transaction.Commit()
Please report any irregularities in the operation of the program that occur during use on my social accounts or GitHub.