Request

Response

    Core

    Autodesk.Viewing.Private.Preferences

    new Preferences(viewer,options)

    Application preferences.

    Optionally uses web storage.

    Each preference value can have tags associated to them. Developer supported tags are:

    • ‘ignore-producer’
    • ‘no-storage’
    • ‘2d’
    • ‘3d’

    Use tag ‘ignore-producer’ in extensions to avoid having developer-defined render settings overridden by the loaded file.

    Use tag ‘no-storage’ in extensions to avoid having User Preferences (from Settings Panel) override default or developer-defined preferences. Useful for render settings.

    Preferences may apply to all model types, only 2D models (with tag ‘2d’) or 3D models only (with tag ‘3d’).

    Parameters

    Expand all
    viewer*Viewer instance.
    options*
    object
    Contains configuration parameters used to do initializations.
    localStorage
    boolean
    Whether values get stored and loaded back from localStorage. Defaults to true.
    prefix
    string
    A string to prefix preference names in web storage. Defaults to 'Autodesk.Viewing.Preferences.'.
    * Required

    Methods

    add(name,defaultValue,tags)

    Adds a new preference name + default value. This preference was not previously loaded via load().

    Parameters

    name*
    string
    Preference name.
    defaultValue*
    *
    Preference default value.
    tags
    Array.<string>|string
    Optional tags.
    * Required

    Returns

    TypeDescription
    boolean True if the preference was added.

    addListeners(name,onChangedCallback,onResetCallback)

    Listen for preference changed and reset events.

    Parameters

    name*
    string
    Preferences name.
    onChangedCallback*
    function
    Function called when preferences are changed.
    onResetCallback*
    function
    Function called when preferences are reset.
    * Required

    get()

    Get named preference value. Shortcut: prefs[name]

    Returns

    TypeDescription
    * Preference value.

    hasTag(name,tag)

    Checks whether a tag is associated to a name

    Parameters

    name*
    string
    Preference name
    tag*
    string
    The tag to check for
    * Required

    load(defaultValues)

    Load preference values from web storage/defaults.

    Parameters

    defaultValues*
    object
    Preference names and their default values.
    * Required

    remove(name,removeFromWebStorage)

    Removes an existing preference.

    Parameters

    name*
    string
    Preference name.
    removeFromWebStorage
    boolean
    True to clear the web storage entry for this preference.
    * Required

    Returns

    TypeDescription
    boolean True if the preference was removed.

    removeListeners(name)

    Remove listeners for preference changed and reset events.

    Parameters

    name*
    string
    Preferences name.
    * Required

    reset(tag,include)

    Reset preferences to default values. If a tag is specified, then only certain preferences are reset.

    Parameters

    tag
    string
    Optional tag.
    include
    boolean
    True to reset only preferences with matching tags.

    set(name,value,notify)

    Set named preference value. Value is not persisted if tag ‘no-storage’ is set. Do not use shortcut prefs[name] = value.

    Parameters

    name*
    string
    Preference name.
    value*
    *
    Preference value.
    notify
    boolean
    If true then av.PREF_CHANGED_EVENT is fired.
    * Required

    Returns

    TypeDescription
    boolean True if the value changed, false otherwise.

    tag(tag,names)

    Adds a tag to the specified preferences. These are used by reset().

    Parameters

    tag*
    string
    names
    Array.<string>|string
    Preference names, default all preferences.
    * Required

    untag(tag,names)

    Removes a tag from the specified preferences. These are used by reset().

    Parameters

    tag*
    string
    names
    Array.<string>|string
    Preference names, default all preferences.
    * Required
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.