Hello, I'm attempting to get the list of views from an open model and seem to be getting an error rather than the list of views. Hoping someone can point out where I've gone wrong below or if there's a Creoson error. I'm running this code in the playground window.
The file name is test.prt and there is a view inside the model named "FRONT".
let fileObj = new creo.FileObj();
fileObj.display = true;
fileObj.activate = true;
fileObj.file = 'test.prt';
fileObj.new_window = true;
let bFileOpen = 0;
bFileOpen = fileObj.open();
if (bFileOpen <= 0) {
alert("Fileopen failed = " + fileObj.file);
}
let dMV = new creo.ViewObj();
dMV.file = fileObj.file;
dMV.name = "FRONT";
dMV.list()
.then(function(arViewList){
//Error: The list function appears to return something valid
//but arViewList[0] is undefined.
alert('Array View List = ' + arViewList[0]);
})
.catch((err) => {
alert('ERROR: '+err);
});
Hello, I'm attempting to get the list of views from an open model and seem to be getting an error rather than the list of views. Hoping someone can point out where I've gone wrong below or if there's a Creoson error. I'm running this code in the playground window.
The file name is test.prt and there is a view inside the model named "FRONT".