Lightcad logo

Lightcad

Community
znlgis
lightcad

Use when extending the FeiYang LightCAD platform (C#/.NET 8) — implementing ILcPlugin, registering ElementType / ElementActions, [CommandClass] + [CommandMethod] commands, plugins.json loading, DwgReader.Import / SaveDwg workflows; also when a plugin DLL is not loaded, dispatching to a command does nothing, or a build fails on ThreeJs4Net.dll / OpenTK.dll or does not support targeting .NET 8. Source is not publicly released; API facts here track the platform SDK used by znlgis/FY_Layout.

Overview

Publisherznlgis
Repositoryopengis-skills
Skill namelightcad
Stars
76
Forks
12
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by znlgis on GitHub. Read the source before you install it.

Installation

Install the Lightcad AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/znlgis/opengis-skills/tree/main/cad/lightcad
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/znlgis/opengis-skills.git /tmp/opengis-skills
mkdir -p .claude/skills
cp -r /tmp/opengis-skills/cad/lightcad .claude/skills/lightcad
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lightcad in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lightcad on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lightcad is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

项目地址: 原公开仓库 github.com/znlgis/lightcad1 已不可用(HTTP 404),源码暂未公开发布;项目信息见启道软件官网(www.qidaosoft.com/Feiyang.html,仅 HTTP)

所属平台: 飞扬集成设计平台(LightCAD,启道软件 Qidao Soft)

许可证: 以官方发布渠道声明为准(曾标注 CC-BY-SA-4.0)

中文教程: https://znlgis.github.io/cad/LightCAD/(20 章,从架构到插件实战,当前唯一可访问的权威来源)

版本: 无公开 Release/Tag;API 以配套插件仓库 znlgis/FY_Layout 引用的 SDK 为准(截至 2026-10)

概述

LightCAD(飞扬集成设计平台)是一套基于 .NET 8 / C# 开发的建筑工程设计软件(主程序源码未公开发布,能力与 API 以官方渠道与配套插件仓库为准),目标是把二维设计、三维设计、BIM 设计、智能设计与协同设计融合为一体,为建筑设计行业提供 BIM 正向设计支撑能力。项目采用严格的分层架构(MathLib → Core → RenderUtils → Drawing → Runtime → UI),既可作为完整 CAD 平台使用,也可作为二次开发底座。核心特性:

  • 完整 2D/3D 能力:直线、圆弧、多段线、样条等二维图元;拉伸、旋转、放样、融合等参数化实体建模
  • 多渲染后端:Three.js4Net(WebGL)与 OpenTK(OpenGL)
  • DWG/DXF 兼容:通过 ODA SDK 与内置 netDxf 处理 AutoCAD 文件格式,另支持 SketchUp 导入
  • 插件体系:基于 Weikio Plugin Framework 运行时加载;预置建筑(QdArch)、电气(QdElectric)、暖通(QdHvac)、结构(QdStruct)、给排水(QdWater)五大行业插件
  • 视图构建:正交投影、截面视图、详图生成

环境准备

前置条件

项要求
操作系统Windows 10(1909+)/ Windows 11 64 位
开发工具Visual Studio 2022(17.5.5+,.NET 桌面开发工作负载)或 dotnet CLI
SDK.NET 8 SDK
硬件8GB 内存起(推荐 16GB+),支持 OpenGL 3.3 的显卡

获取源码与编译

源码获取提示: LightCAD 主程序源码暂未公开发布,原 GitHub 仓库已 404,无法通过 git clone 获取。请通过启道软件官方渠道(www.qidaosoft.com/Feiyang.html,仅 HTTP,需手动访问)申请/下载;若已从官方渠道拿到源码包,按下面的步骤编译。

bash
# 将 <LightCAD-源码目录> 替换为你从官方渠道取得并解压后的实际路径
cd <LightCAD-源码目录>

# 还原与编译(解决方案文件名以实际包内为准,下例为常见形态)
dotnet restore <Solution>.sln
dotnet build <Solution>.sln --configuration Debug

运行(VS 或 CLI)

bash
# VS:打开解决方案,将主程序工程(LightCAD.WinForm 一类)设为启动项目,按 F5
# CLI:
dotnet run --project <主程序工程目录>

验证:稳定编译后启动主窗口即成功;插件调试采用 VS「附加到进程」绑定 lightcad 进程(参见 FY_Layout 插件示例的做法)。


解决方案结构(关键项目)

项目职责
LightCAD.MathLib向量/矩阵、曲线数学、几何求交(Vector2/Vector3 等)
LightCAD.Core核心数据模型:LcDocument、图元实体(LcElement)、ElementType、元素空间
LightCAD.RenderUtilsThree.js4Net 桥接、资源与事件、三维控件
LightCAD.Drawing / LightCAD.Drawing.Actions视口、输入系统、捕捉、交互 Action(IDocumentEditor)
LightCAD.Runtime应用运行时:ILcPlugin、PluginManager、命令框架(CommandClass/CommandMethod)
LightCAD.Model / LightCAD.UI.WinForm / LightCAD.WinForm模型控件、UI 层与主程序入口
LightCAD.ImportAndExportDWG/DXF/SketchUp 导入导出
Plugins/预编译行业插件(QdArch 等)
netDxf、Libs/、ThirdParty/DXF 库源码、本地 DLL(ThreeJs4Net/OpenTK)、第三方源码

核心 API

图元实体(LightCAD.Core)

二维基本图元以 Lc 前缀命名,与 AutoCAD 习惯一致:

csharp
using LightCAD.Core;

// 常见二维图元
var line   = new LcLine();       // 直线
var circle = new LcCircle();     // 圆
var arc    = new LcArc();        // 圆弧
var pline  = new LcPolyLine();   // 多段线
var ell    = new LcEllipse();    // 椭圆
var hatch  = new LcHatch();      // 填充
var text   = new LcText();       // 文字

// 元素加入文档模型空间
lcDocument.ModelSpace.Elements.Add(line);

实体目录还包括三维图元(Elements/Element3d)、实体建模(Elements/Solid)、标注(Elements/Dim、Dim3)、表格(Table)等(详见仓库 src/LightCAD.Core/Elements/)。

插件接口(LightCAD.Runtime)

插件入口实现 ILcPlugin,由 PluginManager 通过 Weikio Plugin Framework 加载:

csharp
using LightCAD.Runtime;
using LightCAD.Core;

public class MyPlugin : ILcPlugin
{
    public static TabItem MyTab = new TabItem { Name = "MyMajor", Text = "我的专业" };

    public void Loaded()
    {
        // 注册自定义元素类型(ElementType 需含唯一 Guid、Name、DispalyName 与 ClassType)
        LcDocument.RegistElementTypes(MyElementType.All);
        // 注册 2D/3D Action
        LcDocument.ElementActions.Add(MyElementType.Device, new DeviceAction());
        LcDocument.Element3dActions.Add(MyElementType.Device, new Device3dAction());
    }

    public void Completed()
    {
        AppRuntime.UISystem.AddInitTabItems(new[] { MyTab });   // 挂接 UI 菜单
    }

    public void OnInitializeDocRt(DocumentRuntime docRt) { }
    public void OnDisposeDocRt(DocumentRuntime docRt) { }
}

插件目录通过主程序旁的 plugins.json(folders 数组)配置,PluginManager.LoadPlugins() 扫描加载。

命令注册(CommandClass / CommandMethod)

csharp
using LightCAD.Core;
using LightCAD.Runtime;

[CommandClass]
public class MyCmds
{
    [CommandMethod(Name = "MyCross", ShortCuts = "MCX")]
    public CommandResult DrawCross(IDocumentEditor docEditor, string[] args)
    {
        // 交互拾取与实体创建:参见 LightCAD.Drawing.Actions 中的 Action 基类
        // ...
        return CommandResult.Succ();
    }
}

命令行(命令行窗口 / 命令别名)与 AutoCAD 风格一致:LINE/CIRCLE/PLINE/MOVE/COPY/MIRROR/TRIM 等内置命令。

DWG 导入导出

LoadDwg / SaveDwg 命令即为导入导出入口(LightCAD.ImportAndExport):

csharp
var lcDocument = DwgReader.Import(filePath);   // 读入 DWG → LcDocument
// 修改 lcDocument.ModelSpace.Elements 后
// 通过 SaveDwg 命令或导出器写回 DWG/DXF

典型工作流

工作流一:从源码构建并运行平台

  1. 安装 .NET 8 SDK 与 Visual Studio 2022(17.5.5+,.NET 桌面开发工作负载)
  2. 从官方渠道取得 LightCAD 源码包并解压(原公开仓库已 404,无法 git clone)
  3. 在源码目录执行 dotnet restore <Solution>.sln → dotnet build <Solution>.sln -c Debug
  4. 启动 LightCAD.WinForm,在命令行窗口输入 LINE 画一条直线验证交互
  5. 用 LoadDwg/SaveDwg 打开与保存 DWG 图纸验证文件链路

工作流二:开发一个行业插件(元素 + 命令 + Action)

  1. 新建类库项目(net8.0-windows,与平台工程 TFM 保持一致),引用平台项目或 Libs/ 下的 SDK DLL(LightCAD.Core、LightCAD.Runtime、LightCAD.Drawing.Actions、LightCAD.MathLib 等)
  2. 定义 ElementType 静态集合(唯一 Guid、Name、DispalyName、ClassType),实体类继承 LcElement
  3. 实现 ILcPlugin:在 Loaded() 注册元素类型与 2D/3D Action,在 Completed() 挂接菜单 Tab
  4. 用 [CommandClass]/[CommandMethod] 编写用户命令,内部驱动 Action 完成交互绘制
  5. 编译后把 DLL 放入插件目录(或配置 plugins.json 的 folders),启动平台验证命令可执行
  6. VS 中以「附加到进程」调试 lightcad 进程;参考完整示例:https://github.com/znlgis/FY_Layout

最佳实践

  1. 分层依赖:业务代码只引用 LightCAD.Core/LightCAD.MathLib,UI 与交互逻辑放 Action 层,避免循环依赖
  2. 元素类型 GUID 稳定:ElementType.Guid 是序列化标识,发布后不可更改;注意 SDK 属性拼写为 DispalyName
  3. 命令薄、Action 厚:[CommandMethod] 只做参数解析与转发,交互逻辑放入 Action 类便于复用与调试
  4. 源码包体积大:含大量 DLL/字体资源,从官方渠道取得后先校验解压完整性再编译;参考实现可对照 FY_Layout 的 Libs/ 引用方式
  5. 渲染路径分离:2D 显示与 3D 显示(ThreeJs4Net/OpenTK)分别验证,避免把 2D 交互问题误判为渲染问题
  6. DWG 兼容性:DWG 读写依赖 ODA 相关 DLL,分发插件时确认 Libs/ 依赖完整

常见问题

问题解决
编译报「找不到 ThreeJs4Net.dll / OpenTK.dll」确认仓库 src/Libs/ 下 DLL 完整(部分二进制依赖未随 Git 提供时需从发布包获取)
The current .NET SDK does not support targeting .NET 8安装 .NET 8 SDK(平台全部工程为 net8.0 / net8.0-windows 目标)
WinForms 项目在非 Windows 上编译失败net8.0-windows 项目仅支持 Windows 编译与运行
NuGet 还原失败(NU1301)检查网络或配置国内 NuGet 镜像源
插件不加载检查 plugins.json 的 folders 配置、DLL 是否位于扫描目录、是否实现 ILcPlugin
命令行输入命令无响应确认平台已启动文档(文档未初始化时命令框架不执行)
DWG 打开异常确认目标版本受 ODA 支持;必要时先用 ODA File Converter 转存

AI 使用建议

  • 推荐工作流模式:先按「工作流一」用 .NET 8 SDK + VS2022 从源码构建并跑通平台(LINE/LoadDwg/SaveDwg 验证链路),再按「工作流二」以 ILcPlugin + ElementType + [CommandMethod] 开发行业插件;插件 DLL 放入插件目录或配置 plugins.json 的 folders。
  • 关键注意事项:① 分层依赖要守——业务代码只引用 LightCAD.Core/LightCAD.MathLib,UI 与交互放 Action 层;② ElementType.Guid 是序列化标识,发布后不可更改,且 SDK 属性拼写为 DispalyName(非 DisplayName);③ 命令薄、Action 厚,[CommandMethod] 只做参数解析与转发;④ 仓库体积大,开发机建议 --depth 1 浅克隆。
  • 常用代码模式:插件入口 = 实现 ILcPlugin → Loaded() 注册 ElementType 与 2D/3D Action → Completed() 挂接菜单 Tab;命令 = [CommandClass] 类 + [CommandMethod(Name=..., ShortCuts=...)] 方法;文件读写 = DwgReader.Import(filePath) 读入 → 改 ModelSpace.Elements → SaveDwg 写回。
  • 调试与验证:用 VS「附加到进程」绑定 lightcad 进程下断点(参考 FY_Layout 插件示例);2D 与 3D 渲染路径(ThreeJs4Net/OpenTK)分别验证,避免把 2D 交互问题误判为渲染问题。
  • 不要臆造:命令框架、ILcPlugin、ElementType、plugins.json 均以仓库源码为准,不要假设存在 AutoCAD 风格的未公开 API。

相关技能

  • fy_layout — 飞扬平台场地布置插件示例(完整的插件工程结构与 SDK 用法):../fy_layout/SKILL.md
  • ifoxcad — AutoCAD .NET 二次开发框架(对照参考另一种 .NET CAD 插件模式):../ifoxcad/SKILL.md
  • xbim — .NET BIM/IFC 工具包(BIM 数据交换互补):../xbim/SKILL.md
  • libredwg — DWG/DXF 读写库(文件格式侧互补):../libredwg/SKILL.md

参考资源

  • 中文教程(20 章,唯一可公开访问的权威来源):https://znlgis.github.io/cad/LightCAD/
  • 插件示例仓库(可公开访问,含 LightCAD SDK DLL 引用方式):https://github.com/znlgis/FY_Layout
  • 主程序源码:未公开发布;原 github.com/znlgis/lightcad1 已 404,请走启道软件官方渠道
  • 关键章节:第 3 章(分层架构)、第 15 章(插件系统与扩展开发)、第 16 章(命令与操作系统)

Frequently asked questions

What does the Lightcad AI skill do?

Use when extending the FeiYang LightCAD platform (C#/.NET 8) — implementing ILcPlugin, registering ElementType / ElementActions, [CommandClass] + [CommandMethod] commands, plugins.json loading, DwgReader.Import / SaveDwg workflows; also when a plugin DLL is not loaded, dispatching to a command does nothing, or a build fails on ThreeJs4Net.dll / OpenTK.dll or does not support targeting .NET 8. Source is not publicly released; API facts here track the platform SDK used by znlgis/FY_Layout.

Why use Lightcad on TypingMind?

Because you install it once and use it with any model. Lightcad is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lightcad in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/znlgis/opengis-skills/tree/main/cad/lightcad. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Lightcad?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lightcad?

As many as you like. As long as a model supports skills, you can use Lightcad with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lightcad AI skill free?

Yes. It is published on GitHub by znlgis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇