

























问题描述:编译时提示"未能找到类型或命名空间名LightCAD"
解决方案:
..\Libs\<!-- 确保引用路径正确 -->
<Reference Include="LightCAD.Core">
<HintPath>..\Libs\LightCAD.Core.dll</HintPath>
</Reference>
问题描述:飞扬主程序启动后看不到"场布"工具栏
排查步骤:
<BaseOutputPath>..\Build</BaseOutputPath>)问题描述:编译提示目标框架不支持
解决方案:
net10.0-windows排查清单:
□ 元素类型已在LayoutElementType.All数组中注册
□ ElementAction已在Loaded()中添加到LcDocument.ElementActions
□ 元素Layer属性已设置且图层可见
□ ResetBoundingBox()已调用
□ InsertElement()已调用
□ 元素的Outline/BaseCurve有有效几何数据
常见原因:GUID重复。每个元素类型的GUID必须全局唯一。
// 错误示例:Road和Ground使用了相同的GUID
public static ElementType Road = new ElementType
{
Guid = Guid.ParseExact("{85AB36C8-FBB1-424B-C7C4-1F92576EC5BD}", "B").ToLcGuid(),
// ...
};
public static ElementType Ground = new ElementType
{
Guid = Guid.ParseExact("{85AB36C8-FBB1-424B-C7C4-1F92576EC5BD}", "B").ToLcGuid(),
// ... 注意:与Road相同的GUID!
};
解决方案:为每个元素类型生成唯一的GUID。
问题描述:使用LawnChange等转换命令时无法创建元素
原因:选择的线段无法组成闭合环路
解决方案:
排查步骤:
原因:三角面片顶点顺序不一致
解决方案:确保所有面片使用逆时针顶点顺序(面向观察者时)。对于基坑等双面显示的元素,需要同时生成正反两个面:
var pitB = new PlanarSurface3d(new Plane(new Vector3(0, 0, 1)), curves);
var pitT = new PlanarSurface3d(new Plane(new Vector3(0, 0, -1)), curves);
常见原因:
// 确保轮廓为逆时针方向
if (ShapeUtils.isClockWise(outline.Curve2ds
.SelectMany(n => n.GetPoints(2)).ToListEx()))
{
outline.Reverse();
}
FY_Layout中多个命令使用了相同的快捷键"W"(如Fence、PlateBuilding等),这会导致快捷键冲突。
解决方案:自定义插件时使用唯一的快捷键。
原因:PropertyObserver的Setter中未调用OnPropertyChangedBefore/After
// 正确的属性设置流程
Setter = (ele, value) =>
{
var lawn = ele as QdLawn;
if (!double.TryParse(value.ToString(), out var bottom)) return;
lawn.OnPropertyChangedBefore("Bottom", lawn.Bottom, bottom); // ①
lawn.Properties.SetValue("Bottom", bottom); // ②
lawn.ResetCache(); // ③
lawn.OnPropertyChangedAfter("Bottom", lawn.Bottom, bottom); // ④
}
优化建议:
优化建议:
本章汇总了FY_Layout开发中最常见的问题及其解决方案,涵盖开发环境、元素创建、三维显示、UI命令和性能优化五大类。建议开发者在遇到问题时首先参考本章的排查清单。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。