Jord Visser Posted November 4, 2019 Share Posted November 4, 2019 I'm trying to set-up a PIO with support for 'red' symbols. I tried digging trough the SDK files to find out how to handle all the different events that get emitted during Object Style actions, but so far I'm unable dissect what to do on which event. Looking in MiniCadCallBacks.h for my guidance at the moment... Is there a walkthrough of what to do at which event? Quote Link to comment
Hippocode Posted January 19, 2020 Share Posted January 19, 2020 Hi There is not much to be done, as most of it should be handled by the default implementation. I use a custom class (VWStyledParametricObj) to help with this which I attached (had to zip it as the file extensions weren't allowed). This class also holds some comments on what each action is for. This is an example of how I implemented it: EObjectEvent ElectricalDevice_EventSink::OnEditPluginStyle(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnEditPluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnCreatePluginStyle(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnCreatePluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnUpdateStyledObject(MCObjectHandle symDefHandle) { // Copy over the saved references... EPluginStyleParameter ParameterStyle = gSDK->GetPluginStyleParameterType(fhObject, "__ManageOperatingAreas"); if(ParameterStyle == kPluginStyleParameter_ByStyle) { VWSymbolDefObj symDef(symDefHandle); MCObjectHandle hObject = symDef.GetFirstMemberObject(); if(hObject && VWDeviceObj::GetDeviceType(hObject) != eDeviceType::kUnkownDevice) { sOperatingAreaArray Areas; OperatingArea::Get(hObject, Areas); OperatingArea::Save(fhObject, Areas); } } return VWStyledParametricObj::OnUpdateStyledObject_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnFinalizeCreatePluginStyle(MCObjectHandle symDefHandle) { /*EObjectEvent Result =*/ VWStyledParametricObj::OnFinalizeCreatePluginStyle(symDefHandle, VWDeviceObj::GetStyleMap()); return VWStyledParametricObj::OnFinalizeCreatePluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnFinalizeUpdateStyledObject(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnFinalizeUpdateStyledObject_Default(symDefHandle); } StyledPlugins.zip Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.