You're right, it's not being used correctly. The Transaction needs to take place inside the Idling event. The button click handler and Idling : void revitApp_Idling(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs e) { UIApplication uiapp = se…
Revit Architecture, along with ArchiCAD, is most used BIM software in architectural design. Although book is not the best medium for learning computer software, there are some useful handbooks if you often use this software. Refers to the latest vers…
这里从SDK的文章中摘录出全部的API变化.主要是希望用户用搜索引擎时能找到相关信息: Major changes and renovations to the Revit API APIchanges .NET 4.5 Revit's API is now built with and requires .NET 4.5 forcompilation. VisualC++ runtime 11 update 4 (Visual Studio 2012) Revit is now built w…
一.起因 自己在写revit二开时,有一个Winform窗体按钮点击事件需要 触发调用事务进行处理,结果出现“异常“Starting a transaction from an external application running outside of API context is not allowe“” 其实这是 上面异常是Revit的一种保护机制,创建的非模态对话框Form1后,在Form1未关闭的状态下,Revit认为是处于非API的上下文环境,所以异常弹出来了. 在非模态对话…
使用Idling事件处理插件任务. #region Namespaces using System; using System.Collections.Generic; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Events; #endregi…
关于Revit Journal读写的例子. #region Namespaces using System; using System.Collections.Generic; using System.Diagnostics; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Au…
本示例实现Revit和Revit打开的文件的相关信息. #region Namespaces using System; using System.Collections.Generic; using System.Diagnostics; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; usin…
在该示例中,插件在Revit启动时弹出事件监控选择界面,供用户设置,也可在添加的Ribbon界面完成设置.当Revit进行相应操作时,弹出窗体会记录事件时间和名称. #region Namespaces using System; using System.Collections.Generic; using System.Windows.Forms; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attribute…
本示例介绍了Revit的错误处理. #region Namespaces using System; using System.Collections.Generic; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; #endregion namespace ErrorHandling { […
Revit API 不支持调用Revit内部命令,但可以用RevitCommandId重写它们(包含任意选项卡,菜单和右键命令).使用RevitCommandId.LookupCommandId()可以提供查询和获取命令的ID,然后用CreateAddInCommandBinding()来创建绑定一个AddInCommandBinding实例,通过Executed和CanExecute事件来完成重写内部命令. 下面是一个具体的例子: #region Namespaces using Syst…