Getting the default value of a parameter?

Getting the default value of a parameter?

Anonymous
Not applicable
1,133 Views
3 Replies
Message 1 of 4

Getting the default value of a parameter?

Anonymous
Not applicable

I need to detect if a parameter value has been changed from the default value.

Previously I did this by checking the default value of that parameter when such an element was added to the document via an IUpdater and then comparing my saved default value to the current value for each instance when it was time to do my calculations.

The issue with that solution is that it isn't backwards compatible, it has to detect a changed value also in old project files that where made when I didn't have the IUpdater so I can't rely on that the user will add such an element before they run my calculations.

 

I was hoping that there would be an easy way of reading the default value of a parameter but I can't find one so I'm left with the idea of opening the .rfa file of the element and somehow read the parameter value from there. I've tried to add a new element programmatically in order to read the parameter from it and then delete it again but I can't manage to create one since the Element class doesn't have a constructor and for some reason using the Document.newFamilyInstance(..) method only gives me compile errors.

 

Does anyone have any ideas about how I can achieve this?

0 Likes
1,134 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Shouldn't the familySymbol parameter values be the defaults?
0 Likes
Message 3 of 4

Anonymous
Not applicable

Yes it looks like the symbol should have the default parameter values, I'm going to try that 🙂

0 Likes
Message 4 of 4

PaulCollins7972
Advocate
Advocate

I am trying to do the same thing, i.e. get the default value of an instance parameter.

 

My testing shows that the family symbol has the type parameters but not the instance parameters.

 

Any one got any ideas how to get the default value?

 

Paul