Example #1
0
        private void ReleaseObjects()
        {
            if (null != m_RhinoScript)
            {
                m_RhinoScript.DocumentModified(0);
                m_RhinoScript = null;
            }

            if (null != m_Rhino)
            {
                // Release all references to Rhino by setting its reference count to 0.
                Marshal.FinalReleaseComObject(m_Rhino);
                m_Rhino = null;
            }
        }
Example #2
0
        private void buttonOpen_Click(object sender, EventArgs e)
        {
            if (null == m_RhinoScript)
            {
                try
                {
                    object obj = m_Rhino.GetScriptObject();
                    m_RhinoScript = (IRhinoScript)obj;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error = {0}", ex.Message));
                }
            }

            if (null != m_RhinoScript)
            {
                m_RhinoScript.Command("_Open", 0);
            }
        }