Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have a problem with the function below. The line `oAsset.Item("generic_diffuse").Value = assetColor` fails with the following error: "Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))" indicating that the .Value value is not available.
From what I can tell, it's doing the same thing all the other examples are doing, but it's just not working.
' Function to check and create appearance asset
Function GetOrCreateAppearanceAsset(ByVal assetName As String, ByVal assetColor As Color) As Asset
Dim oAssetLib As AssetLibrary = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library")
Dim oAssets As Assets = ThisApplication.ActiveDocument.Assets 'oAssetLib.AppearanceAssets
' Check if asset already exists
Dim oexistingasset As Asset
For Each oexistingasset In oAssets
If oexistingasset.DisplayName = assetName Then
GetOrCreateAppearanceAsset = oexistingasset
Exit Function
End If
Next
' Create new appearance
Dim oAsset As Asset = oAssets.Add(kAssetTypeAppearance, "Generic", _
assetName, assetName)
' Set color
oAsset.Item("generic_diffuse").value = assetColor
GetOrCreateAppearanceAsset = oAsset
End Function
Any suggestions?
Solved! Go to Solution.