Getting the default value of a parameter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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?