Revit API注册事件
start
end
using Autodesk.Revit.DB.Events;
//http://revit.haotui.com
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
public class App : IExternalApplication
{
public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
{
application.ControlledApplication.DocumentChanged += new EventHandler<DocumentChangedEventArgs>(app_Doc_Change);
return Autodesk.Revit.UI.Result.Succeeded;
}
public Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application)
{
return Autodesk.Revit.UI.Result.Succeeded;
}
public void app_Doc_Change(object sender, DocumentChangedEventArgs args)
{
Document doc = args.GetDocument();
TaskDialog.Show("info", doc.PathName);
}
}
//http://revit.haotui.com
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
public class App : IExternalApplication
{
public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
{
application.ControlledApplication.DocumentChanged += new EventHandler<DocumentChangedEventArgs>(app_Doc_Change);
return Autodesk.Revit.UI.Result.Succeeded;
}
public Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application)
{
return Autodesk.Revit.UI.Result.Succeeded;
}
public void app_Doc_Change(object sender, DocumentChangedEventArgs args)
{
Document doc = args.GetDocument();
TaskDialog.Show("info", doc.PathName);
}
}
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。