accessing XSIUtils, XSIMath, ... in netview

96 views
Skip to first unread message

Matt Lind

unread,
Jun 15, 2012, 6:51:47 PM6/15/12
to soft...@listproc.autodesk.com

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

 

 

Matt Lind

unread,
Jun 15, 2012, 6:58:27 PM6/15/12
to soft...@listproc.autodesk.com

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

Alan Fregtman

unread,
Jun 16, 2012, 7:07:53 PM6/16/12
to soft...@listproc.autodesk.com
And to complete the collection, don't forget:
XSIUIToolkit = 'XSI.UIToolkit'
XSIDialog = "XSIDial.XSIDialog"

By the way, not sure in JS but in Python when getting the XSI.Application object, I have to get ".Application" from it to get the real Application object.
Reply all
Reply to author
Forward
0 new messages