Get Monitored Link Element Ids

I am trying to get a hold of the original elements that were copy-monitored from a link in my current file. I have tried using the GetMonitoredLinkElementIds() method but it only retrieves the ID of the whole link itself and not the individual elements that are being copy-monitored. Any clues on how to achieve this?
I need a list of the local elements and the correspondent copy-monitored elements from the link.

What I have so far:

@Antonio_Vachev ,

i am not sure if you want switch to a package

Thanks for the suggestion, @Draxl_Andreas . However, I need to make the connection between the collected elements from the link and the copy-monitored elements in my current model. It seems logical that the information is available somewhere in the copy-monitored element as it tracks any changes in the link model. I want to avoid having to do any sort of intersection of solids to find the element pairs.
Basically, I need a list that says Element A in current model corresponds to Element B in linked model (as they are copy-monitored).

@Antonio_Vachev ,

check out archi lab…

maybe you can rebuilt this node

Unfortunately this functionality is not yet in the API. You would have to do a physical or parameter-based comparison to identify copied elements.

3 Likes

@Nick_Boyts would you know if it is anywhere on the roadmap at the moment? I am seeing discussions on the topic from 2017. As far as I understand, none of the Copy Monitor functionalities are open to the API? I was thinking perhaps if I can Copy monitor the elements myself I can keep track of relationships and transfer the instance parameters on the go.
Even better, of course, would be that instance parameters are transferred automatically when you Copy monitor an element, I don’t see why you wouldn’t want that in the first place.

All I know is it’s been a long-standing request from the community and it’s not there yet. No idea if it’s anywhere on the roadmap but feel free to check yourself. There’s currently nothing in the API that relates the instances being monitored to the original copy so there’s not really anything you can manage yourself. You could try looking into the coordination reports but I think you’re still going to be severely limited there as well.

@Antonio_Vachev Would you be willing to copy your entire python code and share it please? This would be quite useful for me right now.

Bit of an old topic, and I am not sure that Antonio has that code handy still (or if he visits much anymore). Fortunately that code doesn’t have much to it so you can fairly easily retype it from the image.

Note that the Python above just retrieved the element ID of the associated link instance, not the monitored element in the link.

@jacob.small I did retype all of the visible code but its missing some lines at the top and I am not skilled enough with Python to know what those lines should be, hence the request. :slight_smile:

I do understand that it is only pulling the link but that is exactly what I want it to do. I am building a graph that will help some of our BIM Leads check whether copy/monitored elements are using the correct link or not.

1 Like

Those look to be standard boilerplate imports. Or that individuals version thereof. I have a shared topic with my version. And this template is also very good: dynamoPython/pythonTemplates/RevitPythontemplateFile at master · Amoursol/dynamoPython · GitHub

@jacob.small Thank you! This is a great resource.

Unfortunately, I still cant get this stupid thing to work. Getting this error:
image

Can you post your .dyn?

CopyMonitorChecker.dyn (13.5 KB)

Super basic right now. Just trying to get the names of the links that the copy monitored elements came from. I have not taken it further than this step yet.

Hi,
you need to manage levels on the Python input node


# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
clr.AddReference('RevitAPIUI')
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.DesignScript.Geometry import *

import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
import RevitServices
from RevitServices.Persistence import DocumentManager
import Autodesk
from Autodesk.Revit.DB import *
# The inputs to this node will be stored as a list in the IN variables.
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument

# Place your code below this line

outlist = []
array_list_elems = UnwrapElement(IN[0])

for group_Elems in array_list_elems:
    temp = []
    for elem in group_Elems:
        if elem.IsMonitoringLinkElement():
            lnk_inst = doc.GetElement(elem.GetMonitoredLinkElementIds()[0])
            temp.append([elem, lnk_inst])
        else:
            temp.append([elem, None])
    outlist.append(temp)

# Assign your output to the OUT variable.
OUT = outlist
1 Like

@c.poupin TY! This does exactly what I wanted it to do.

One of these days I might have enough free time to learn Python…one day.