SolidWorksMakroprogrammierung

Methode · Body2

CreateRevolutionSurface-Methode (Body2)

Legt eine Rotationsfläche aus einer Profilkurve an.

Syntax

Function CreateRevolutionSurface( _
   ByVal ProfileCurve As Object, _
   ByVal AxisPoint As Variant, _
   ByVal AxisDirection As Variant, _
   ByVal ProfileEndPtParams As Variant _
) As Object
Set swFlaeche = swBody.CreateRevolutionSurface(swKurve, dPunkt, dRichtung, vLeer)

Parameter

ProfileCurveObjectByVal
Die Profilkurve.
AxisPointVariantByVal
Array mit drei Double-Werten X, Y, Z, ein Punkt der Achse.
AxisDirectionVariantByVal
Array mit drei Double-Werten X, Y, Z, die Achsrichtung.
ProfileEndPtParamsVariantByVal
Zwei Double-Werte (Start, Ende) auf der Kurve, aufsteigend, oder ein leerer Variant.

Rückgabewert

Die neue Fläche (Surface).

Beispiel

' swBody ist ein leerer Körper aus PartDoc.CreateNewBody.
Dim swKurve As SldWorks.Curve
Dim swFlaeche As SldWorks.Surface
Dim vLeer As Variant
Dim dPunkt(2) As Double, dZ(2) As Double, dNull(2) As Double
dPunkt(0) = 0.01                                ' Gerade durch (10 | 0 | 0) mm
dZ(2) = 1                                       ' Richtung und Achse Z
Set swKurve = swBody.AddProfileLine(dPunkt, dZ)
Set swFlaeche = swBody.CreateRevolutionSurface(swKurve, dNull, dZ, vLeer)

Bemerkungen

Ohne ProfileEndPtParams ist die Fläche in Achsrichtung unendlich. Die Parameter zählen nur, wenn die Kurve die Achse schneidet. Statt Nothing übergibst du eine leere Variant-Variable. Ein erneuter Aufruf zerstört das zuvor erzeugte Objekt.

Zahlen-Arrays: Punkte, Richtungen und Parameter übergibst du als Double-Array, etwa Dim d(2) As Double. Bei verwandten Befehlen wie Body2.AddProfileArc und Body2.CreatePlanarSurface lieferte Array(...) in SOLIDWORKS 2024 Nothing oder False, ohne Fehlermeldung.

Auch mit einer leeren Variant-Variablen für ProfileEndPtParams liefert das Beispiel Nothing, obwohl die Profilgerade aus Body2.AddProfileLine vorhanden ist.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2004 SP01

Englisches Original: IBody2::CreateRevolutionSurface in der SOLIDWORKS API-Hilfe ↗ (dort mit dem .NET-Namen)

Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.