public override List <StreamState> GetStreamsInFile()
 {
     if (CurrentDoc != null)
     {
         DocumentStreams = StreamStateManager.ReadState(CurrentDoc.Document);
     }
     return(DocumentStreams);
 }
Esempio n. 2
0
        private void CheckForStreamsAndOpenSpeckle(object sender, Autodesk.Revit.DB.Events.DocumentOpenedEventArgs e)
        {
            var streams = StreamStateManager.ReadState(e.Document);

            if (streams != null && streams.Count != 0)
            {
                SpeckleRevitCommand.OpenOrFocusSpeckle(AppInstance);
            }
        }
        //public override void RemoveStreamFromFile(string streamId)
        //{
        //    var streamState = DocumentStreams.FirstOrDefault(s => s.Stream.id == streamId);
        //    if (streamState != null)
        //    {
        //        DocumentStreams.Remove(streamState);
        //        WriteStateToFile();
        //    }
        //}

        public override List <StreamState> GetStreamsInFile()
        {
            if (Model != null)
            {
                DocumentStreams = StreamStateManager.ReadState(Model);
            }

            return(DocumentStreams);
        }
Esempio n. 4
0
        public override List <StreamState> GetStreamsInFile()
        {
            if (File != null)
            {
                ECSchema schema;
                if (Control.InvokeRequired)
                {
                    schema          = (ECSchema)Control.Invoke(new ListSchemaDelegate(StreamStateManager.StreamStateListSchema.GetSchema));
                    DocumentStreams = (List <StreamState>)Control.Invoke(new ReadSchemaDelegate(StreamStateManager.ReadState), new object[] { schema });
                }
                else
                {
                    schema = StreamStateManager.StreamStateListSchema.GetSchema();
                    if (schema == null)
                    {
                        schema = StreamStateManager.StreamStateListSchema.AddSchema();
                    }
                    DocumentStreams = StreamStateManager.ReadState(schema);
                }
            }

            return(DocumentStreams);
        }
 public override List<StreamState> GetStreamsInFile()
 {
   DocumentStreams = StreamStateManager.ReadState(CurrentDoc.Document);
   return DocumentStreams;
 }