i using Python to Link revit file but iam facing the below problem , the link is there but actually doesn’t exist as geometry in the current file.
Script:
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import ToDSType(bool) extension method
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
Import DocumentManager and TransactionManager
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore.List import *
import System
import sys
pyt_path= r"c:\program Files (x86)\ironPython 2.7\lib"
sys.path.append(pyt_path)
import math
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
pathName = IN[0]
path = Autodesk.Revit.DB.FilePath(pathName)
Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
options = Autodesk.Revit.DB.RevitLinkOptions(True)
Autodesk.Revit.DB.RevitLinkType.Create(doc, path, options)
#RevitLinkLoadResult.Create(Autodesk.Revit.DB.Document,path,options)
#End the Transaction
TransactionManager.Instance.TransactionTaskDone()
doc.Regenerate()
OUT = dir(options)