Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

how to find the bitmap in appearance -> bump ->

^_^clovis^_^
Advocate

how to find the bitmap in appearance -> bump ->

^_^clovis^_^
Advocate
Advocate

Hello,

I'm trying to find the file name, used for the bump pic.

_clovis__0-1689325339016.png

_clovis__1-1689325413596.png

Public Sub TAppearances()
    Dim partDoc As PartDocument
    Set partDoc = ThisApplication.ActiveDocument
    
    Dim Appearances As AssetsEnumerator
    Set Appearances = partDoc.AppearanceAssets
    
    Dim oAssetValCol As ColorAssetValue
    
    Dim appearance As Asset
    Dim count As Integer
    count = 1
    Set appearance = Appearances.Item(8)
        Dim value As AssetValue
        For Each value In appearance
            
            If value.Type = kColorAssetValueObject Then
                Dim texture As ColorAssetValue
                Set texture = value
                Dim oFileBump As FilenameAssetValue
                'set oFileBump = oValue.
                Debug.Print (count & " - " & value.DisplayName)
                Dim textureValue As AssetValue
                
            End If
'            For Each textureValue In texture.value
'                    Debug.Print ("- - " & TextValue.Type)
'                Next
'            If value.ValueType = kAssetValueTypeColor Then
'                Dim texture As TextureAssetValue
'                Set texture = value
'
'                Dim textureValue As AssetValue
'                'For Each textureValue In texture.value
'                   ' If textureValue.ValueType = kAssetValueTypeFilename Then
'
'                        Dim fileValue As FilenameAssetValue
'                        Set fileValue = textureValue
'                        Debug.Print appearance.Name
'                        Debug.Print "   " & fileValue.value
'                    'End If
'                'Next
'            End If
        count = count + 1
       Next

 

This code still doesn't work. It's used to find the .png with try and error.... 

 

Thank for any hint to point me to the right direction.

 

0 Likes
Reply
Accepted solutions (2)
369 Views
3 Replies
Replies (3)

WCrihfield
Mentor
Mentor
Accepted solution

Hi @^_^clovis^_^.  If you are only looking for a file name of a bmp file within a specific appearance Asset object, you do not need to look into ColorAssetValue, TextureAssetValue, or AssetTexture.  You simply need to look for an AssetValue (base type for all more specific types) that is a FilenameAssetValue by checking If AssetValue.ValueTypekAssetValueTypeFilename.  Then once you have a FilenameAssetValue object to a variable of that specific type, then you can simply print the FilenameAssetValue.Value which will be a String (the file name).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

^_^clovis^_^
Advocate
Advocate

Hello WCrihfield,

Thanks for the How to. I'll look into it. Just have to check which image I get, the Generic, Transparency, Cutouts or the Bump one.

 

Thanks again.

Regards.

0 Likes

^_^clovis^_^
Advocate
Advocate
Accepted solution

It was actually easier than I thought. With just a few lines I get what I want.

Thanks to WCrihfield, for pointing me the right way!

 

For Each oAsset In docAssets
        For Each oAssetVal In oAsset
            If oAssetVal.ValueType = kAssetValueTypeFilename Then
                Debug.Print (oAsset.DisplayName & " - " & oAssetVal.ValueType & " - " & oAssetVal.DisplayName & " - " & oAssetVal.value)
            End If
        Next
    Next

to