Message 1 of 4

Not applicable
08-13-2015
02:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following code gives error,
strRS = "Oxidized" Dim strChrome As String = "Chrome - Polished" Try oAppAsset = oPartDoc.AppearanceAssets.Item(strRS) oAppAsset2 = oPartDoc.AppearanceAssets.Item(strChrome) Catch ex As Exception Try oAppAsset = m_inventorApplication.AssetLibraries.Item("Autodesk Appearance Library").AppearanceAssets.Item(strRS) oAppAsset2 = m_inventorApplication.AssetLibraries.Item("Autodesk Appearance Library").AppearanceAssets.Item(strChrome) End Try Try oPartDoc.ActiveAppearance = oAppAsset Catch ex As Exception MsgBox("error changing active appearance" & vbCrLf & ex.Message) End Try Try osolidRev1.Faces.Item(4).Appearance = oAppAsset2 osolidRev1.Faces.Item(7).Appearance = oAppAsset2. osolidRev1.Faces.Item(10).Appearance = oAppAsset2 osolidRev1.Faces.Item(12).Appearance = oAppAsset2 'Dim oChrome As RenderStyle 'oChrome = oPartDoc.RenderStyles.Item("Chrome - Polished") 'osolidRev1.Faces.Item(4).SetRenderStyle(StyleSourceTypeEnum.kOverrideRenderStyle, oChrome) 'osolidRev1.Faces.Item(7).SetRenderStyle(StyleSourceTypeEnum.kOverrideRenderStyle, oChrome) 'osolidRev1.Faces.Item(10).SetRenderStyle(StyleSourceTypeEnum.kOverrideRenderStyle, oChrome) Catch ex As Exception MsgBox("error changing face appearance" & vbCrLf & ex.Message) End Try
in the above code error occurs while changing the face appearance asset. If i use the old SetRenderStyle method then it works good. Is the above code for face appearance to use asset is the correct syntax or 2016 API issue?
Solved! Go to Solution.