Hide Table of Contents
CloseDoc Method (ISldWorks)

Closes the specified document.

.NET Syntax

Visual Basic (Declaration) 
Sub CloseDoc( _
   ByVal Name As System.String _
) 
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim Name As System.String
 
instance.CloseDoc(Name)
C# 
void CloseDoc( 
   System.string Name
)
C++/CLI 
void CloseDoc( 
&   System.String^ Name
) 

Parameters

Name

Name of document (see Remarks)

Example

Remarks

If Name is specified with:

  • the name of a document that is not open, then this method does nothing.
  • an empty string  (""), then the active document is closed without saving.
  • the name of a document in the dirty state (modified, but not saved), then this method closes the document without saving it.

This method also closes any non-active hidden documents.

For documents referenced by other documents loaded in memory, call this method to release user-interface resources while keeping the model data loaded.

If you are closing the only document open in the SOLIDWORKS session and this SOLIDWORKS session is a background session, then calling this method, or calling ISldWorks::QuitDoc, results in the SOLIDWORKS session being closed.

A background SOLIDWORKS session can be created when the SOLIDWORKS session is started by your application and the session is not controlled by the user; i.e., ISldWorks::UserControl set to false.

To keep the SOLIDWORKS session open, set ISldWorks::UserControl to True, which makes the session visible, or you can close your documents at the end of your program execution.

 

See Also



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:   CloseDoc 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) 2023 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.