我正在进入 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