InsertExternalReference Method (ISketchManager) Send Feedback
See Also  Example
BInst[out]
External reference to a Block instance
PathName
Path and file name of the external reference to insert
InsertX
x coordinate where to insert the external reference
InsertY
y coordinate where to insert the external reference
InsertZ
z coordinate where to insert the external reference
Scale
Scale factor for each axis
Rotation
Angle by which to rotate the external reference; in radians (see Remarks)
Inserts an external reference to a Block instance.

Syntax

Visual Basic 
Function InsertExternalReference( _
   ByVal PathName As System.String, _
   ByVal InsertX As System.Double, _
   ByVal InsertY As System.Double, _
   ByVal InsertZ As System.Double, _
   ByVal Scale As System.Double, _
   ByVal Rotation As System.Double _
) As BlockInstance
C# 
BlockInstance InsertExternalReference( 
   System.string PathName,
   System.double InsertX,
   System.double InsertY,
   System.double InsertZ,
   System.double Scale,
   System.double Rotation
)
JavaScript 
InsertExternalReference( 
   PathName : String,
   InsertX : Number,
   InsertY : Number,
   InsertZ : Number,
   Scale : Number,
   Rotation : Number
) : dsBlockInstance
COM native C++ 
HRESULT InsertExternalReference( 
   BSTR PathName,
   DOUBLE InsertX,
   DOUBLE InsertY,
   DOUBLE InsertZ,
   DOUBLE Scale,
   DOUBLE Rotation,
   IBlockInstance** BInst
) 
C++ 
DSRESULT InsertExternalReference( 
   const dsString& PathName,
   double InsertX,
   double InsertY,
   double InsertZ,
   double Scale,
   double Rotation,
   dsBlockInstance** BInst
) 

Parameters

PathName
Path and file name of the external reference to insert
InsertX
x coordinate where to insert the external reference
InsertY
y coordinate where to insert the external reference
InsertZ
z coordinate where to insert the external reference
Scale
Scale factor for each axis
Rotation
Angle by which to rotate the external reference; in radians (see Remarks)
BInst[out] or Return Value
External reference to a Block instance

Example

This code snippet shows how to add an external reference.

COM native C++

//Insert XREF entity

bstr_t xrefFileName ( L"<path_and_file_name_of_external_reference>" );

double insertX = 0, insertY = 0, insertZ = 0, scale = 1, rotation = 0;

BlockInstancePtr xrefEntity = sketchMgr->InsertExternalReference( xrefFileName, insertX,
insertY, insertZ, scale, rotation );

 

Example

Remarks

Use a positive value for Rotation to rotate the external reference counterclockwise and a negative value to rotate the external reference clockwise.
 

See Also

Availability

DraftSight V1R1