Pharys
Aerospace
- Jul 29, 2015
- 15
Hi everyone,
I struggle to create a function that allow to determine whether or not two planes are parallel and on the same level. Bellow I managed to get the angle between the two planes and the idea is to return true or false in fonction of the angle between them. However, I don't know how to handle the case when the two planes are paralalel but not on the same level. Any idea ?
Function AngleBetweenPlanes(oFirstPlane, oSecondPlane)
Dim reference1 As Reference
Set reference1 = oPart.CreateReferenceFromObject(oFirstPlane)
Dim reference2 As Reference
Set reference2 = oPart.CreateReferenceFromObject(oSecondPlane)
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.GetAngleBetween(reference2)
MsgBox ("Angle=" & CStr(MinimumDistance))
End Function
I struggle to create a function that allow to determine whether or not two planes are parallel and on the same level. Bellow I managed to get the angle between the two planes and the idea is to return true or false in fonction of the angle between them. However, I don't know how to handle the case when the two planes are paralalel but not on the same level. Any idea ?
Function AngleBetweenPlanes(oFirstPlane, oSecondPlane)
Dim reference1 As Reference
Set reference1 = oPart.CreateReferenceFromObject(oFirstPlane)
Dim reference2 As Reference
Set reference2 = oPart.CreateReferenceFromObject(oSecondPlane)
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.GetAngleBetween(reference2)
MsgBox ("Angle=" & CStr(MinimumDistance))
End Function