stiter 2011-05-05 16:23 问到:
叶老师,您好。
我想问下REVIT 2011的API中如何实现链接rvt文件。
sdk里面chm文件里面好像只有导入CAD的。
我需要在我的rvt文件里面导入另外几个rvt文件进来并显示。
谢谢您!
答:
现在(Revit2011, 2012)还无法实现用二次开发的方式链接Revit模型。只能手动链接。
在Revit 2013 中提供了创建链接模型的方法。
RevitLinkType.Create(Document, ModelPath, RevitLinkOptions) will create a new Revit link type and load the associated linked file into the document. This returns a RevitLinkLoadResult, which stores the ElementId of the newly-created RevitLinkType and contains any errors which occurred when trying to load the linked file (The RevitLinkLoadResultType enumeration contains the full list.)
RevitLinkInstance.Create(Document, ElementId) will create a new instance of an already-loaded RevitLinkType.