public void RefreshGlobalParameters() { ComPtr pApplication = IntPtr.Zero; if (MarshalEx.Succeeded(MarshalEx.GetActiveObject("SolidEdge.Application", out pApplication))) { SelectedObject = new GlobalParameterInfo(pApplication, this.textBoxSearch.Text); } }
public void Connect() { Disconnect(); ComPtr pApplication = IntPtr.Zero; try { if (MarshalEx.Succeeded(MarshalEx.GetActiveObject("SolidEdge.Application", out pApplication))) { comTreeView.AddRootNode(pApplication, "Application"); } } catch { GlobalExceptionHandler.HandleException(); } finally { } }
private bool ConnectToSolidEdge() { ComPtr pApplication = IntPtr.Zero; try { if (MarshalEx.Succeeded(MarshalEx.GetActiveObject("SolidEdge.Application", out pApplication))) { _application = pApplication.TryGetUniqueRCW <SolidEdgeFramework.Application>(); _connectionPointController.AdviseSink <SolidEdgeFramework.ISEApplicationEvents>(_application); commandBrowser.ActiveEnvironment = _application.GetActiveEnvironment(); globalParameterBrowser.RefreshGlobalParameters(); objectBrowser.Connect(); // Older versions of Solid Edge don't have the ProcessID property. try { processBrowser.ProcessId = _application.ProcessID; } catch { } return(true); } } catch { GlobalExceptionHandler.HandleException(); } finally { pApplication.Dispose(); } return(false); }