Hide Table of Contents
RestoreSettings Method (ISldWorks)

Restores the specified SOLIDWORKS settings from the specified *.sldreg file.

.NET Syntax

Visual Basic (Declaration) 
Function RestoreSettings( _
   ByVal FileName As System.String, _
   ByVal SystemOptions As System.Boolean, _
   ByVal ToolbarLayout As System.Boolean, _
   ByVal KeyboardShortcuts As System.Boolean, _
   ByVal MouseGestures As System.Boolean, _
   ByVal MenuCustomization As System.Boolean, _
   ByVal SavedViews As System.Boolean, _
   ByVal CreateBackup As System.Boolean _
) As System.Integer
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim FileName As System.String
Dim SystemOptions As System.Boolean
Dim ToolbarLayout As System.Boolean
Dim KeyboardShortcuts As System.Boolean
Dim MouseGestures As System.Boolean
Dim MenuCustomization As System.Boolean
Dim SavedViews As System.Boolean
Dim CreateBackup As System.Boolean
Dim value As System.Integer
 
value = instance.RestoreSettings(FileName, SystemOptions, ToolbarLayout, KeyboardShortcuts, MouseGestures, MenuCustomization, SavedViews, CreateBackup)
C# 
System.int RestoreSettings( 
   System.string FileName,
   System.bool SystemOptions,
   System.bool ToolbarLayout,
   System.bool KeyboardShortcuts,
   System.bool MouseGestures,
   System.bool MenuCustomization,
   System.bool SavedViews,
   System.bool CreateBackup
)
C++/CLI 
System.int RestoreSettings( 
&   System.String^ FileName,
&   System.bool SystemOptions,
&   System.bool ToolbarLayout,
&   System.bool KeyboardShortcuts,
&   System.bool MouseGestures,
&   System.bool MenuCustomization,
&   System.bool SavedViews,
&   System.bool CreateBackup
) 

Parameters

FileName
Full path and filename of the settings to restore (*.sldreg) (see Remarks)
SystemOptions
True to restore system options, false to not
ToolbarLayout
True to restore the toolbar layout, false to not
KeyboardShortcuts
True to restore keyboard shortcuts, false to not (see Remarks)
MouseGestures
True to restore mouse gestures, false to not
MenuCustomization
True to restore menu customizations, false to not
SavedViews
True to restore saved views, false to not (see Remarks)
CreateBackup
True to create a backup of the current settings, false to not (see Remarks)

Return Value

Error code as defined in swSaveRestoreSettingsResults_e

Example

' VBA precondition:

' c:\temp exists

Dim swApp As SldWorks.SldWorks
Option Explicit
Sub main()
    Set swApp = Application.SldWorks

Dim boolStatus As Long
Dim path As String

path = "C:\temp\swSettings2.sldreg"
boolStatus = swApp.SaveSettings(path, True, swToolbarLayoutOption_e.swToolbarLayoutOption_AllToolbars, True, True, True, True)

path = "C:\temp\swSettings2.sldreg"
boolStatus = swApp.RestoreSettings(path, True, True, True, True, True, True, True)
End Sub

 

Remarks

This method is valid only if ISldWorks::SaveSettings was called previously.

KeyboardShortcuts and SavedViews are valid only if these settings were previously saved using ISldWorks::SaveSettings.

If CreateBackup is true, this method backs up the current settings to backup_userid_yyyymmdd_hhmmss.sldreg in the same location as specified in FileName.

For C++ only, specify all System.bool parameters using VARIANT_TRUE (-1) and VARIANT_FALSE (0).

 

See Also

Availability

SOLIDWORKS 2018 FCS, Revision Number 26.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   RestoreSettings Method (ISldWorks)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2018 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.