diff --git a/src/UI/WPF/Views/AliasTreeControl.xaml.cs b/src/UI/WPF/Views/AliasTreeControl.xaml.cs index a3a8cf3..468a27b 100644 --- a/src/UI/WPF/Views/AliasTreeControl.xaml.cs +++ b/src/UI/WPF/Views/AliasTreeControl.xaml.cs @@ -345,7 +345,7 @@ namespace NavisworksTransport.UI.WPF.Views { if (modelItem == null) return null; - string displayName = modelItem.DisplayName ?? "?"; + string displayName = !string.IsNullOrEmpty(modelItem.DisplayName) ? modelItem.DisplayName : "几何对象"; // 父节点 key 可能是完整格式 "IndexPath||DisplayPath",也可能是 ".../name#N" // 只取纯 DisplayPath 部分(去掉 || 前缀和结尾的 #N 后缀) string parentPath = parentDisplayPath; @@ -416,7 +416,7 @@ namespace NavisworksTransport.UI.WPF.Views var nameCount = new Dictionary(); foreach (var childItem in item.Children) { - string name = childItem.DisplayName ?? "?"; + string name = !string.IsNullOrEmpty(childItem.DisplayName) ? childItem.DisplayName : "几何对象"; nameCount.TryGetValue(name, out int count); int siblingIdx = count; nameCount[name] = count + 1;