This repository was archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmyPlugin.cs
More file actions
46 lines (38 loc) · 1.71 KB
/
myPlugin.cs
File metadata and controls
46 lines (38 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// (C) Copyright 2015 by
//
using Autodesk.AutoCAD.Runtime;
// This line is not mandatory, but improves loading performances
[assembly: ExtensionApplication(typeof(AutoCADNote.MyPlugin))]
namespace AutoCADNote
{
// This class is instantiated by AutoCAD once and kept alive for the
// duration of the session. If you don't do any one time initialization
// then you should remove this class.
public class MyPlugin : IExtensionApplication
{
void IExtensionApplication.Initialize()
{
// Add one time initialization here
// One common scenario is to setup a callback function here that
// unmanaged code can call.
// To do this:
// 1. Export a function from unmanaged code that takes a function
// pointer and stores the passed in value in a global variable.
// 2. Call this exported function in this function passing delegate.
// 3. When unmanaged code needs the services of this managed module
// you simply call acrxLoadApp() and by the time acrxLoadApp
// returns global function pointer is initialized to point to
// the C# delegate.
// For more info see:
// http://msdn2.microsoft.com/en-US/library/5zwkzwf4(VS.80).aspx
// http://msdn2.microsoft.com/en-us/library/44ey4b32(VS.80).aspx
// http://msdn2.microsoft.com/en-US/library/7esfatk4.aspx
// as well as some of the existing AutoCAD managed apps.
// Initialize your plug-in application here
}
void IExtensionApplication.Terminate()
{
// Do plug-in application clean up here
}
}
}