Advertisement
Guest User

VBA zad1 lista 2

a guest
Dec 16th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.93 KB | None | 0 0
  1. Attribute VB_Name = "Module1"
  2. Sub zad2()
  3. Dim ModelSpace As AcadModelSpace
  4. Set ModelSpace = ActiveDocument.ModelSpace
  5. Dim sset As AcadSelectionSet
  6. Dim tempSet As AcadSelectionSet
  7. Dim blockref As AcadBlockReference
  8. Dim atr As Variant
  9. Dim tagstr As String
  10. Dim txtstr As String
  11. Dim fType(0) As Integer
  12. Dim fData(0) As Variant
  13. For Each tempSet In ThisDrawing.SelectionSets
  14. If tempSet.Name = "SS1" Then
  15.     Set sset = ThisDrawing.SelectionSets("SS1")
  16. Else
  17.     Set sset = ThisDrawing.SelectionSets.Add("SS1")
  18. End If
  19. Next
  20.  
  21. sset.Clear
  22. sset.SelectOnScreen
  23. Set blockref = sset.Item(0)
  24. atr = blockref.GetAttributes
  25. tagstr = atr(0).TagString
  26. txtstr = atr(0).TextString
  27. fType(0) = 2 'filtr DXF, który wskazuje na bloki
  28. fData(0) = tagstr ' jaki blok nas interesuje (po nazwie)
  29. sset.Select acSelectionSetAll, , , fType, fData ' zaznacz wszystkie obiekty, które są blokiem o danej nazwie
  30.  
  31. sset.Highlight (True)
  32. Application.Update
  33. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement