SolidWorksMakroprogrammierung

Methode · Component2

GetTexture-Methode (Component2)

Liefert die Textur einer Komponente in einer Konfiguration.

Syntax

Function GetTexture( _
   ByVal Config_name As String _
) As Texture
Set swTexture = swComp.GetTexture("Standard")

Parameter

Config_nameStringByVal
Name der Konfiguration.

Rückgabewert

Die Texture, oder Nothing, wenn keine Textur zugewiesen ist.

Beispiel

' swComp ist eine Component2, etwa aus AssemblyDoc.GetComponents.
Dim swTexture As SldWorks.Texture
Set swTexture = swComp.GetTexture(swComp.ReferencedConfiguration)
If swTexture Is Nothing Then Debug.Print "Keine Textur" Else Debug.Print swTexture.MaterialName

Siehe auch

Verfügbarkeit

SOLIDWORKS 2005

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

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