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)
C# 
System.object ActivateDoc3( 
   System.string Name,
   System.bool UseUserPreferences,
   System.int Option,
   out System.int Errors
)
C++/CLI 
System.Object^ ActivateDoc3( 
&   System.String^ Name,
&   System.bool UseUserPreferences,
&   System.int Option,
&   [Out] System.int Errors
) 

Parameters

Name
Name of the loaded document to activate (see Remarks)
UseUserPreferences
True to rebuild as per the swRebuildOnActivation system option; false to rebuild as per Option
Option
Rebuild option as defined in swRebuildOnActivation_e (see Remarks)
Errors
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

Example

Remarks

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...

No

Not rebuilt, and Errors contains swActivateDocError_e.swDocNeedsRebuildWarning

Yes

Rebuilt immediately

 

See Also

Availability

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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   ActivateDoc3 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) 2015 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.