Change an image for an coppied appearance

Change an image for an coppied appearance

ngocson8335
Advocate Advocate
307 Views
0 Replies
Message 1 of 1

Change an image for an coppied appearance

ngocson8335
Advocate
Advocate

Hello Everyone,

 

I am trying to add an image to an appearance that I copied from the Autodesk library. But I got an error as the picture below:

 

ngocson8335_0-1593020459503.png

My code:

 

                _newAppearanceAsset = _genericAppearanceAsset.CopyTo(_TTFAppearance)
                _newAppearanceAsset.DisplayName = "New Material"

                Dim _originalColor As Inventor.ColorAssetValue
                _originalColor = _newAppearanceAsset.Item("generic_diffuse")
                _originalColor.HasConnectedTexture = True

                Dim _originTexture As Inventor.AssetTexture
                _originTexture = _originalColor.ConnectedTexture

                Dim _fileName As Inventor.FilenameAssetValue
                _fileName = _originTexture.Item("unifiedbitmap_Bitmap")
                _fileName.Value = "C:\TTFMaterials\Appearance_Images\FJL.jpg"

 

Many thanks

Ngoc Son
Autodesk User
0 Likes
308 Views
0 Replies
Replies (0)