Femtet2026.0マクロヘルプ/マニュアル
 

ホーム / モデリング / CGaudi / 関数 / CreateHelicalWire

CreateHelicalWire関数

定義

CreateHelicalWire (P1As CGaudiPoint, P2 As CGaudiPoint, dHelical As Double, dSpiral As Double, dTurn As Double, bRightHanded As Boolenan) As CGaudiBody

戻り値

成功した場合は新規に作成されたBodyが返ります。
失敗した場合は、Nothingが返ります。

引数

P1   らせんの中心軸上の点
P2   らせんの始点
dHelical   高さ方向のピッチ(らせんを一巻きした後の高さ方向の差)
dSpiral   幅方向のピッチ(らせんを一巻きした後の幅方向の差)
dTurn   らせんの巻数
bRightHanded   右回りかどうか(True = 右回り)

解説

指定された引数よりらせんを作成します。
両方のピッチが0であったり、巻数が0であったり、らせんが途中でねじれてしまう場合はエラーとなり、Nothingが返ります。

実行例

Dim Femtet As New CFemtet
Dim Gaudi As CGaudi

'新規プロジェクト作成
If Femtet.OpenNewProject() = False Then
  Femtet.ShowLastError
End If

Dim Body() As CGaudiBody
Gaudi.RedrawMode = False
'------- CreateHelicalWire -------
ReDim Preserve Body(0) As CGaudiBody
Dim Point0 As New CGaudiPoint
Dim Point1 As New CGaudiPoint
Point0.SetCoord 2#, 5#, 0#
Point1.SetCoord 0#, 0#, 0#
Set Body(0) = Gaudi.CreateHelicalWire(Point0, Point1, 0, 0.5, 20#, True)
'------- モデルを再描画します -------
Gaudi.Redraw