示例#1
0
 protected void AssertValidDocument(DB.Document doc, string paramName)
 {
     if (!(doc?.Equals(Document) ?? false))
     {
         throw new System.ArgumentException("Invalid Document", paramName);
     }
 }
示例#2
0
        new public static Category FromElementId(DB.Document doc, DB.ElementId id)
        {
            if (id.IsCategoryId(doc))
            {
                return(new Category(doc, id));
            }

            return(null);
        }
示例#3
0
        new public static ParameterKey FromElementId(DB.Document doc, DB.ElementId id)
        {
            if (id.IsParameterId(doc))
            {
                return(new ParameterKey(doc, id));
            }

            return(null);
        }
示例#4
0
        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);
        }
示例#5
0
 public Category(DB.Document doc, DB.ElementId id) : base(doc, id)
 {
 }
示例#6
0
 internal Element(DB.Document doc, DB.ElementId id) : base(doc, id)
 {
 }