OnEndFileImport (XSIApplication)
Description
Fired after an XSI file is imported as a result of a command such as ImportModel. This is valid for Model (.emdl), dotXSI (.xsi), mixer (.mixer), IGES (.iges) and material library (.matlib).
This event is installed using the XSIApplication.Advise method and can be removed using the XSIApplication.Unadvise method, please see these methods for a detailed example of installing and uninstalling events.
The event may be temporarily muted via the EventInfo.Mute property. All installed events can be viewed in the plugin manager dialog's event tab.
NOTE: The prefered and alternative method of installing this is event is as a self-installing plugin. See PluginRegistrar.RegisterEvent method for more details.
Scripting Syntax
XSIApplication.OnEndFileImport ([CustomData], [FileName], [FileType], [Parent], [Reference], [Name])
Parameters
Parameter |
Type |
Description |
CustomData |
Variant |
Custom data passed to the event handler. This argument is optional; you can specify one when binding an event with XSIApplication.Advise. The data is passed to the event handler whenever the event is fired, an empty value is passed if no custom data is specified. |
FileName |
String |
The filename from where the model is imported. |
FileType |
siFileType |
The type of file to import. The supported types are: siFileTypeModel, siFileTypedotXSI, siFileTypeMixer, siFileTypeIGES, siFileTypeMatLib |
Parent |
X3DObject |
The parent of the model. |
Reference |
Boolean |
True if the model is imported as a referenced model. (Only applies for Model (.emdl) and dotXSI (.xsi) ) |
Name |
String |
The name of the newly created model. |
Return Value
Boolean (true to abort operation).
Examples
1. VBScript Example
sub XSIApplication_OnEndFileImport( CustomData, FileName, FileType, Parent, Referenced, ModelName) logmessage "*** from XSIApplication_OnEndFileImport: ***" ' your code here ' return consumed status in return code end sub
2. JScript Example
function XSIApplication::OnEndFileImport( CustomData, FileName, FileType, Parent, Referenced, ModelName )
{
Application.LogMessage( "*** JScript Event - XSIApplication::OnEndFileImport ***");
// your code here
// return consumed status in return code
return 0;
}
3. PerlScript Example
sub XSIApplication_OnEndFileImport
{
my ($CustomData, $Filename, $FileType, $Parent, $Referenced, $ModelName) = @_;
$Application->LogMessage( "*** PerlScript Event - XSIApplication_OnEndFileImport ***" );
# your code here
# return consumed status in return code
return 0;
}
4. Python Example
def XSIApplication_OnEndFileImport( CustomData, FileName, FileType, Parent, Referenced, ModelName): # XSI will return a raw PyIDispatch for object model items. This # object needs to be wrapped in a dynamic dispatch before use. import win32com.client.dynamic Parent = win32com.client.dynamic.Dispatch(cParent) Application.LogMessage( '*** PythonScript Event - XSIApplication_OnEndFileImport parent is %s ***'%(Parent.Name,) ) # your code here # return consumed status in return code return 0
See Also
PluginRegistrar.RegisterEvent |
|||
XSIApplication.EventInfos |
|