I'm having trouble finding archi-lab.Revit.Elements.References

I’m trying to use the node Get Stable Representaion also from Archilab, but when I plug a reference into it says it wants archi-lab.Revit.Elements.References which I don’t see in the library. Has it been renamed maybe? Alphabetically it would be right above Subcomponent’s?

It’s under Archi-Lab > Revit > References. :slight_smile:

Is it the CreateByReference?
I’ve already got GettStableRepresentation but the error message is being specific about what it wants plugged into it. It’s saying it expects archi-lab.Revit.Elements.References
Screenshot 2023-01-11 150259

That would be my guess, but I haven’t played with these nodes.

What is your end goal?

I believe Genius Loci has a similar node to this if not.

1 Like

I’ve inherited some code from a previous developer, it looks like he used FamilyInstances.RetrieveNestedComponent as a starting point. I’m trying to dimension from a linked curtain wall. If the references are named it’s usually working out ok, but not all of them are. Even local things like the level should still have a reference and I’m having a real challenge understanding how to mix the two. I’d rather get back to just using standard nodes. There are things nested in the curtain wall without named references that have been hard to get, like in the corner post or a head jamb receptor.
https://forum.dynamobim.com/t/how-to-retrieve-nested-components-from-family-instance-in-link/84642

import clr

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

def parse_linked_reference(doc, linked_ref):
    reps = linked_ref.ConvertToStableRepresentation(doc).split(":")
    res = ""
    first = True
    for i, s in enumerate(reps):
        t = s
        if "RVTLINK" in s:
            if i < len(reps) - 1:
                if reps[i + 1] == "0":
                    t = "RVTLINK"
                else:
                    t = "0:RVTLINK"
            else:
                t = "0:RVTLINK"
        if not first:
            res = res + ":" + t
        else:
            res = t
            first = False
    ref = Reference.ParseFromStableRepresentation(doc, res)
    return ref

elements = UnwrapElement(IN[0]) if isinstance(IN[0], list) else [UnwrapElement(IN[0])]

additional_refs = IN[3]
link_refs = []

#reference_names = ["Top", "Bottom", "TOSlab", "BOIntMull"]
#reference_names = ["Top", "TOSlab", "BOIntMull"]
#reference_names = ["Top", "BOIntMull"]
reference_names = ["Top", "TOSlab"]
#reference_names = ["Top", "Bottom"]
#reference_names = ["Top"]

for x in elements:
    for reference_name in reference_names:
        reference = FamilyInstance.GetReferenceByName(x, reference_name)
        if reference:
            link_refs.append(reference)


    # rf_1 = FamilyInstance.GetReferenceByName(x, "FabRightFrame")
    # link_refs.append(rf_1)

# Keep only the first and last references
# link_refs = [link_refs[0], link_refs[-1]]

# Add the additional references to the list of references
link_refs.append(additional_refs)

line = IN[1].ToRevitType()
# Interval = IN[2] * 0.08333333333  # / 12
# Interval = IN[2]# / 12
linked_instance = IN[2].InternalElement

doc = DocumentManager.Instance.CurrentDBDocument

ref_array = ReferenceArray()
for ref_link in link_refs:
    linked_reference = ref_link.CreateLinkReference(linked_instance)
    ref = parse_linked_reference(doc, linked_reference)
    ref_array.Append(ref)

# Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

dim = doc.Create.NewDimension(doc.ActiveView, line, ref_array)

OUT = dim

#TransactionManager.Instance.TransactionTaskDone()

@TurtleWolfe , look also: