public static string CategoryName(this IBHoMObject bHoMObject) { string name = bHoMObject?.GetRevitIdentifiers()?.CategoryName; if (string.IsNullOrWhiteSpace(name) && bHoMObject is IInstance) { name = ((IInstance)bHoMObject).Properties.CategoryName; } return(name); }
public static int ElementId(this IBHoMObject bHoMObject) { if (bHoMObject == null) { return(-1); } RevitIdentifiers identifiers = bHoMObject.GetRevitIdentifiers(); if (identifiers != null) { return(identifiers.ElementId); } else { return(-1); } }
public static int HostId(this IBHoMObject bHoMObject) { int id = -1; RevitIdentifiers identifiers = bHoMObject?.GetRevitIdentifiers(); if (identifiers != null) { id = identifiers.HostId; } if (id != -1 && bHoMObject is ModelInstance && ((ModelInstance)bHoMObject).HostId != id) { BH.Engine.Reflection.Compute.RecordWarning("The object is a ModelInstance pulled from Revit with overwritten HostId property - the value of the latter is returned instead of the value from RevitIdentifiers."); id = ((ModelInstance)bHoMObject).HostId; } return(id); }
public static string FamilyTypeName(this IBHoMObject bHoMObject) { return(bHoMObject?.GetRevitIdentifiers()?.FamilyTypeName); }
public static string UniqueId(this IBHoMObject bHoMObject) { return(bHoMObject?.GetRevitIdentifiers()?.UniqueId); }
public static string LinkPath(this IBHoMObject bHoMObject) { return(bHoMObject?.GetRevitIdentifiers()?.LinkPath); }
public static string Workset(this IBHoMObject bHoMObject) { return(bHoMObject?.GetRevitIdentifiers()?.Workset); }