AnsweredAssumed Answered

How to tell if a setting enum is a system or document in API?

Question asked by Eric Snyder on Mar 3, 2020
Latest reply on Mar 4, 2020 by Eric Snyder

I am aware of this page that spells out the basics of settings and how to use get and set functions. I am attempting to write a class that gets and sets the various settings. My issue is that all of these setting basically distill down to five or six functions. For example:

ISldWorks::SetUserPreferenceDoubleValue

ISldWorks::SetUserPreferenceIntegerValue

ISldWorks::SetUserPreferenceStringListValue

ISldWorks::SetUserPreferenceStringValue

ISldWorks::SetUserPreferenceToggle

 

*or*

IModelDocExtension::SetUserPreferenceDouble

IModelDocExtension::SetUserPreferenceInteger

IModelDocExtension::SetUserPreferenceString

IModelDocExtension::SetUserPreferenceTextFormat

IModelDocExtension::SetUserPreferenceToggle

I am trying to prevent errors by using either the wrong method (ISldWorks vs IModelDocExtension) or trying to set a system setting using the IModelDocExtension function.

 

Does anybody have any advice on this?

Is ISldWorks::SetUserPreferenceDoubleValue and IModelDocExtension::SetUserPreferenceDouble the exact same function or do they check if the setting is in fact a model or system setting before trying?

 

How does this work?

Outcomes