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
Making changes to a model in which many worksets are created leads to mistakes due to the wrong assignment of the changed elements. Thanks to the active workset function, you can easily select a given element and change the workset.
The program for setting active workset is designed to help you in your daily work. Thanks to this, you do not have to manually check the workset of a given element and then change it. Just select an item and its workset will automatically be set as active. When will you benefit most from it:
Making changes to the model for elements on different worksets
When verifying elements on a given workset
When you start working on a new model where you don’t know the workset assignment hierarchy yet
Instruction how to install my extension you can find here.
Program operation
First, the program asks us to indicate the element. It is his workset that will be set as active.
The program changes the active workset in the background.
A video of the program in action
Program code – revit setting active workset
Below is the program code from the first version of the overlay. For more please visit mine GitHub, where new versions of the overlay will appear on a regular basis.
Python
Copyright(C)2022 Paweł Kińczykfrom rpw import revitfrom Autodesk.Revit.UI.Selection import*from Autodesk.Revit.DB import*from pyrevit import formsfrom pyrevit import outputdoc = revit.docuidoc = revit.uidoc## Pick model elementtry:with forms.WarningBar(title="Pick elements in model"): collector = uidoc.Selection.PickObject(ObjectType.Element)exceptExceptionas e:print("Error: "+str(e))## Get element's worksetel=doc.GetElement(collector.ElementId)workset_id = el.WorksetIdtransaction =Transaction(doc,'Changed workset - PYLAB')## Change active worksettry: transaction.Start() doc.GetWorksetTable().SetActiveWorksetId(workset_id) transaction.Commit() output = output.get_output() output.close()exceptExceptionas e:print("Error: "+str(e))
Please report any irregularities in the operation of the program that occur during use on my social accounts or account GitHub.