Ejemplo n.º 1
0
 public SerialParameter(string Name, string Value, SerialElementId ValueElemId, string StorageType, int Id, string GUID, bool IsShared, bool IsReadOnly)
 {
     this.Name        = Name;
     this.Value       = Value;
     this.ValueElemId = ValueElemId;
     this.StorageType = StorageType;
     this.Id          = Id;
     this.GUID        = GUID;
     this.IsShared    = IsShared;
     this.IsReadOnly  = IsReadOnly;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Depending on SerialElementId properties, method attempts to find the Element referenced by the ElementId by first trying UniqueId, then Id, then Name, then Aliases of the name.  If an element is found, then set the parameter to the Element's Id.
        /// </summary>
        /// <param name="param">Parameter to modify</param>
        /// <param name="serialElementId">A SerialElementId that references an element in the Document.</param>
        /// <param name="document">A revit document</param>
        /// <returns name="status">Returns true if parameter was successfully set and false if not.  Parameter retains it previous value if Set was unsucessful.</returns>
        private static bool _ModifyElementIdParameter(RevitParam param, SerialElementId serialElementId, RevitDoc document)
        {
            //  Initialize variables.
            // Status of parameter change.
            bool status = false;

            //  Element to set the ElementId parameter.
            //  Will return null if element is not found.
            RevitElem elem = serialElementId.GetElem(document);

            //  If elem was selected, then set the parameter to that element.
            if (elem != null)
            {
                status = param.Set(elem.Id);
            }

            // Return if parameter change was successful.
            return(status);
        }
Ejemplo n.º 3
0
 public static string ToJSON(SerialElementId IdJSON)
 {
     return(JsonConvert.SerializeObject(IdJSON, Formatting.Indented));
 }