0 Replies Latest reply on Sep 18, 2015 11:47 AM by Adam Nguyen

    Editing system options in C#

    Adam Nguyen

      I am trying to edit a couple of settings in SolidWork's options menu through a C# program I wrote. The code is below:

      using System;

      using System.IO;

      using SldWorks;

      using SwConst;

      static void Main(string[] args)

      {

            SldWorks.SldWorks swApp;

            swApp = new SldWorks.SldWorks();

       

            swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swSingleCommandPerPick, true); /// Single command per pick

            swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swEditMacroAfterRecord, true); /// Automatically edit macro after recording

            swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swUserEnableFreezeBar, true);  /// Enable Freeze bar

       

                 Console.WriteLine("Settings applied");

      }

       

      The intended purpose of this program is to toggle those three options (checkboxes) to true. So far this does not work at all. The options still stay the same even after I run the program. Am I missing anything or is my code wrong?