Femtet Macro Help/Manual
 

Home / Modeling / CGaudi / Method / FindBodyAll

FindBodyAll Method

Syntax

FindBodyAll (Points() As CGaudiPoint, BodyList() As CGaudiBody) As Boolean




[Python]
FindBodyAll_py(CGaudiPoint[] Points)

Return Value

True   Success
False   Failure
  



[Python]
[0]   True: Success, False: Failure

[1][0 to (the number of bodies found -1)]

  Array (dynamic array) to return the body which has the specified coordinates value.

Parameters

Points   Coordinates array
BodyList   Array (dynamic array) to return the body which has the specified coordinates value.
  



[Python]
Points   Coordinates array

Notes

Searches the bodies which have all points of the specified coordinates array.
Fails if any body is not found or the body list is not dynamic array.
Points can be either static array or dynamic array.

Example

Dim Femtet As New CFemtet
Dim Gaudi As CGaudi
Dim Body1 As CGaudiBody
Dim Body2 As CGaudiBody
Dim FindBodies() As CGaudiBody
Dim Point(1) As New CGaudiPoint

'Creates new project
If Femtet.OpenNewProject() = False Then
Femtet.ShowLastError
End If

'Substitute Femtet.Gaudi for variable Gaudi.
Set Gaudi = Femtet.Gaudi



'Set the coordinates array
Point(0).SetCoord 0, 0, 0
Point(1).SetCoord 5, 5, 5

'Creates the body
Set Body1 = Gaudi.CreateBox(Point(0), 3, 3, 3)
Set Body2 = Gaudi.CreateBox(Point(0), 8, 8, 8)

 

'Finds the body which has the specified coordinates array.

If Gaudi.FindBodyAll(Point, FindBodies) = False Then

FEMTET.ShowLastError

End If

'Change color of the found body to purple

Dim i As Long

For i = 0 To UBound(FindBodies)

FindBodies(i).Color = &HFF00FF

Next i