Message 1 of 3
iLogic Select Face add Color
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
I wanted to simplify my work when choosing the most common colors.
Problem when I had a document open in Assembly. Please watch the video. Files in the attachment. The files are in a version of Inventor 2020
I tried ThisApplication.ActiveEditDocument, mostly this command works. But there was another mistake. I do not know what it means.
Please, what should I do to make it work? What did I do wrong?
Dim oDoc As Document = ThisApplication.ActiveEditDocument 'Dim oDoc As Document = ThisDoc.Document Dim oCD As ComponentDefinition = oDoc.Componentdefinition InventorVb.DocumentUpdate() oDef = oDoc.ComponentDefinition 'define appearance library by name Dim assetLib As AssetLibrary 'assetLib = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library") 'sColor1 = "Gold" oLanguage = ThisApplication.LanguageName If oLanguage = "English" Then assetLib = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library") 'English Code Here. sColor1 = "Cyan" textvyberu = "Select Face" ElseIf oLanguage = "Czech" Then assetLib = ThisApplication.AssetLibraries.Item("Knihovna vzhledů Autodesk") textvyberu = "Vyber Plochy" 'Czech Code Here. sColor1 = "Světle modrá" End If 'iLogicVb.UpdateWhenDone = True 'define colors to work with Dim libAsset1 As Asset libAsset1 = assetLib.AppearanceAssets.Item(sColor1) ' try to Copy the asset locally. Try localAsset1 = libAsset1.CopyTo(oDoc) Catch 'assume error means it's already local localAsset1 = oDoc.Assets(sColor1) End Try Line1: 'Dim oSolid As SurfaceBody = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select SolidBody") 'Dim oSolid As SurfaceBody = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Vyber Tělesa") Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, textvyberu) If oFace Is Nothing Then Exit Sub 'oSolid.Visible = False Me_Color = oDoc.Assets(sColor1) oFace.Appearance = Me_Color GoTo Line1