Accessing Revit API from outside Revit

元气小坏坏 提交于 2019-12-10 09:36:22

问题


I've used RevitPythonShell and Dynamo, but would like to use my existing Python IDE (Eclipse) where I have my configuration for logging, debugging, GitHub integration, etc.

I'm comfortable with transactions and the overall API, and I've invested some time in reading about the Revit API and modeless connections, and others asking similar questions. Some of them are a few years old. Is it currently possible to interact with Revit from Python executed outside Revit?

For example, I've tried;

import clr
clr.AddReference(r'C:\Program Files\Autodesk\Revit 2016\RevitAPI')
import Autodesk.Revit.DB as rvt_db
print(dir(rvt_db))

But this doesn't seem to expose anything useful.


回答1:


You cannot call the Revit API from another process. The API is designed to be used "in-process", so you have to make a DLL which will be loaded by Revit into its own process.



来源:https://stackoverflow.com/questions/37964449/accessing-revit-api-from-outside-revit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!