Hide Table of Contents
ActivateDoc3 Method (ISldWorks)

Activates a loaded document and rebuilds it as specified.

.NET Syntax

Visual Basic (Declaration) 
Function ActivateDoc3( _
   ByVal Name As System.String, _
   ByVal UseUserPreferences As System.Boolean, _
   ByVal Option As System.Integer, _
   ByRef Errors As System.Integer _
) As System.Object
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim Name As System.String
Dim UseUserPreferences As System.Boolean
Dim Option As System.Integer
Dim Errors As System.Integer
Dim value As System.Object
value = instance.ActivateDoc3(Name, UseUserPreferences, Option, Errors)
System.object ActivateDoc3( 
   System.string Name,
   System.bool UseUserPreferences,
   System.int Option,
   out System.int Errors
System.Object^ ActivateDoc3( 
&   System.String^ Name,
&   System.bool UseUserPreferences,
&   System.int Option,
&   [Out] System.int Errors


Name of the loaded document to activate (see Remarks)
True to rebuild as per the swRebuildOnActivation system option; false to rebuild as per Option
Rebuild option as defined in swRebuildOnActivation_e (see Remarks)
Status of the activate operation as defined in swActivateDocError_e; if
no errors or warnings are encountered, then this value is 0 (see Remarks)

Return Value

Model document



This method brings the document specified in Name to the foreground of SOLIDWORKS and returns a pointer to the document.

If you do not specify a file extension in Name, the document activated is based on its filename without the file extension. This can cause problems if you have loaded two different document types with the same name (e.g., 12345.sldprt and 12345.sldasm). To avoid this problem, specify the file extension in Name or check the document type after it is activated using IModelDoc2::GetType.

If the document needs a rebuild upon activation, and you have specified Option with swRebuildOnActivation_e.swDontRebuildActiveDoc, then the activated document is not rebuilt, and Errors contains swActivateDocError_e.swDocNeedsRebuildWarning. You can then rebuild the document using IModelDoc2::EditRebuild3.

If the document needs a rebuild upon activation, and you have specified Option with swRebuildOnActivation_e.swUserDecision, then a dialog displays asking whether to rebuild the document.

If the user answers...

Then the activated document is...


Not rebuilt, and Errors contains swActivateDocError_e.swDocNeedsRebuildWarning


Rebuilt immediately


See Also


SOLIDWORKS 2012 FCS, Revision Number 20.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

Subject:   Feedback on Help Topics
Page:   ActivateDoc3 Method (ISldWorks)
*   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:


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

Web Help Content Version: API Help (English only) 2019 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.