AnsweredAssumed Answered

Editing system options in C#

Question asked by Adam Nguyen on Sep 18, 2015

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?