1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using Autodesk.Revit.DB;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FWindSoft.Revit
- {
- public static class FamilyInstanceExtension
- {
- /// <summary>
- /// 获取FamilyInstance的FamilySymbol
- /// </summary>
- /// <param name="familyInstance"></param>
- /// <returns></returns>
- public static FamilySymbol GetFamilySymbol(this FamilyInstance familyInstance)
- {
- FamilyInstance finst = familyInstance;
- if (familyInstance != null)
- {
- return finst.Symbol;
- }
- return null;
- }
- /// <summary>
- /// 获取FamilyInstance的Family
- /// </summary>
- /// <param name="familyInstance"></param>
- /// <returns></returns>
- public static Family GetFamily(this FamilyInstance familyInstance)
- {
- FamilyInstance finst = familyInstance;
- if (familyInstance != null)
- {
- return finst.Symbol?.Family;
- }
- return null;
- }
- }
- }
|