Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Gang...
Piecing together some iLogic that will prompt the user to choose an Appearance and then apply this appearance to all components and welds in that assembly.
I get it to work once and awhile, but mostly it doesn't work.
I get it to work thru the pop up message, but after that it errors.
Thoughts?
' This iLogic shows a list from our colors and allows you to pick each component that you want to change to. Dim oAsset As Asset Dim oAsset_Array As New ArrayList For Each oAsset_Array_X In ThisApplication.ActiveAppearanceLibrary.AppearanceAssets oAsset_Array.Add(oAsset_Array_X.DisplayName) oAsset_Array.Sort() Next 'present the user with the list to choose from oAsset_Array_Selected = InputListBox("CHOOSE TEXTURE FROM ABOVE LIST", oAsset_Array, oAsset_Array.Item(0), "TEXTURE SELECTION", "LIST OF TEXTURES") MessageBox.Show(oAsset_Array_Selected, " All components will change to this color...") Dim doc As AssemblyDocument = ThisApplication.ActiveDocument ' set your colors/assets here Dim assetOccurrences As Asset = doc.Assets.Item(oAsset_Array_Selected) Dim assetWelds As Asset = doc.Assets.Item(oAsset_Array_Selected) For Each occ As ComponentOccurrence In doc.ComponentDefinition.Occurrences occ.Appearance = assetOccurrences Next Dim weldDef As WeldmentComponentDefinition = doc.ComponentDefinition weldDef.WeldBeadAppearance = assetWelds
Thanks in advance,
Steve H.
Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Inventor Certified User / Vault Professional Influencer
Solved! Go to Solution.