Hide Table of Contents
DetachPdfDefinition Method (ISketchManager)
Retval[out]
True if successful, false if not

Detaches the specified PDF definition from the drawing.

.NET Syntax

Visual Basic (Declaration) 
Function DetachPdfDefinition( _
   IPdfDefinition* PdfDefinition As PdfDefinition _
) As System.Boolean
C# 
System.bool DetachPdfDefinition( 
   PdfDefinition PdfDefinition
)
JavaScript 
DetachPdfDefinition( 
   PdfDefinition : PdfDefinition\n) : dsSystem.boolean
COM native C++ 
HRESULT DetachPdfDefinition( 
   dsPdfDefinition* dsPdfDefinition*
,
   VARIANT_BOOL* Retval
) 
C++ 
DSRESULT DetachPdfDefinition( 
   IPdfDefinition* IPdfDefinition*
,
   bool* Retval
) 

Parameters

PdfDefinition
PDF definition

Parameters

Retval[out] or Return Value
True if successful, false if not

Example

Create a C++ program in Visual Studio using the C++ snippet below, substituting your_pdf with the full path to a PDF file on your computer.

=======================================================================

C++ snippet attaches and detaches your_pdf

=============================================================================

dsCommandMessage_ptr commandline;

application->GetCommandMessage(&commandline);

 

dsRunCommandError_e error = dsRunCommand_InvalidCommand;

dsStringArray parameters;

dsLongArray parametersLong;

dsString strFile = L"your_pdf";

dsResType_e type = dsResType_String;

parameters.add( strFile );

parametersLong.add( type );

 

application->RunCommand2( L"_ATTACHPDF", parameters, parametersLong, true, &error );

commandline->PrintLine( error != dsRunCommand_Succeeded ? L"Run command failed" : L"Run command passed!" );

 

dsDocument_ptr document;

application->GetActiveDocument( &document );

 

dsLongArray ExternalDefinitionTypeLongArray;

dsObjectPtrArray ExternalDefinitionsArray;

document->GetImmediateChildReferences( &ExternalDefinitionTypeLongArray, &ExternalDefinitionsArray );

 

dsModel_ptr dsModel;

document->GetModel( &dsModel );

 

dsSketchManager_ptr sketchManager;

dsModel->GetSketchManager( &sketchManager );

 

dsPdfDefinition_c* pdfDefinition = ( dsPdfDefinition_c* )ExternalDefinitionsArray[ 0 ];

 

bool bRet;

sketchManager->DetachPdfDefinition( pdfDefinition, &bRet );

commandline->PrintLine( bRet ? L"Passed to detach Pdf" : L"Failed to detach PDF" );

 

See Also

Availability

DraftSight 2024 SP02


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:   DetachPdfDefinition Method (ISketchManager)
*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) 2024 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.