.NET Framework Class Library
Application.ParentManaged Method

<< Click to Display Table of Contents >>

Navigation:  MwPDMApi Namespace > Application Class > Application Methods >

.NET Framework Class Library
Application.ParentManaged Method

Get Parent object (CAD Application or DBStandAlone) to be used in PowerShell scripts.

Namespace: MwPDMApi
Assembly:  MwPDMApi (in MwPDMApi.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

Visual Basic

Public Function ParentManaged As Object

C#

public Object ParentManaged()

Visual C++

public:

ObjectParentManaged()

JavaScript

function parentManaged();

Return Value

Wrapper Object to CAD Application or DBStandAlone object

Remarks

When used in PowerShell scripts, this function provides a managed wrapper around the COM object. The wrapper does not need to be disposed since this is accomplished by the API framework. But every object returned by the Parent needs to be disposed properly.

Examples

This sample shows how to properly manage the use of Parent object.

 

Copy imageCopy Code

 $dbwApp = $app.Parent()

 try {

     $activeDoc = $dbwApp.ActiveDoc
     $ok = $activeDoc.SaveAs2($dwgName, 0, $true, $true)
 }
 finally {
     if ($activeDoc -ne $null) {
         $activeDoc.Dispose()
         $activeDoc = $null
     }
 }
 $dbwApp.CloseDoc($dwgName)

See Also

Application Class

Application Members

MwPDMApi Namespace