-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathConfigureCommand.cs
More file actions
29 lines (26 loc) · 891 Bytes
/
ConfigureCommand.cs
File metadata and controls
29 lines (26 loc) · 891 Bytes
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
using Autodesk.AutoCAD.Runtime;
using CADPythonShell.App;
using Application = Autodesk.AutoCAD.ApplicationServices.Core.Application;
namespace CADPythonShell.Command
{
/// <summary>
/// Open the configuration dialog.
/// </summary>
public class ConfigureCommand : ICadCommand
{
[CommandMethod("PythonShellSetting")]
public override void Execute()
{
//load the application
if (!CADPythonShellApplication.applicationLoaded)
{
CADPythonShellApplication.OnLoaded();
}
var dialog = new ConfigureCommandsForm();
dialog.StartPosition = FormStartPosition.CenterScreen;
NativeWindow nativeWindow = new NativeWindow();
nativeWindow.AssignHandle(Application.MainWindow.Handle);
dialog.ShowDialog(nativeWindow);
}
}
}