remove pic in material appearance

remove pic in material appearance

^_^clovis^_^
Advocate Advocate
407 Views
2 Replies
Message 1 of 3

remove pic in material appearance

^_^clovis^_^
Advocate
Advocate

Hello,

I'm trying to remove the image in the default material used when importing a Step file. But I can't find a solution.

If someone has an idee please share it with me. I'm trying at first in part and scale it later to assembly.

Thanks

 

 

 

 Dim invDoc As Document
    Set invDoc = ThisApplication.ActiveDocument
 
    If invDoc.DocumentType = kPartDocumentObject Then
        'create object color/look
        Dim oAsset As Asset
        Dim oLib As AssetLibrary: Set oLib = ThisApplication.AssetLibraries("Autodesk Appearance Library")
        Set oAsset = oLib.AppearanceAssets("Generic")
        
        Dim pcd As PartComponentDefinition
        Set pcd = invDoc.ComponentDefinition
           invDoc.ActiveAppearance = oAsset
        'Next
0 Likes
408 Views
2 Replies
Replies (2)
Message 2 of 3

^_^clovis^_^
Advocate
Advocate

I forgot to mention, I'm using Inventor 2017 pro.

It seems to be a known problem as it is already mentioned hier.

Is there a fix somewhere?

Thanks

0 Likes
Message 3 of 3

^_^clovis^_^
Advocate
Advocate

thanks to Saseendrankom I've solved my problem to remove a link used in appearance.

kind of.

Sub AssetTextureSample()

    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim oAppearance As Asset
    
    For Each oAppearance In oDoc.Assets

        Dim oValue As AssetValue
    
        For Each oValue In oAppearance
         'Set oValue = oAppearance.Item(13)
            If oValue.Name = "generic_bump_map" Then
                
                Dim oColorValue As ColorAssetValue
                Set oColorValue = oValue
                oColorValue.HasConnectedTexture = False
                oDoc.update
            End If
        Next
    Next

End Sub
0 Likes