【发布时间】:2019-06-24 04:20:35
【问题描述】:
我正在使用 revit python wrapper/revit python shell,但在一个非常简单的任务上遇到了麻烦。
我的项目中有一面墙,我只是想将顶部偏移从 0'- 0" 更改为 4'-0"。我已经能够更改属性中的评论,但仅此而已。
这是我的代码:
import rpw
from rpw import revit, db, ui, DB, UI
element = db.Element.from_int(352690)
with db.Transaction('Change height'):
element.parameters['Top Offset'].value = 10
这是我的错误:
[ERROR] Error in Transaction Context: has rolled back.
Exception : System.Exception: Parameter is Read Only: Top Offset
at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at Microsoft.Scripting.Hosting.ScriptSource.ExecuteAndWrap(ScriptScope scope, ObjectHandle& exception)
我们不胜感激。我已经阅读了文档,但是他们似乎没有阅读只读项目。
我正在使用 revit 2019。RPS 使用的是 python 2.7.7
【问题讨论】:
标签: revit-api revit revitpythonshell