- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can i set the apperance of a part-Vb.net
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @davidt162003. Content Center files are usually ReadOnly. That is likely why it is throwing an error when you try to copy an Appearance asset from the appearance library down into that document. That is just the nature of Content Center generated models. But you may be able to copy that model file out of the Content Center storage area (which is seen as a Library), and put it out in your regular model file area, then change a couple things to dis-associate it from the Content Center. Then you may be able to add another appearance to the document and use that to change the appearance of the model.
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I had already done that but i realized i was passing it the old CC part doc rather than the one i copyed