GetActiveDocument Method (IApplication)

GetActiveDocument Method (IApplication) | Send Feedback
See Also Example

Doc[out]
  Active document

Gets the active document.

# Syntax

Visual Basic |
--- | ---
    Function GetActiveDocument() As Document

C# |
--- | ---
    Document GetActiveDocument()

JavaScript |
--- | ---
    GetActiveDocument() : dsDocument

COM native C++ |
--- | ---
    HRESULT GetActiveDocument(
       IDocument** Doc
    )

C++ |
--- | ---
    DSRESULT GetActiveDocument(
       dsDocument** Doc
    )

#### Parameters

Doc[out] or Return Value
  Active document

# Example

This code snippet shows how to get the active document.

#### COM native C++

> //Get active document
> m_DsActiveDoc = m_DsApp->GetActiveDocument();

# Example

Get and Set Document Settings (C#)
Get and Set Document Settings (VB.NET)
Get and Set Document Settings (VBA)
Get and Set Block Definitions, Block Instances, and BlockAttribute Instances (C#)
Get and Set Block Definitions, Block Instances, and BlockAttribute Instances (VB.NET)
Get and Set Block Definitions, Block Instances, and BlockAttribute Instances (VBA)
Get and Set Print Options (C#)
Get and Set Print Options (VB.NET)
Get and Set Print Options (VBA)
Switch Layouts (C#)
Switch Layouts (VB.NET)
Switch Layouts (VBA)
Insert Lines and Angular Dimension (JavaScript)
Create Circles on Different Layers (JavaScript)
Insert Block, Notes, and Sketch Entities (JavaScript)
Insert Splines (JavaScript)
Insert HyperLink (JavaScript)
Insert and Dimension Sketch (JavaScript)
Mirror Entities (JavaScript)
Add and Modify Custom Data (JavaScript)
Insert Hatch (JavaScript)
Create Model and Sheet Views (JavaScript)

# See Also

####

IApplication Interface
IApplication Members
IApplication::GetDocuments Method
IApplication::CloseDocument Method
IApplication::OpenDocument Method

# Availability

DraftSight V1R1