Exemplo n.º 1
0
        public void SetConverterFromKit(string kitName)
        {
            if (kitName == Kit.Name)
            {
                return;
            }

            Kit        = KitManager.Kits.FirstOrDefault(k => k.Name == kitName);
            Converter  = Kit.LoadConverter(Applications.Rhino);
            BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
            Message    = $"Using the {Kit.Name} Converter";
            ExpireSolution(true);
        }
Exemplo n.º 2
0
 public ExtendSpeckleObjectAsync() : base("Extend Speckle Object Async", "ESOA",
                                          "Extend a current object with key/value pairs", "Speckle 2 Dev", "Async Object Management")
 {
     Kit = KitManager.GetDefaultKit();
     try
     {
         Converter  = Kit.LoadConverter(Applications.Rhino);
         BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
         Message    = $"{Kit.Name} Kit";
     }
     catch
     {
         AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "No default kit found on this machine.");
     }
 }
 public override void AddedToDocument(GH_Document document)
 {
     base.AddedToDocument(document); // This would set the converter already.
     BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
     Params.ParameterNickNameChanged += (sender, args) =>
     {
         args.Parameter.Name = args.Parameter.NickName;
         ExpireSolution(true);
     };
     Params.ParameterChanged += (sender, args) =>
     {
         if (args.OriginalArguments.Type == GH_ObjectEventType.NickName ||
             args.OriginalArguments.Type == GH_ObjectEventType.NickNameAccepted)
         {
             args.Parameter.Name = args.Parameter.NickName;
             ExpireSolution(true);
         }
     };
 }
 public override void SetConverter()
 {
     base.SetConverter();
     BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
 }
 public ExtendSpeckleObjectAsync() : base("Extend Speckle Object", "ESO",
                                          "Extend a current object with key/value pairs", "Speckle 2", "Object Management")
 {
     BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
 }
 public ExtendSpeckleObjectAsync() : base("Extend Speckle Object", "ESO",
                                          "Extend a current object with key/value pairs", ComponentCategories.PRIMARY_RIBBON, ComponentCategories.OBJECTS)
 {
     BaseWorker = new ExtendSpeckleObjectWorker(this, Converter);
 }