GetModel Method (IDocument)

GetModel Method (IDocument) | Send Feedback
See Also Example

ModelSpace[out]
  Model

Gets the model for the document.

# Syntax

Visual Basic |
--- | ---
    Function GetModel() As Model

C# |
--- | ---
    Model GetModel()

JavaScript |
--- | ---
    GetModel() : dsModel

COM native C++ |
--- | ---
    HRESULT GetModel(
       IModel** ModelSpace
    )

C++ |
--- | ---
    DSRESULT GetModel(
       dsModel** ModelSpace
    )

#### Parameters

ModelSpace[out] or Return Value
  Model

# Example

This code snippet shows how to get the IModel object.

#### COM native C++

> IDocumentPtr dsDoc (pConnection->GetActiveDocument());
> if(dsDoc == NULL)
> {
> return;
> }
> IModelPtr dsModel( dsDoc->GetModel() );
> if(NULL == dsModel)
> {
> return;
> }

# Example

Fire Application and Document Events (C#)
Fire Application and Document Events (VB.NET)
Fire Application and Document Events (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

####

IDocument Interface
IDocument Members

# Availability

DraftSight V1R1