Hi everyone,
i am trying to get the document of a linked model using python. the code works but im getting the linked document double!
anyone have an idea what is the reason and hou to get only one document?
import System
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Analysis import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
rlinkName = IN[0]
linkedDocument = []
collector = Autodesk.Revit.DB.FilteredElementCollector(doc)
linkInstances = collector.OfClass(Autodesk.Revit.DB.RevitLinkInstance)
linkDoc, linkName = [], []
requiredView = []
for i in linkInstances:
linkDoc.append(i.GetLinkDocument())
linkName.append(i.Name)
OUT = linkDoc, linkName