Advertisement
Nexeon

Untitled

Jun 13th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Sub Test2()
  2. Dim oSelectSet As SelectSet
  3. Set oSelectSet = ThisApplication.ActiveDocument.SelectSet
  4.  
  5. Dim oGreenHighlight As HighlightSet
  6. Set oGreenHighlight = ThisApplication.ActiveDocument.CreateHighlightSet()
  7. oGreenHighlight.Color = ThisApplication.TransientObjects.CreateColor(0, 255, 0)
  8.  
  9. Dim oSelect
  10. Set oSelect = oSelectSet.Item(1)
  11.  
  12. 'If selection is Face'
  13. If (oSelect.Type = kFaceObject) And (oSelectSet.Count = 1) Then
  14. Dim oBody As SurfaceBody
  15. Set oBody = oSelect.SurfaceBody()
  16.  
  17. For I = 1 To oBody.Faces.Count Step 1
  18. If (oSelect.InternalName = oBody.Faces.Item(I).InternalName) Then
  19. oGreenHighlight.AddItem (oSelect)
  20. MsgBox ("Index of Face is " & CInt(I))
  21. Set oGreenHighlight = Nothing
  22. End If
  23. Next
  24. End If
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement