sanganaksakha
Mechanical
- Apr 24, 2007
- 16
How can I get the distance between 2 parallel planes using VBA?
The planes are in a geometrical set in a part.
The planes are in a geometrical set in a part.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Func GetMinimumDistance( Reference iMeasuredItem) As double
Compute the minimum distance between the CATIAMeasurable and another. Bodies (openbody, hybridbody..) cannot be measured between.
Parameters:
oCoordinates
The information of the axis system with respect to the product coordinate system:
oComponents(0) is the X coordinate of the origin of the axis system
oComponents(1) is the Y coordinate of the origin of the axis system
oComponents(2) is the Z coordinate of the origin of the axis system
oComponents(3) is the X coordinate of the first direction of the axis system
oComponents(4) is the Y coordinate of the first direction of the axis system
oComponents(5) is the Z coordinate of the first direction of the axis system
Example:
This example retrieves the distance between the reference1 and reference2.
Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(object1)
Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(object1)
Dim TheSPAWorkbench As Workbench
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench ( "SPAWorkbench" )
Dim TheMeasurable As Measurable
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(reference1)
Dim MinimumDistance As double
MinimumDistance = TheMeasurable.GetMinimumDistance(reference2)