Nevermind. Figured it out:
try {
var oXSIFactory = new ActiveXObject( "XSI.Factory" );
var Application = oXSIFactory.CreateActiveXObject(
"XSI.Application" );
var XSIMath = oXSIFactory.CreateActiveXObject( "XSI.Math"
);
var XSIUtils = oXSIFactory.CreateActiveXObject( "XSI.Utils"
);
} catch(e) {
// Cannot access XSI, we're not running in Netview.
Application.LogMessage( e.description );
var Application = null;
}
This should be documented, but isn't.
Matt
From: [email protected]
[mailto:[email protected]] On Behalf Of Matt Lind
Sent: Friday, June 15, 2012 3:52 PM
To: [email protected]
Subject: accessing XSIUtils, XSIMath, ... in netview
Anybody know how to get access to global intrinsic objects in netview?
I can get reference to XSIFactory and Application just fine, but when I use the
same technique to get a reference to XSIUtils, XSIMath, or any of the other
global objects, netview throws errors.
try {
var oXSIFactory = new ActiveXObject( "XSI.Factory" );
// OK
var Application = oXSIFactory.CreateActiveXObject(
"XSI.Application" ); // OK
var XSIMath = oXSIFactory.CreateActiveXObject(
"XSI.XSIMath" ); // fail
var XSIUtils = oXSIFactory.CreateActiveXObject(
"XSI.XSIUtils" ); // fail
} catch(e) {
// Cannot access XSI, we're not running in Netview.
Application.LogMessage( e.description );
var Application = null;
}
// throws error:
Application.LogMessage( "'" + XSIUtils.Slash + "'" );
Thanks,
Matt