SolidWorksMakroprogrammierung

Methode · ModelDoc2

SetLightSourcePropertyValuesVB-Methode (ModelDoc2)

Setzt die Werte einer Lichtquelle, jeden einzeln als Parameter.

Syntax

Function SetLightSourcePropertyValuesVB( _
   ByVal IdName As String, _
   ByVal LType As Integer, _
   ByVal Diff As Double, _
   ByVal RgbColor As Long, _
   ByVal Dist As Double, _
   ByVal DirX As Double, _
   ByVal DirY As Double, _
   ByVal DirZ As Double, _
   ByVal SpotDirX As Double, _
   ByVal SpotDirY As Double, _
   ByVal SpotDirZ As Double, _
   ByVal SpotAngle As Double, _
   ByVal FallOff0 As Double, _
   ByVal FallOff1 As Double, _
   ByVal FallOff2 As Double, _
   ByVal Ambient As Double, _
   ByVal Specular As Double, _
   ByVal SpotExponent As Double, _
   ByVal BDisable As Boolean _
) As Boolean
bOk = swModel.SetLightSourcePropertyValuesVB(sName, nArt, 0.7, RGB(255, 255, 255), 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0, False)

Parameter

IdNameStringByVal
Interner Name der Lichtquelle.
LTypeIntegerByVal
Art nach den OpenGL-Arten (Kamera, Umgebung, Spot, Punkt, gerichtet); Zahlen nennt die Hilfe nicht.
DiffDoubleByVal
Diffuser Anteil, 0 bis 1.
RgbColorLongByVal
Farbe.
DistDoubleByVal
Abstand zwischen Lichtposition und Eckpunkt.
DirX, DirY, DirZDoubleByVal
Einheitsvektor zur Lage des Lichts.
SpotDirX, SpotDirY, SpotDirZDoubleByVal
Richtung des Spots.
SpotAngleDoubleByVal
Spot-Winkel.
FallOff0, FallOff1, FallOff2DoubleByVal
Abschwächung; seit SOLIDWORKS 2011 nicht mehr unterstützt.
AmbientDoubleByVal
Umgebungsanteil.
SpecularDoubleByVal
Glanzanteil.
SpotExponentDoubleByVal
Spot-Exponent; seit SOLIDWORKS 2011 nicht mehr unterstützt.
BDisableBooleanByVal
True: Lichtquelle ausgeschaltet.

Rückgabewert

True, wenn die Werte gesetzt wurden.

Beispiel

' swModel ist das aktive Dokument.
Dim v As Variant, sName As String
sName = swModel.GetLightSourceName(0)
v = swModel.LightSourcePropertyValues(0)
swModel.SetLightSourcePropertyValuesVB sName, CInt(v(0)), v(1) * 0.5, _
    RGB(v(2) * 255, v(3) * 255, v(4) * 255), 0, v(8), v(9), v(10), v(8), v(9), v(10), v(11), _
    0, 0, 0, v(15), v(16), 0, (v(17) <> 0)

Bemerkungen

Dasselbe wie ModelDoc2.LightSourcePropertyValues, nur mit Einzelwerten statt Array. Die Zuordnung zwischen Array-Feldern und Parametern im Beispiel (etwa ob die Richtung aus Feld 8 bis 10 DirX bis DirZ entspricht) leitet sich aus den Namen ab und ist nicht dokumentiert. Auch Einheiten für Abstand und Winkel nennt die Hilfe nicht.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2001Plus

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

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