I have been expereiencing the following problem with ProjectObjectChanged event:
1: ProjectObjectChanged event is fired for everything in the station.
if you declare the following
MyPart.ProjectObjectChanged += new ProjectObjectChangedEventHandler(MyPart_ProjectObjectChanged);
But the event behavior is for every GraphicComponent in teh station, including soem things that are not even named…
Should’nt the behavior of the event only fire for the part (or graphiccomponent) that is was subscribed to , like MyPart only, instead of all of the gc’s present in the station?
So I try the VistaBridge, result is the same behavior:
VSTABridge vb = new VSTABridge();
vb.ProjectObjectChanged += new ProjectObjectChangedEventHandler vb_ProjectObjectChanged);
2: Unload/Load or Reload the addin, then the following error occurs:
RobotStudio .NET exception: Unknown Error: ProjectObjectChanged [a kaBillion of them]
Base exception: AppDomainUnloadedException
The target application domain has been unloaded.
Server stack trace:
at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object args)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(Byte reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AddIn.Contract.Automation.IRemoteDelegateContract.InvokeDelegate(IRemoteArgumentArrayContract args)
at Microsoft.VisualStudio.Tools.Applications.ExceptionFilterHelper.DynamicInvoke(IExceptionManagerContract mgr, IExceptionNotificationObjectContract exceptionNotificationObjectContract, IRemoteDelegateContract delegateContract, IRemoteArgumentArrayContract remoteArgs)
at Microsoft.VisualStudio.Tools.Applications.DelegateProxy.InvokeDelegate_VV_Return[R,A0,A1](A0 a0, A1 a1)
at Microsoft.VisualStudio.Tools.Applications.DelegateProxy.InvokeDelegate_VV_NoReturn[A0,A1](A0 a0, A1 a1)
at ABB.Robotics.RobotStudio.Stations.VSTABridge.raise_ProjectObjectChanged(Object value0, ProjectObjectChangedEventArgs value1)
at ABB.Robotics.RobotStudio.Stations.VSTABridge.ProjectObject_ProjectObjectChanged(Object sender, ProjectObjectChangedEventArgs e)
at ABB.Robotics.RobotStudio.ProjectObjectChangedEventHandler.Invoke(Object sender, ProjectObjectChangedEventArgs e)
at ABB.Robotics.RobotStudio.ProjectObject.raise_ProjectObjectChanged(Object value0, ProjectObjectChangedEventArgs value1)
at ABB.Robotics.RobotStudio.ProjectObject.SendPendingChangeEvents()
You have to completely shutdown RS, and re-open - you can only have then the one load attempt - if you eedit the code, it gets reloaded with the new buiild, and the event no longer works… to test your change, shutdown RS5 then restart - this gets real time consuming and irritating!
I unsubscribe the event in the AddInShutdown procedure.
How do you/What is the fix for the problem?