Get Surface-finish Image Path and Filename Example (VBA)
This example shows how to get the path and filename of the image file
used for an appearance's surface finish.
'----------------------------------
'
' Preconditions: Model is open that has
' an
appearance applied to it and
' an
image was specified for its
' surface
finish.
'
' Postcondition: None
'
'----------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim varAppearances As Variant
Dim vAppearance As Variant
Dim swAppearance As SldWorks.RenderMaterial
Dim sName As String
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
varAppearances = swModelDocExt.GetRenderMaterials
For Each vAppearance In varAppearances
Set
swAppearance = vAppearance
Debug.Print
"Appearance surface-finish image path and filename: " &
swAppearance.BumpTextureFilename
Next
End Sub