Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66664

Re: Clear family type parameter value

$
0
0

Hi,

As far as I know there's no way to reset the value to .HasValue=false (other than deleting and re-creating the parameter).

You must have the same parameters for each 'type', it's only their values that can vary.

 

With respect to clearing/resetting parameter values, Revit behaves a bit oddly with these types of things. (Such as using filteredElementCollector with parameterValueProvider when filtering for a null/0.0 double value. You have to filter for .HasValue=false and also .Hasvalue=true and value=0.0.)

Somebody who knows more about nullable types can probably tell you more, but the workaround I would use would be setting the default value.

For integer this would be 0, for ElementId it would be Elementid.InvalidElementId, for double it would be 0.0, for text it would be an empty string.

The .HasValue property would NOT be reset.

 

If you explain exactly what you're trying to achieve I may be able to help further.

 

-Matt

 


Viewing all articles
Browse latest Browse all 66664

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>