using Autodesk.Revit.DB; using FWindSoft.Revit.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FWindSoft.Revit { public static class ElementTypeExtension { /// /// 复制增加图元类型 /// /// /// /// /// public static T DuplicateT(this ElementType elementType, string strName) where T : ElementType { if (strName.Length > 128) { strName = strName.Substring(0, 127); } strName = RevitTools.RemoveForbiddenChars(strName); return elementType.Duplicate(strName) as T; } } }