protected void AssertValidDocument(DB.Document doc, string paramName) { if (!(doc?.Equals(Document) ?? false)) { throw new System.ArgumentException("Invalid Document", paramName); } }
new public static Category FromElementId(DB.Document doc, DB.ElementId id) { if (id.IsCategoryId(doc)) { return(new Category(doc, id)); } return(null); }
new public static ParameterKey FromElementId(DB.Document doc, DB.ElementId id) { if (id.IsParameterId(doc)) { return(new ParameterKey(doc, id)); } return(null); }
public static Element FromReference(DB.Document doc, DB.Reference reference) { if (doc.GetElement(reference) is DB.Element value) { if (value is DB.RevitLinkInstance link) { if (reference.LinkedElementId != DB.ElementId.InvalidElementId) { var linkedDoc = link.GetLinkDocument(); return(FromValue(linkedDoc?.GetElement(reference.LinkedElementId))); } } return(FromElement(value)); } return(null); }
public Category(DB.Document doc, DB.ElementId id) : base(doc, id) { }
internal Element(DB.Document doc, DB.ElementId id) : base(doc, id) { }