
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Guys,
I'm having a problem highlighting parts within a sub assembly. A simple structure to demonstarte this issue would be:
TopLevel.iam
|
SubAssy.iam
|
ChildPart1.ipt
ChildPart2.ipt
Using this structure I wish to highligh ChildPart1.ipt, howver my vba macro code below doesn't seem to work (nothing happens):
Public Sub Highlight()
Dim SubAssy As Inventor.AssemblyDocument
Dim ChildPart1 As Inventor.ComponentOccurrence
Dim highlightSet As Inventor.highlightSet
Set SubAssy = ThisApplication.ActiveDocument.ReferencedDocuments(1)
Set ChildPart1 = SubAssy.ComponentDefinition.Occurrences(1)
Set highlightSet = SubAssy.CreateHighlightSet()
highlightSet.Color = ThisApplication.TransientObjects.CreateColor(255, 255, 255)
highlightSet.Color.Opacity = 0.8
highlightSet.AddItem ChildPart1
End Sub
Can anyone provide any help?
Many thanks,
Adrian.
Solved! Go to Solution.