Revit linked element id

,

Often in your work you need to communicate with others through screenshots in the model? After posting a place, having trouble finding the element in model? Thanks to my extension to PyRevit -> PyLab you can generate the Id of elements in the model as well as those linked!

In article about program for “revit linked element id”:

Revit linked element id

The need for easy communication on models

The program was created to improve communication on various models. Unfortunately, currently in Revit it is possible to check the Id of elements located only in the opened model, while the overlays allow you to receive the Id of only linked objects. This type of division makes it difficult to communicate via e-mails, for example. The user must then generate the Id separately. Thanks to the “Ids” function, everything is in one place! If you don’t have the overlay yet, I encourage you to download it. You can find the full instructions in my post PYLAB – free revit addin.

Program operation – revit linked element id

The program in order allows you to select elements contained in the model, and then elements located in linked Revit models. Then, after selecting the elements, the program returns the following information:

  • Where the element is, in the model or is it linked?
  • Id of element
  • Family and type of element

Thanks to this information, finding the discussed elements in individual models is easy and does not require the use of several commands. In addition, information about the family and type facilitates orientation, even when discussing collisions.

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
from Autodesk.Revit.UI.Selection import *
from pyrevit import forms

doc = revit.doc
uidoc = revit.uidoc

def Pargetstr(element, name):
    return (element.GetParameters(name))[0].AsValueString()

## Pick model elements
try:
    with forms.WarningBar(title="Pick elements in model"):
        collector = uidoc.Selection.PickObjects(ObjectType.Element)

except Exception as e:
    pass
    # print(e)
    
## Pick linked elements
try:
    with forms.WarningBar(title="Pick elements in linked model"):
        collector_link = uidoc.Selection.PickObjects(ObjectType.LinkedElement)

except Exception as e:
    pass
    # print(e)

## Print Ids
try:
    for i in collector:
            print("====")
            print("Model element "+str(i.ElementId))
            el=doc.GetElement(i.ElementId)
            print((Pargetstr(el, "Family and Type")))
except:     
    print("No picked elements")
try:
    for i in collector_link:
            print("====")
            el=doc.GetElement(i.ElementId)
            linkdoc=el.GetLinkDocument()
            el=linkdoc.GetElement(i.LinkedElementId)
            print("Linked element "+str(i.ElementId))
            print((Pargetstr(el, "Family and Type")))
except Exception as e:
    # print(e)
    print("No picked linked elements")

Please report any irregularities in the operation of the program that occur during use on my social accounts or GitHub.

See also:

Paweł Kińczyk
Paweł Kińczyk
Articles: 58

Newsletter

Chcesz być na bieżąco? Zapisz się do newslettera!

Leave a Reply

Your email address will not be published. Required fields are marked *