添加项目文件。

This commit is contained in:
ShrlAlgo
2025-09-16 16:06:41 +08:00
parent 0e7807b826
commit 98c65ceb3d
922 changed files with 1009489 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
var selectedIds = uidoc.Selection.GetElementIds();
using (Transaction tx = new Transaction(doc, "修改参数"))
{
tx.Start();
foreach (ElementId id in selectedIds)
{
Element elem = doc.GetElement(id);
Parameter param = elem.LookupParameter("参数名称"); // 替换实际参数名
// 或者使用内置参数elem.get_Parameter(BuiltInParameter.参数枚举)
if (param != null && !param.IsReadOnly)
{
// 根据参数类型设置值
if (param.StorageType == StorageType.String)
param.Set("新值");
else if (param.StorageType == StorageType.Double)
param.Set(123.45);
}
}
tx.Commit();
}
uidoc.RefreshActiveView(); // 刷新界面显示新值