ホーム / モデリング / CGaudi / 関数 / CreateSolid2
CreateSolid2関数
定義
CreateSolid2 (FaceList() As CGaudiBody, newBody() As CGaudiBody, bDeleteOrigin As Boolean) As Boolean
[Python]
CreateSolid2_py(CGaudiBody[] FaceList, bool bDeleteOrigin)
戻り値
| True | 成功 | |
| False | 失敗 |
[Python]
| [0] | True:成功、False:失敗 | |
|
[1][0~作成されたBody数-1] |
変換により作成されたBodyの配列 |
引数
| FaceList | ソリッドを構成するBody(面)の配列 | |
| newBody | 変換により作成されたBodyの配列 | |
| bDeleteOrigin | 変換元のボディを残すかどうか(初期値はTrue) |
[Python]
| FaceList | ソリッドを構成するBody(面)の配列 | |
| bDeleteOrigin | 変換元のボディを残すかどうか(初期値はTrue) |
解説
指定されたBody(面)を繋ぎあわせて新しくソリッドを作成します。指定されたBodyを削除するかどうかをbDeleteOriginで設定可能です。
bDeleteOriginを設定しない場合は指定されたBodyは削除されます。
ソリッドを構成するために面が閉じている必要はありません。
開いている部分は自動的に修復して面を埋め合わせます。
ただし、面が少なすぎる場合はエラーとなり、Nothingが返ります。
また、面以外のBodyが指定された場合にもエラーとなります。
実行例
Dim Femtet As New CFemtetDim Gaudi As CGaudi
Dim Body(4) As CGaudiBody
Dim newBody As CGaudiBody
Dim Point(3) As New CGaudiPoint
Dim Point1(3) As New CGaudiPoint
Dim Point2(2) As New CGaudiPoint
Dim Point3(2) As New CGaudiPoint
Dim Point4(3) As New CGaudiPoint
'新規プロジェクト作成
If Femtet.OpenNewProject() = False Then
Femtet.ShowLastError
End If
'Femtet.Gaudiを変数Gaudiに代入して使いやすくする
Set Gaudi = Femtet.Gaudi
'///////////////
Point(0).X = 0
Point(0).Y = 0
Point(0).Z = 0
Point(1).X = 5
Point(1).Y = 0
Point(1).Z = 0
Point(2).X = 5
Point(2).Y = 5
Point(2).Z = 0
Point(3).X = 0
Point(3).Y = 5
Point(3).Z = 0
'///////////////
'---------------
Point1(0).X = 0
Point1(0).Y = 0
Point1(0).Z = 0
Point1(1).X = 5
Point1(1).Y = 0
Point1(1).Z = -5
Point1(2).X = 5
Point1(2).Y = 5
Point1(2).Z = -5
Point1(3).X = 0
Point1(3).Y = 5
Point1(3).Z = 0
'---------------
'===============
Point2(0).X = 5
Point2(0).Y = 5
Point2(0).Z = 0
Point2(1).X = 5
Point2(1).Y = 5
Point2(1).Z = -5
Point2(2).X = 0
Point2(2).Y = 5
Point2(2).Z = 0
'===============
'***************
Point3(0).X = 0
Point3(0).Y = 0
Point3(0).Z = 0
Point3(1).X = 5
Point3(1).Y = 0
Point3(1).Z = 0
Point3(2).X = 5
Point3(2).Y = 0
Point3(2).Z = -5
'***************
'---------------
Point4(0).X = 5
Point4(0).Y = 5
Point4(0).Z = 0
Point4(1).X = 5
Point4(1).Y = 0
Point4(1).Z = 0
Point4(2).X = 5
Point4(2).Y = 0
Point4(2).Z = -5
Point4(3).X = 5
Point4(3).Y = 5
Point4(3).Z = -5
'---------------
Set Body(0) = Gaudi.CreateFace1(Point)
If Body(0) Is Nothing Then
Femtet.ShowLastError
End If
Set Body(1) = Gaudi.CreateFace1(Point1)
If Body(1) Is Nothing Then
Femtet.ShowLastError
End If
Set Body(2) = Gaudi.CreateFace1(Point2)
If Body(2) Is Nothing Then
Femtet.ShowLastError
End If
Set Body(3) = Gaudi.CreateFace1(Point3)
If Body(3) Is Nothing Then
Femtet.ShowLastError
End If
Set Body(4) = Gaudi.CreateFace1(Point4)
If Body(4) Is Nothing Then
Femtet.ShowLastError
End If
'面からSolidを作成
Set newBody = Gaudi.CreateSolid2(Body)
If newBody Is Nothing Then
Femtet.ShowLastError
End If


