SolidWorksMakroprogrammierung

Methode · Face2

GetMaterialPropertyValues2-Methode (Face2)

Liefert Farbe und Lichteigenschaften einer Fläche in bestimmten Konfigurationen.

Syntax

Function GetMaterialPropertyValues2( _
   ByVal Config_opt As Long, _
   ByVal Config_names As Variant _
) As Variant
vWerte = swFace.GetMaterialPropertyValues2(swThisConfiguration, Nothing)

Parameter

Config_optLongByVal
Für welche Konfigurationen, ein Wert aus swInConfigurationOpts_e: swThisConfiguration (1), swAllConfiguration (2) oder swSpecifyConfiguration (3).
Config_namesVariantByVal
Nur bei swSpecifyConfiguration: Array mit Namen, sonst Nothing.

Rückgabewert

Array mit neun Double-Werten, siehe Bemerkungen.

Beispiel

' swFace ist eine Fläche (Face2), etwa aus Body2.GetFaces oder der Auswahl.
Dim vWerte As Variant
If swFace.HasMaterialPropertyValues Then
    vWerte = swFace.GetMaterialPropertyValues2(swThisConfiguration, Nothing)
    Debug.Print "RGB: " & vWerte(0) * 255 & ", " & vWerte(1) * 255 & ", " & vWerte(2) * 255
End If

Bemerkungen

Das Array hat neun Werte: Rot, Grün, Blau, Umgebung, Streuung, Glanz, Glanzgröße, Transparenz, Leuchten, jeweils von 0 bis 1.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2004

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

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