-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
80 lines (68 loc) · 3.28 KB
/
Copy pathProgram.cs
File metadata and controls
80 lines (68 loc) · 3.28 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System.Text.Json;
if (args.Length == 0 || args[0] is "--help" or "-h" or "-?")
{
Console.WriteLine("""
CuixBuilder — AutoCAD ribbon plugin generator
WHAT IT DOES:
Reads a JSON config and generates a complete AutoCAD .bundle folder:
• PluginName.cuix — partial CUIX (ribbon tab + panels + buttons)
• PluginName_ToolTips.xaml — extended tooltips with GIF animations
• PluginName.lsp — LISP command file (copied from lispPath)
• PluginName.Help.html — offline HTML help (copied from lispPath dir)
• PackageContents.xml — AutoCAD plugin manifest
Drop the .bundle folder in:
%APPDATA%\Autodesk\ApplicationPlugins\
AutoCAD auto-loads on next startup — no CUILOAD needed.
USAGE:
CuixBuilder <config.json> Build bundle from JSON config
CuixBuilder <output.cuix> Build a demo bundle (no config needed)
CuixBuilder --help Show this help
CONFIG JSON FIELDS:
pluginName string Internal name, no spaces (e.g. "DraftingTools")
displayName string Human-readable name shown on ribbon tab
tab string Ribbon tab label
outputPath string Full path to output .cuix file
acadDir string AutoCAD install dir (used to detect R-series)
lispPath string Path to .lsp file to bundle (optional)
panels[]
name string Panel label on ribbon
buttons[]
label string Button text
command string AutoCAD command or LISP macro (e.g. "(c:ZOOMSEL)")
imagePath string Path to 16x16 .bmp icon (optional, auto-generated if missing)
tooltip string Short hover text
tooltipDescription string Extended tooltip body text
tooltipImage string Path to .gif/.png for animated tooltip
helpTopic string URL or anchor for F1 help
EXAMPLE:
CuixBuilder C:\MyPlugin\config.json
""");
Environment.Exit(args.Length == 0 ? 1 : 0);
}
var arg = args[0];
CuixConfig cfg;
if (arg.EndsWith(".json", StringComparison.OrdinalIgnoreCase))
{
var json = File.ReadAllText(arg);
cfg = JsonSerializer.Deserialize<CuixConfig>(json)
?? throw new InvalidOperationException("Failed to parse config JSON");
}
else
{
cfg = CuixConfig.Demo(arg);
}
Console.WriteLine($"Building: {cfg.OutputPath}");
Console.WriteLine($" Plugin : {cfg.DisplayName}");
Console.WriteLine($" Tab : {cfg.Tab}");
Console.WriteLine($" Panels : {cfg.Panels.Count}");
Console.WriteLine($" Buttons: {cfg.Panels.Sum(p => p.Buttons.Count)}");
CuixGenerator.Generate(cfg);
Console.WriteLine("Done.");
Console.WriteLine($"In AutoCAD: CUILOAD → {Path.GetFullPath(cfg.OutputPath)}");
// Bundle: PluginName.bundle/ with CUIX + XAML tooltips + LISP
var bundleDir = BundleGenerator.Generate(cfg);
Console.WriteLine();
Console.WriteLine($"Bundle → {bundleDir}");
Console.WriteLine($"Deploy: copy the bundle folder to:");
Console.WriteLine($" %APPDATA%\\Autodesk\\ApplicationPlugins\\");
Console.WriteLine($"AutoCAD will load it automatically on next startup.");