02-13-2024, 11:17 AM
(This post was last modified: 02-18-2024, 11:54 AM by Rick Johnson.)
I need to be notified of new symbols added to the Symbols panel.
I have an ArtSymbolSetDetailedChangeNotifierType notifier (ArtSymbolSetChangedNotifierType crashes on startup) and also acquired the SDK AISymbolSuite. The callback works when needed, but how can I acquire the AISymbolSetChangeNotifierData that is supposed to accompany it?
A similar approach for ArtObjectsChangedNotification does return a vector of UUIDs to changed art objects.
Any suggestions would be much appreciated.
I have an ArtSymbolSetDetailedChangeNotifierType notifier (ArtSymbolSetChangedNotifierType crashes on startup) and also acquired the SDK AISymbolSuite. The callback works when needed, but how can I acquire the AISymbolSetChangeNotifierData that is supposed to accompany it?
Code:
#include "hdicoreNotification.h"
hdi::core::Notifier symbolSetChangedNotifier;
this->symbolSetChangedNotifier = hdi::core::Notifier(hdi::core::ArtSymbolSetDetailedChangeNotifierType,
HDI_CORE_CALLBACK(plug::Plugin, this, __symbolSetChangedCB));
this->__corePlug->dispatcher()->registerNotifier(this->symbolSetChangedNotifier);
void plug::Plugin::__symbolSetChangedCB(){
hdi::core::Message* msg = this->__corePlug->dispatcher()->lastMessage();
if (msg->type() != hdi::core::NotifyMessageType)
return;
hdi::core::NotifyMessage* nMsg = reinterpret_cast<hdi::core::NotifyMessage*>(msg);
//the next line is a problem
hdi::core::ArtSymbolSetChangedNotification* mySymbolNotification =
reinterpret_cast <hdi::core::ArtSymbolSetChangedNotification*> (nMsg->notification());
//mySymbolNotification is NULL, otherwise it seems the next line ought to work
hdi::core::ArtSymbolSetChangedNotification::SymbolVector symV = mySymbolNotification->addedSymbols();
}
A similar approach for ArtObjectsChangedNotification does return a vector of UUIDs to changed art objects.
Any suggestions would be much appreciated.