Hide Table of Contents
GetDistance Method (IEntity)

Gets the minimum or maximum distance between this entity and the given face or edge entity (see Remarks).

.NET Syntax

Visual Basic (Declaration) 
Function GetDistance( _
   ByVal BaseEntity As System.Object, _
   ByVal MinDistance As System.Boolean, _
   ByVal Parameter As System.Object, _
   ByRef Position1 As System.Object, _
   ByRef Position2 As System.Object, _
   ByRef Distance As System.Double _
) As System.Integer
Visual Basic (Usage) 
Dim instance As IEntity
Dim BaseEntity As System.Object
Dim MinDistance As System.Boolean
Dim Parameter As System.Object
Dim Position1 As System.Object
Dim Position2 As System.Object
Dim Distance As System.Double
Dim value As System.Integer
 
value = instance.GetDistance(BaseEntity, MinDistance, Parameter, Position1, Position2, Distance)
C# 
System.int GetDistance( 
   System.object BaseEntity,
   System.bool MinDistance,
   System.object Parameter,
   out System.object Position1,
   out System.object Position2,
   out System.double Distance
)
C++/CLI 
System.int GetDistance( 
&   System.Object^ BaseEntity,
&   System.bool MinDistance,
&   System.Object^ Parameter,
&   [Out] System.Object^ Position1,
&   [Out] System.Object^ Position2,
&   [Out] System.double Distance
) 

Parameters

BaseEntity
IEntity of another edge or face to get distance from this entity (see Remarks)
MinDistance
True to return minimum distance between entities; false to return maximum distance between entities
Parameter

If MinDistance = False,

  • and BaseEntity is an edge or curve, specify an array of two doubles (Min, Max), where Min and Max make up the U-parameter range of BaseEntity
  • and BaseEntity is a face, specify an array of four doubles (UMin, VMin, UMax, VMax), where UMin, VMin, UMax, and VMax make up the UV-parameter range of the surface of BaseEntity

If MinDistance = True,

  • and BaseEntity is an edge or curve, optionally specify an array of two doubles (Min, Max), where Min and Max make up the U-parameter range of BaseEntity
  • and BaseEntity is a face, optionally specify an array of four doubles (UMin, VMin, UMax, VMax), where UMin, VMin, UMax, and VMax make up the UV-parameter range of the surface of BaseEntity
Position1
Array of doubles; coordinates of this entity that were used to measure the distance
Position2
Array of doubles; coordinates of BaseEntity that were used to measure the distance
Distance
Minimum or maximum distance between entities; if Parameter is not specified, minimum distance

Return Value

0 if success; -1 if failure

Example

Remarks

Only face and edge entities are supported.

To populate Parameter you can find the UV parameter ranges as follows:

 

See Also

Availability

SOLIDWORKS 2009 SP5, Revision Number 17.5


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:   GetDistance Method (IEntity)
*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) 2018 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.