SView Help Center
English (US)

Open Model

Author: sviewngts Last Updated: 2026-10-29 16:58

   Opening a model must be performed only after all of the following configuration files have been loaded: systemParameters.json, documentParameters.json, and commandParameters.json. For reference, see the initOnline method in main_local.js.

   The specific model-opening logic is as follows:

let openCommand = null;
if (ret) {
	openCommand = commandsManager.getCommand(SView.Commands.CommandNames.OPENSAMPLEFILE);
} else {
	// No configuration file
	let array = new Map();
	array.set("fullClassName", "SView.Commands.OpenCommand");
	openCommand = commandsManager.getCommand(SView.Commands.CommandNames.OPENSAMPLEFILE, array);
}
if (svlxInfo.length === 1) {
	openCommand.fileInfo = svlxInfo[0];
} else {
	for (let fileInfo of svlxInfo) {
		if (fileInfo.directPara.get('downloadUrl')) {
			openCommand.addPath(fileInfo.directPara.get('downloadUrl'));
		}
	}
}