Hide Table of Contents
GetOpenedFileInfo Method (ISldWorks)

Gets the name of the last-requested file to open and the options in effect while the file is opening or when the file finished opening.

.NET Syntax

Visual Basic (Declaration) 
Sub GetOpenedFileInfo( _
   ByRef FileName As String, _
   ByRef Options As Integer _
) 
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim FileName As String
Dim Options As Integer
 
instance.GetOpenedFileInfo(FileName, Options)
C# 
void GetOpenedFileInfo( 
   out string FileName,
   out int Options
)
C++/CLI 
void GetOpenedFileInfo( 
&   [Out] String^ FileName,
&   [Out] int Options
) 

Parameters

FileName

Name of the last-requested file to open

NOTE: The last-requested file to open can be in the process of opening or can be finished opening.

Options

Options in effect when the last-requested file to open as defined in swOpenDocOptions_e

Example

STDMETHODIMP CRefNotFound::OnReferenceNotFoundNotify(BSTR strMissingReferenceFileName)

{

    HRESULT              hr = S_OK;

    CComQIPtr<IModelDoc> pModel;

    CComBSTR             sActiveDocPathName;

    CComBSTR             sOpenedDocPathName;

    long                 lOptions;

    iSwApp->get_IActiveDoc(&pModel);

    // pModel can be NULL when a document is opened by double-clicking in Windows Explorer.

    if (pModel) {

        hr = pModel->GetPathName(&sActiveDocPathName);

    }

    // sOpenedDocPathName is the name of the immediate parent

    // document that refers to the missing document.

    // sOpenedDocPathName may be different from sActiveDocPathName;

    // for example when an assembly is opened through File, Open

    // and the missing reference is a part in a sub-assembly.

    // sOpenedDocPathName will contain the name of the sub-assembly;

    // sActiveDocPathName will contain the name of the top-level

    // assembly.

    hr = iSwApp->GetOpenedFileInfo(&sOpenedDocPathName, &lOptions);

    return hr;

}

Remarks

You can use this method in an add-in when responding to the swAppReferenceNotFoundNotify event. See Example.

 

See Also

Availability

SolidWorks 2005 FCS, Revision Number 13.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:   GetOpenedFileInfo 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) 2010 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.