gta*_*ico 6 ironpython revit-api revitpythonshell
我不知道这是 IronPython 问题、Revit API 程序集问题还是其他问题。任何有关可能导致这种情况的信息/想法表示赞赏。
我知道这可以通过再次重新导入相同的命名空间来解决,但我很想知道为什么会这样。
下面是正在发生的事情的简短示例。图像显示 RevitPythonShell 控制台输出。
import clr
clr.AddReference('RevitAPI') # Contains Imports Autodesk.Revit.DB
from Autodesk.Revit import DB # OK
DB.Element.Name # OK
DB.Element.Name.GetValue() # OK: Method exists. As Expected
Run Code Online (Sandbox Code Playgroud)
from File1 import DB
DB.Element.Name # OK, Property Exists
DB.Element.Name.GetValue() # *** Method DOES NOT Exist, Attribute Error is raised
from Autodesk.Revit import DB # Re-import the same namespace again
DB.Element.Name.GetValue() # OK: Method Exists
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
114 次 |
| 最近记录: |