Message 1 of 3
How can i set the apperance of a part-Vb.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
im Trying to set the appearance of a surface body from the content center to the default but i cant seem to find the asset.
Friend Sub ChangeBodyApperance(Body As SurfaceBody, PartDoc As PartDocument)
Dim AssetLst = PartDoc.Assets
Dim CurrentAsset = Body.Appearance
' MsgBox(CurrentAsset.Name)
Dim DefaultAsset As Asset
Try
DefaultAsset = AssetLst("Default")
Catch ex As Exception
Dim _App As Inventor.Application = Body.Application
Dim AssetLib = _App.AssetLibraries("Autodesk Appearance Library")
Dim LibDefault = AssetLib.AppearanceAssets("Default")
DefaultAsset = LibDefault.CopyTo(PartDoc, True) 'throws a error here
End Try
If CurrentAsset.Name <> DefaultAsset.Name Then
Body.Appearance = DefaultAsset
End If
End Sub
HII