-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyCommands.cs
60 lines (45 loc) · 1.85 KB
/
myCommands.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// (C) Copyright 2013 by
//
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
// This line is not mandatory, but improves loading performances
[assembly: CommandClass(typeof(AcadSAPConnector.MyCommands))]
namespace AcadSAPConnector
{
public class MyCommands
{
static Autodesk.AutoCAD.Windows.PaletteSet _ps = null;
static SAPConnectorCtrl _connectorCtrl = null;
[CommandMethod("SAPConnector")]
public void SAPConnector()
{
if (_ps != null)
{
_ps.Visible = true;
_connectorCtrl.RefreshContent();
return;
}
_ps = new Autodesk.AutoCAD.Windows.PaletteSet(
"SAP Connector",
new Guid("57AA1B6D-7D2C-426B-B315-6FA7714DA223"));
_ps.Text = "SAP Connector";
_ps.DockEnabled = Autodesk.AutoCAD.Windows.DockSides.Left |
Autodesk.AutoCAD.Windows.DockSides.Right |
Autodesk.AutoCAD.Windows.DockSides.None;
_ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu |
Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton |
Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton;
_ps.MinimumSize = new System.Drawing.Size(200, 300);
_ps.Size = new System.Drawing.Size(300, 500);
_connectorCtrl = new SAPConnectorCtrl();
Autodesk.AutoCAD.Windows.Palette palette =
_ps.Add("SAP Connector", _connectorCtrl);
_ps.Visible = true;
_connectorCtrl.RefreshContent();
}
}
}