Esempio n. 1
0
        private void RhinoDoc_EndOpenDocument(object sender, DocumentOpenEventArgs e)
        {
            if (e.Merge) // this is a paste or import event
            {
                // get incoming streams
                var incomingStreams = e.Document.Strings.GetEntryNames(SpeckleKey);

                // remove any that don't already exist in the current active doc
                foreach (var incomingStream in incomingStreams)
                {
                    if (!ExistingStreams.Contains(incomingStream))
                    {
                        RhinoDoc.ActiveDoc.Strings.Delete(SpeckleKey, incomingStream);
                    }
                }

                // skip binding
                return;
            }

            var bindings = new ConnectorBindingsRhino();

            if (bindings.GetStreamsInFile().Count > 0)
            {
                SpeckleCommand.Instance.StartOrShowPanel();
            }
        }
        // Makes speckle start on rhino startup. Perhaps this should be customisable?
        private void RhinoApp_Idle(object sender, System.EventArgs e)
        {
            RhinoApp.Idle -= RhinoApp_Idle;
            var bindings = new ConnectorBindingsRhino();

            if (bindings.GetStreamsInFile().Count > 0)
            {
                RhinoApp.RunScript("_Speckle", false);
            }
        }