Message 1 of 5
How to use GetGeometryObjectFromReference() if Reference in rvt-link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Part of code on Python:
reference_intersector = ReferenceIntersector(
ElementId(2471),
FindReferenceTarget.Face,
doc.ActiveView) #ElementId refers to RevitLinkInstance
reference_intersector.FindReferencesInRevitLinks = True
floors_refs = [i.GetReference() for i in reference_intersector.Find(point,point2)] #Getting Reference from ReferenceWithContext
linkdoc = doc.GetElement(ElementId(2471)).GetLinkDocument()
floors = [linkdoc.GetElement(i.LinkedElementId) for i in floors_refs] #Getting floor element from link
#Case 1:
face = floors[0].GetGeometryObjectFromReference(floors_refs[0]) #Exception: The id of this element is not same as that referenced by reference
Case 2:
link_inst = doc.GetElement(ElementId(2471))
face = floors[0].GetGeometryObjectFromReference(floors_refs[0].CreateLinkReference(link_inst))#EnvironmentError: System.Runtime.InteropServices.SEHException (0x80004005)
What am I doing wrong ? In project only one lighting fixture and one floor. This "algorithm" works in a project without linked files