Exemple #1
0
        private void SetParameterValue(Autodesk.Revit.DB.Parameter param, SIUnit value)
        {
            if(param.StorageType != StorageType.Double)
                throw new Exception("The parameter's storage type is not an integer.");

            param.Set(value.ConvertToHostUnits());
        }
Exemple #2
0
        private void SetParameterValue(Autodesk.Revit.DB.Parameter param, bool value)
        {
            if (param.StorageType != StorageType.Integer)
                throw new Exception("The parameter's storage type is not an integer.");

            param.Set(value == false ? 0 : 1);
        }
Exemple #3
0
        private void SetParameterValue(Autodesk.Revit.DB.Parameter param, string value)
        {
            if (param.StorageType != StorageType.String)
                throw new Exception("The parameter's storage type is not a string.");

            param.Set(value);
        }
Exemple #4
0
        private void SetParameterValue(Autodesk.Revit.DB.Parameter param, int value)
        {
            if (param.StorageType != StorageType.Integer && param.StorageType != StorageType.Double)
                throw new Exception("The parameter's storage type is not a number.");

            param.Set(value);
        }
Exemple #5
0
        private void SetParameterValue(Autodesk.Revit.DB.Parameter param, Revit.Elements.Element value)
        {
            if (param.StorageType != StorageType.ElementId)
                throw new Exception("The parameter's storage type is not an Element.");

            param.Set(value.InternalElementId);
        }
Exemple #6
0
 private void SetParameterValue(Autodesk.Revit.DB.Parameter param, string value)
 {
     param.Set(value);
 }