From 1f645778ae80a3a8801b8bb4d0fcf8feb244ad43 Mon Sep 17 00:00:00 2001 From: chr <chr@mailcom> Date: 星期三, 09 十月 2024 11:51:23 +0800 Subject: [PATCH] 完善项目,新增插件启用检测; --- PdmSwPlugin.Common/Util/CustomPropertyUtil.cs | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/PdmSwPlugin.Common/Util/CustomPropertyUtil.cs b/PdmSwPlugin.Common/Util/CustomPropertyUtil.cs index 790597c..f40a1f3 100644 --- a/PdmSwPlugin.Common/Util/CustomPropertyUtil.cs +++ b/PdmSwPlugin.Common/Util/CustomPropertyUtil.cs @@ -159,6 +159,21 @@ return true; } + public static string GetMass(ModelDoc2 doc) + { + var cpm = doc?.Extension; + if (cpm == null) + { + return null; + } + double[] values = cpm.GetMassProperties2(0, out _, false); + if (values == null) + { + return null; + } + return values[5].ToString(); + } + public static bool SetCustomProperties(ModelDoc2 doc, string key, string value) { CustomPropertyManager cpm = doc.Extension.CustomPropertyManager[""]; -- Gitblit v1.9.1