Hide Table of Contents
ReloadWithReferences Method (IModelDocExtension)

Reloads this model document with the specified references.

.NET Syntax

Visual Basic (Declaration) 
Function ReloadWithReferences( _
   ByVal ReadOnly As System.Boolean, _
   ByVal DiscardChanges As System.Boolean, _
   ByVal ReferencesToReload As System.Object _
) As System.Integer
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim ReadOnly As System.Boolean
Dim DiscardChanges As System.Boolean
Dim ReferencesToReload As System.Object
Dim value As System.Integer
 
value = instance.ReloadWithReferences(ReadOnly, DiscardChanges, ReferencesToReload)
C# 
System.int ReloadWithReferences( 
   System.bool ReadOnly,
   System.bool DiscardChanges,
   System.object ReferencesToReload
)
C++/CLI 
System.int ReloadWithReferences( 
&   System.bool ReadOnly,
&   System.bool DiscardChanges,
&   System.Object^ ReferencesToReload
) 

Parameters

ReadOnly
True to set the model document read-only after reload or replace, false to allow write access
DiscardChanges
True to discard changes made to the current model document, false to abort operation if the model document was changed (see Remarks)
ReferencesToReload
Array of IDispatch pointers to referenced documents to reload

Return Value

Error codes as defined by swComponentReloadError_e

Remarks

The model to reload or replace must be open in its own window frame.

This method:

  • is faster because it reloads only a selection of referenced components.
  • does not reload or replace the model if the top assembly has been opened invisibly. In that case, make the model visible by calling IModelDoc2::Visible before calling this method.
  • must be called after calling IModelDoc2::ForceReleaseLocks, which detaches a file from the file system, to re-attach a detached file to the file system. If you do not call this method after calling IModelDoc2::ForceReleaseLocks, then you will experience problems with OLE objects (e.g., design tables). Any changes made to a file while it is detached are not preserved unless you save the file to disk before calling this method. Additionally if you set this method's DiscardChanges parameter to false and you made changes to a detached file that you are attempting to re-attach to the file system, then this method will fail. DiscardChanges must be set to true to re-attach a detached file.

See ISldWorks::CloseAndReopen to perform a similar function with drawing documents.

 

See Also

Availability

SOLIDWORKS 2025 FCS, Revision Number 33


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:   ReloadWithReferences Method (IModelDocExtension)
*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) 2025 SP2

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.