Autodesk.Viewing
ProfileManager
The ProfileManager provides a mechanism for registering profile settings with a specific file type. Any of the registered profiles can be set by using viewer.setProfile().
new ProfileManager()
Examples
const profileManager = new Autodesk.Viewing.ProfileManager();
// or
// const profileManger = viewer.profileManager;
const profileSettings = {
name: "DWF",
settings: {
swapBlackAndWhite: true
},
// ...
}
// Registers the specified profile settings for dwf models.
profileManager.registerProfile('dwf', profileSettings);
const profile = profileManager.getProfile('dwf'); // others: 'default', 'nwc', 'nwd', 'rvt', 'ifc'
viewer.setProfile(profile);
Show More
Methods
registerProfile(fileExt, profileSettings)
Registers a profile. The profile will be overridden if a profile was already registered with the ProfileManager.
Parameters
fileExt* String | file extension to register the profile settings with. |
profileSettings* | profile settings object or profile instance to register |
* Required
unregisterProfile(fileExt)
Unregister the profile associated with a file type
Parameters
fileExt* String | file type |
* Required
getProfileOrDefault(fileExt)
Returns a profile that is registered with the specific file type. If the file type is not registered, then the default profile is returned.
Parameters
fileExt* String | file extension |
* Required
Returns
type | description |
---|---|
Autodesk.Viewing.Profile |
|