Application.dataFileCopyComplete Event

Parent Object: Application
Defined in namespace "adsk::core" and the header file is <Core/Application/Application.h>

Description

The dataFileCopyComplete event fires when a data file copy has completed including any PIM Data copy.

Syntax

-------- Import ---------
# Import fusion360utils folder, which includes event_utils.py.
from ...lib import fusion360utils as futil

-------- Global variables ---------
# Global variable used to maintain a reference to all event handlers.
local_handlers = []

-------- Connect the handler to the event. ---------
# "application_var" is a variable referencing an Application object.
# "application_dataFileCopyComplete" is the event handler function.
futil.add_handler(application_var.dataFileCopyComplete, application_dataFileCopyComplete, local_handlers=local_handlers)

-------- Event handler function definition ---------
# Event handler for the dataFileCopyComplete event.
def application_dataFileCopyComplete(args: adsk.core.DataEventArgs):
# Code to react to the event.
app.log('In application_dataFileCopyComplete event handler.')
-------- Global variables ---------
# Global variable used to maintain a reference to all event handlers.
handlers = []

-------- Connect the handler to the event. ---------
# "application_var" is a variable referencing an Application object.
# "MyDataFileCopyCompleteHandler" is the name of the class that handles the event.
onDataFileCopyComplete = MyDataFileCopyCompleteHandler()
application_var.dataFileCopyComplete.add(onDataFileCopyComplete)
handlers.append(onDataFileCopyComplete)

-------- Event handler class definition ---------
# Event handler for the dataFileCopyComplete event.
class MyDataFileCopyCompleteHandler(adsk.core.DataEventHandler):
def __init__(self):
super().__init__()
def notify(self, args: adsk.core.DataEventArgs):
# Code to react to the event.
app.log('In MyDataFileCopyCompleteHandler event handler.')
--------- Required include files. ---------
#include <Core/Application/Application.h>
#include <Core/Dashboard/DataEvent.h>
#include <Core/Dashboard/DataEventHandler.h>
#include <Core/Dashboard/DataEventArgs.h>


--------- Event handler class definition and global declaration. ---------
// Event handler for the dataFileCopyComplete event.
class MyDataFileCopyCompleteEventHandler : public adsk::core::DataEventHandler
{
public:
void notify(const Ptr<DataEventArgs>& eventArgs) override
{
// Code to react to the event.
ui->messageBox("In MyDataFileCopyCompleteEventHandler event handler.");
}
} _dataFileCopyComplete;

--------- Connect the handler to the event. ---------
// "application_var" is a variable referencing an Application object.
// Connect the handler function to the event.
Ptr<DataEvent> dataFileCopyCompleteEvent = application_var->dataFileCopyComplete();
if (!dataFileCopyCompleteEvent)
return;

bool isOk = dataFileCopyCompleteEvent->add(&_dataFileCopyComplete);
if (!isOk)
return;

Property Value

This is an event property that returns a DataEvent.

Version

Introduced in version October 2023