/
deemas-077
/
proba
Обзор
Документация
Войти
/
deemas-077
/
proba
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Program.cs
80 строк
3 KB
deemas-077
Create: .gitignore, BitmapMaker.cs, BundleGenerator.cs, CompanionResourceDllGenerator.cs, CuixBuilder.csproj, CuixConfig.cs, CuixGenerator.cs, CuiXml.cs, LICENSE, Program.cs, README.md
08 авг 2026, 06:30
Верифицирован
08 авг 2026, 06:30
53dbcfc
Код
Авторство
О чём код?
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.");