百度能做网站建设吗,静态动漫网站模板,重庆的企业的网站建设,品质培训网站建设前言
这个例子介绍了如何使用打印相关的事件。
内容
事件机制也是老生常谈了#xff0c;Revit 提供了大量的可供注册的事件#xff1a;Revit API#xff1a;Events 事件总览
注册和 print 相关的事件#xff1a;
// IExternalApplication.OnStartup
m_eventsReactor …前言
这个例子介绍了如何使用打印相关的事件。
内容
事件机制也是老生常谈了Revit 提供了大量的可供注册的事件Revit APIEvents 事件总览
注册和 print 相关的事件
// IExternalApplication.OnStartup
m_eventsReactor new EventsReactor();
application.ControlledApplication.ViewPrinting new EventHandlerAutodesk.Revit.DB.Events.ViewPrintingEventArgs(m_eventsReactor.AppViewPrinting);
application.ControlledApplication.ViewPrinted new EventHandlerAutodesk.Revit.DB.Events.ViewPrintedEventArgs(m_eventsReactor.AppViewPrinted);
application.ControlledApplication.DocumentPrinting new EventHandlerAutodesk.Revit.DB.Events.DocumentPrintingEventArgs(m_eventsReactor.AppDocumentPrinting);
application.ControlledApplication.DocumentPrinted new EventHandlerAutodesk.Revit.DB.Events.DocumentPrintedEventArgs(m_eventsReactor.AppDocumentPrinted);在 AppDocumentPrinting 中启动记录在 AppDocumentPrinted 中输出执行时间。 在 AppViewPrinting 中启动记录在 AppViewPrinted 中输出执行时间。
底层时间戳用了 .Net 的类 Stopwatch
namespace System.Diagnostics
{public class Stopwatch{public static readonly long Frequency;public static readonly bool IsHighResolution;public Stopwatch();public bool IsRunning { get; }public TimeSpan Elapsed { get; }public long ElapsedMilliseconds { get; }public long ElapsedTicks { get; }public static long GetTimestamp();public static Stopwatch StartNew();public void Reset();public void Restart();public void Start();public void Stop();}
}