Application.mfgdmDataReady Event
Parent Object:
Application
This functionality is provided as a preview
of intended future API capabilities. You are encouraged to use it and report any problems or suggestions using the
Fusion API and Scripts forum.
Because this is a preview of future functionality, there is the possibility that it will change, which will possibly
break any existing programs that use this functionality. Because of that, you should never deliver any programs that use
any preview capabilities. For a distributed program, you should wait until it has moved from preview to released state.
Defined in namespace "adsk::core" and the header file is <Core/Application/Application.h>
Description
The mfgdmDataReady event fires when the MFGDM data structure for a document has been updated and properties to IDs and structure from the data model is ready.
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_mfgdmDataReady" is the event handler function. futil.add_handler(application_var.mfgdmDataReady, application_mfgdmDataReady, local_handlers=local_handlers)
-------- Event handler function definition ---------
# Event handler for the mfgdmDataReady event. def application_mfgdmDataReady(args: adsk.core.MFGDMDataEventArgs): # Code to react to the event. app.log('In application_mfgdmDataReady 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. # "MyMfgdmDataReadyHandler" is the name of the class that handles the event. onMfgdmDataReady = MyMfgdmDataReadyHandler() application_var.mfgdmDataReady.add(onMfgdmDataReady) handlers.append(onMfgdmDataReady)
-------- Event handler class definition ---------
# Event handler for the mfgdmDataReady event. class MyMfgdmDataReadyHandler(adsk.core.MFGDMDataEventHandler): def __init__(self): super().__init__() def notify(self, args: adsk.core.MFGDMDataEventArgs): # Code to react to the event. app.log('In MyMfgdmDataReadyHandler event handler.')
|
--------- Required include files. ---------
#include <Core/Application/Application.h> #include <Core/Application/MFGDMDataEvent.h> #include <Core/Application/MFGDMDataEventHandler.h> #include <Core/Application/MFGDMDataEventArgs.h>
--------- Event handler class definition and global declaration. ---------
// Event handler for the mfgdmDataReady event. class MyMfgdmDataReadyEventHandler : public adsk::core::MFGDMDataEventHandler { public: void notify(const Ptr<MFGDMDataEventArgs>& eventArgs) override { // Code to react to the event. ui->messageBox("In MyMfgdmDataReadyEventHandler event handler."); } } _mfgdmDataReady;
--------- Connect the handler to the event. ---------
// "application_var" is a variable referencing an Application object. // Connect the handler function to the event. Ptr<MFGDMDataEvent> mfgdmDataReadyEvent = application_var->mfgdmDataReady(); if (!mfgdmDataReadyEvent) return;
bool isOk = mfgdmDataReadyEvent->add(&_mfgdmDataReady); if (!isOk) return;
|
Property Value
This is an event property that returns a
MFGDMDataEvent.
Samples
Version
Introduced in version July 2025