Hide Table of Contents
InsertObjectFromFile Method (IModelDocExtension)

Inserts an OLE object from a file.

.NET Syntax

Visual Basic (Declaration) 
Function InsertObjectFromFile( _
   ByVal FilePath As System.String, _
   ByVal CreateLink As System.Boolean, _
   ByVal Aspect As System.Integer, _
   ByVal XPos As System.Double, _
   ByVal YPos As System.Double, _
   ByVal ZPos As System.Double _
) As SwOLEObject
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim FilePath As System.String
Dim CreateLink As System.Boolean
Dim Aspect As System.Integer
Dim XPos As System.Double
Dim YPos As System.Double
Dim ZPos As System.Double
Dim value As SwOLEObject
 
value = instance.InsertObjectFromFile(FilePath, CreateLink, Aspect, XPos, YPos, ZPos)
C# 
SwOLEObject InsertObjectFromFile( 
   System.string FilePath,
   System.bool CreateLink,
   System.int Aspect,
   System.double XPos,
   System.double YPos,
   System.double ZPos
)
C++/CLI 
SwOLEObject^ InsertObjectFromFile( 
&   System.String^ FilePath,
&   System.bool CreateLink,
&   System.int Aspect,
&   System.double XPos,
&   System.double YPos,
&   System.double ZPos
) 

Parameters

FilePath
Path and filename for the OLE object file
CreateLink

True to create an external link to the OLE object file, false to embed the OLE object on the document

Aspect
Viewing aspect of the object as defined in the DVASPECT enumeration (see Remarks)
XPos
x coordinate for the OLE object
YPos

y coordinate for the OLE object

ZPos
z coordinate for the OLE object

Return Value

Newly inserted object

Remarks

Currently, only the drawing documents use the x,y,z coordinate position. Part and assembly documents place the inserted object at the upper-right corner of the model view.

 

The aspect argument uses the DVASPECT enumeration, which has the following values:

  • DVASPECT_CONTENT = 1

  • DVASPECT_THUMBNAIL = 2

  • DVASPECT_ICON = 4

  • DVASPECT_DOCPRINT = 8

See the MSDN documentation for additional details about the DVASPECT enumeration.

 

See Also

Availability

SolidWorks 2006 FCS, Revision Number 14.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:   InsertObjectFromFile Method (IModelDocExtension)
*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) 2013 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.