Beispiel #1
0
        public SpeckleAdapter(SpeckleCore.Account speckleAccount, string speckleStreamId, string speckleStreamName = "Anonymous stream")
        {
            if (string.IsNullOrWhiteSpace(speckleStreamId))
            {
                BH.Engine.Reflection.Compute.RecordError("StreamId can't be null or empty.");
                return;
            }

            SpeckleStream SpeckleStream = new SpeckleStream()
            {
                StreamId = speckleStreamId, Name = speckleStreamName
            };

            SpeckleClient = new SpeckleApiClient()
            {
                BaseUrl = speckleAccount.RestApi, AuthToken = speckleAccount.Token, Stream = SpeckleStream, StreamId = SpeckleStream.StreamId
            };
            SpeckleClient.SetupWebsocket();
        }
Beispiel #2
0
        public SpeckleAdapter(SpeckleCore.Account speckleAccount, string speckleStreamId)
        {
            Config.UseAdapterId = false;

            AdapterId = BH.Engine.Speckle.Convert.AdapterId;

            SpeckleAccount = speckleAccount;
            SpeckleStream  = new SpeckleStream()
            {
                StreamId = SpeckleStreamId
            };

            SpeckleClient = new SpeckleApiClient()
            {
                BaseUrl = SpeckleAccount.RestApi, AuthToken = SpeckleAccount.Token, Stream = SpeckleStream
            };                                                                                                                                     // hacky, but i don't want to rebuild stuff and fiddle dll loading etc.
            SpeckleClient.SetupWebsocket();


            //if (string.IsNullOrWhiteSpace(speckleStreamId))
            SpeckleStreamId = speckleStreamId;
        }